jramm | 23 May 09:09 2015

Examples of larger applications?


All the OL tutorials and examples I can find are geared towards writing
little bits of javascript directly in the HTML file or a single external
Im struggling to make the leap from that to implementing larger apps.

Are there any examples of using OL in larger, modular applications? I'm
especially interested in apps which allow users to define their own
datasources and dynamically add them to the map etc...

View this message in context: http://osgeo-org.1560.x6.nabble.com/Examples-of-larger-applications-tp5207250.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
joaorodr84 | 22 May 03:39 2015

How to make symbolizers use attribute values in OpenLayers.Layer.WMS?

I know it works like a charm for vector layers. But considering that we can
make the symbolizers use attribute values in the SLD, I think OpenLayers
should support it. But apparently it doesn't.

In the example below, I have a layer with 10 points, where the attribute
*ogc_fid* has the values 1, 2, ..., 10.

I want the stroke width of each point to be the value of its *ogc_fid*
attribute.  Here <http://codepen.io/joaorodr84/pen/LVRQgg>   is the whole
code, but I will explain the most important parts.

    /* Rule */
    var rule = new OpenLayers.Rule({
        filter: filter,
        symbolizer: {
            Point: {
                fillColor: '#dddd00',
                fillOpacity: 1,
                pointRadius: 30,
                strokeWidth: '${ogc_fid}',
                graphicName: 'circle'
            Text: {
                label: '${ogc_fid}'

Above, I have the rule, where I use *strokeWidth: '${ogc_fid}'* indicating
that I want the stroke width to assume the value of the `ogc_fid` attribute
(Continue reading)

joaorodr84 | 19 May 02:36 2015

How to make OpenLayers.Control.DragPan persist?

I want to use controls like DrawFeature and SelectFeature, but while these
controls are active, I want to have a way to drag the map, using DragPan

For example, I am selecting features. I select the first, the I would have
to pan the map in order to select the 2nd feature (not unselecting the 1st

Is it possible to make DragPan work as some kind of background control, that
would always be active, even when using other controls?


View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-make-OpenLayers-Control-DragPan-persist-tp5206311.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
KS | 18 May 12:57 2015

How to start draw feature on map programmatically

Hi everyone,

 I'd like to know how to start draw a feature (ex. Polygon) on  map  
using OpenLayers.Control.DrawFeature

I have a map with OpenLayers.Control.DrawFeature on toolbar 
(OpenLayers.Control.Panel ).
I can start draw feature geometry on map selecting button/ icon on 
toolbar and it works.

But how to start draw a feature (ex. Polygon) programmatically on  map 
using Control.DrawFeature
without selection on draw button/ icon on toolbar (strat from javascript 
code) .

Thanks in advance for any help

Guru Damodar Dutt | 18 May 07:59 2015

Fill pattern for styling a polygon geometry


I am trying to style a feature (polygon geometry) using the example - http://dev.openlayers.org/sandbox/ossipoff/openlayers/examples/graphicfill.html .

I am using the above specified example to use the fill pattern for polygon. The above example doesn't show any fill when I use my local version of openlayer 2.38. I get the fill pattern as blank where as I expect lines as in given example.
Does this example require a specific version of openlayers?




Guru Dutt

Senior Advisory Software Engineer


T  +91.120.4026000

M +91 7503010580




Pitney Bowes

1st Floor, Tower A, Logix Cyber Park

C-28/29, Sector-62, Noida 201309, INDIA


Users mailing list
ELKHATTABI Imane | 15 May 12:57 2015

BaseMap Definition in GeoExplorer with Openlayers

Hello everyone,

I'd like to know how to define 'Open Street Map' as basemap in the function GeoExplorer.js . The createLayout function is defined as : 

this.map=new OpenLayers.Map({
layers: [
//=========base layer
new OpenLayers.Layer.WMS(
"Global Imagery (vmap) [Online]",
layers: "basic",
transparent: "true",
format: "image/png"
{isBaseLayer: true, visibility: false}
new OpenLayers.Layer.WMS("Global Imagery (OpenGeo) [Online]",
layers: "bluemarble"
//buffer: 0,
isBaseLayer: true,
visibility: false

Instead of 'Global Imagery' base map, I'd like to use 'OpenStreetMap' or 'Google Maps'.

Any hint or help would be highly apreciated.
Thanks in advance
Users mailing list
Jason Hawkins | 14 May 21:01 2015

Refresh map after updating chart elements

 need to refresh an openlayers map after updating the size of pie charts in a mapfile displayed on the map (on button click). I cannot refresh the whole page or I lose the data. It works when I change the zoom level. I have tried map.updateSize() (no effect), map.render() (TypeError "a" is not defined), layer.redraw(). I am not sure if I am missing something openlayers-related, or if it is an issue with my javascript. I have tested a number of solutions, but can't seem to get any of the options working in my case.

$(document).ready(function() { map = new OpenLayers.Map( 'map' , { maxExtent: new OpenLayers.Bounds({{bounds.0}}, {{bounds.1}}, {{bounds.2}}, {{bounds.3}}), controls:[new OpenLayers.Control.Navigation(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.PanZoomBar()], numZoomLevels:20 } ); var mpLayer = new OpenLayers.Layer.MapServer('Zones Layer', '{{ mapserverpath }}', { map:'{{mapFile}}', layers:'all', isBaseLayer: 'true' },{ singleTile: 'true' // ratio: 2.0 } ); map.addLayers([mpLayer]); //map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); map.zoomToMaxExtent(); map.events.register("click", map, qryDB ); $(document).on('click', '#bttnMinus', function(){ pieFact*=0.5; updatePieFact(); mpLayer.redraw(); }); $(document).on('click', '#bttnPlus', function(){ pieFact*=1.5; updatePieFact(); mpLayer.redraw(); }); $(document).on('click', '#bttnReset', function(){ pieFact=1.0; updatePieFact(); mpLayer.redraw(); }); });
Users mailing list
ANC | 12 May 21:58 2015

Blurred Images in Phonegap app

Hello List,

I have a Phonegap Build mapping application that uses a custom map image
with 150 dpi resolution shown through Openlayers  2.13 using:

layer1 = new OpenLayers.Layer.Image("LayerName", img_url, img_extent,
			{alwaysInRange: true });

We are testing on 2 devices in Android and IOS platforms.

In a Samsung Fame device that has 320x480 pixels and 3.5" screen (160 dpi
approx). In this device the map image looks sharp and clear at the map scale
as resolutions almost match.

The iPhone 4 has a 640x960 pixels, 3.5" screen  (320 dpi approx) and the map
image looks blurred.

I can build map image with 320 dpi which should yield a good result in
larger resolution screens but I am worried about the final file size and its
performance in the app.

Is there a type of setting within Openlayers that would allow to use the 150
dpi image in larger resolutions screens and still get a sharp rendering?

Any suggestions will be appreciated, thank you.

View this message in context: http://osgeo-org.1560.x6.nabble.com/Blurred-Images-in-Phonegap-app-tp5205435.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
ELKHATTABI Imane | 12 May 19:07 2015

Pink Tiled Map with Openlayers and Geoserver

Hello everyone,

I'm having a problem with the pink tiles when trying to display a map.
I'm using Geoserver 2.6 . In the main html page , I reference to Openlayers with :

<script src="openlayers/lib/OpenLayers.js"></script>

This is how I define my layer : 

 new OpenLayers.Layer.WMS("dim_province",
layers: "dw1:dim_province",
transparent: true,
format: "image/gif"
}, {
isBaseLayer: false,
buffer: 0,
visibility: false

The layer is displayed with no poblem on Geoserver>preview as openlayers. However It shows a pink tile image when I'm running the html page.

Any hint or help would be highly apreciated.
Users mailing list
zach cruise | 11 May 21:44 2015

rich interface with openlayers

to provide basic richer interface with openlayers 2.x, what do you recommend?

+ http://ole.geops.de/ (active?)
+ http://mapbender3.org/ (active)
+ http://www.geoext.org/ (active?)
+ http://geomoose.org/ (active)
+ http://deegree.org/ (active)
+ http://deegree.org/ (active)
+ http://www.geomajas.org/ (active)

ELKHATTABI Imane | 9 May 11:22 2015

Geoserver / Openlayers : Front-End interface


I am using Geoserver as cartographic server .

I'd like to make a  client side  interface using Openlayers,Ext,Geoext . 
That can select by attributs the layers published on Geoserver as WMS , and display the result on a map (openstreetmap).

Whitch IDE to use for this purpose: Netbeans or Eclipse ?

Thank you in advance

Users mailing list