OpenLayers is a JavaScript library for creating dynamic map widgets for web sites.

learn more… | top users | synonyms

0
votes
3answers
6k views

Understanding the polygon handler function in Openlayers

Using openlayers, I want to be able to draw one polygon on a map. After one polygon is drawn, I want an event to fire that stops any more from being drawn until a button is pressed. My current code ...
0
votes
1answer
3k views

Query Feature using OpenLayers + MapServer

I'm trying to query a feature in OpenLayers, but it's returning just an image highlighted that is not possible to make zoom, pan and drag. My intention is to query a feature on the map like street ...
9
votes
2answers
6k views

In OpenLayers zoom to extent of all overlays

In Openlayers I can zoom to the bounding box of all layers like this: map.zoomToExtent(); I can also zoom to the bounding box of a single layer: map.zoomToExtent(layer_name.getDataExtent()); Is ...
8
votes
1answer
3k views

getExtent() in OpenLayers returns strange values

I'm trying to get the bounding box of the map area displayed by OpenLayers. I tried to use map.getExtent() because it should be exactly what I need, but the returned values are "strange": For ...
7
votes
3answers
1k views

Suggestion about the database to be used with OpenLayers

Can anyone suggest me which database to be used with OpenLayers? I have to store the values in a DB table and retrieve them (trivial tasks). which is better MySQL or PostGIS? Can anybody give benefits ...
6
votes
3answers
1k views

Openlayers - Cloned features get style from original feature

I am having a problem with the styling of a WFS vector layer from GeoServer after cloning features from it and adding them to a new feature. First I create a new empty vector layer and add it to the ...
6
votes
1answer
630 views

What is the difference between projection and displayprojection for a Map in OpenLayers?

I am familiarizing myself with Openlayers, and am having trouble with understanding the projection and displayprojection properties for a Map. When the map is initialized with the following code: ...
6
votes
1answer
706 views

What server and API to use for displaying complex polygons with dynamic symbology?

Background I need to interface a map into an existing website which allows the user to query a database and which currently results in a table listing population statistics per county. For example, ...
6
votes
4answers
8k views

How to display mouse position as tooltip in OpenLayers?

I want map coordinates as mouse over effect in OpenLayers. I am using the following code, however it is showing pixel coordinates: map.events.register("mousemove", map, function(e) { ...
5
votes
2answers
5k views

Will mousedown events fire with Touch events on OpenLayers mobile?

I can't get the mousedown event to fire on a mobile device when I click on a marker. I'm using openlayers 2.11 with TouchNavigation. The mousedown event fires just fine in Chrome on my Desktop. Are ...
4
votes
1answer
565 views

Is there a way to get centroid of geographic object in MSSQL?

I have a table of OSM geographic roads in MSSQL 2012. I want to create a new column with the centroid of each road (So I can set center on OpenLayers map for each road). How can I do it ?
4
votes
3answers
4k views

How can I unselect a feature in Openlayers?

I am able to identify the selected features on my map using the following line: vector_layer.selectedFeatures I would like to be able to deselect this feature using a standalone function (not an ...
4
votes
1answer
945 views

OpenStreetMap tiles not loaded despite being received

While using OpenLayers to load OpenStreetMap, I observe that part of the map would sometimes be covered with blank pink tiles. I searched and found similar complaints with solutions suggesting the ...
4
votes
1answer
2k views

Overlaying WMS from Mapserver in OpenLayers with epsg:900913 from Google/Bing/OpenStreetMap

ADDED: Another curious effect is that no matter to what scale I zoom on the baselayer google/bing map, the WMS overlay is always the same-sized shot of MN. That is, as the baselayer map is scaled up ...
4
votes
1answer
2k views

How can I remove a layer from layerswitcher in openlayers?

I have several vectors and WMS layers in layer switcher.But i don't need these layers to be displaying in layer switcher.How can i remove these layers from layer switcher? Thanks in advance..
4
votes
1answer
615 views

Authentication in geoserver with openlayers

Is there a way to authenticate in geoserver with a external webpage (made with asp.net and openlayers)? I have restricted the access data only by certain users, and I don't want to authenticate this ...
4
votes
0answers
381 views

Map is missing when I “export as image” via print composer [closed]

I have point data on a vector layer that prints accurately via print composer (when I "export as image"), however my map below either does not show up or shows up at an incorrect scale. I used ...
4
votes
3answers
568 views

Can I prevent features from being created outside an OpenLayers map?

In our app, we allow users to create features on maps. The boundaries of these features will later be converted into real-life latitude/longitude coordinates, but does not make sense if features are ...
4
votes
2answers
2k views

Prevent OpenLayers WMS layer cache by browser

I am using OpenLayers (GeoExt) with google chrome browser. All WMS layer is for live database. I have refreshed the browser at certain interval using javascript but the data is cached in browser and ...
4
votes
1answer
3k views

Print Library for Open Layers?

I realize this is a bit of an open question but are there any known open javascript libraries which facilitate printing an OpenLayers map? I'm looking to produce the content on the client and ...
4
votes
1answer
7k views

How to get features in Openlayers vector layer

What is the exact API to get all features in a vector layer in OpenLayers? Suppose I have the "map" object, within which is a "Vector Layer": how can I obtain features in the layer?
4
votes
1answer
4k views

GeoServer Web Feature Service (WFS) in Open Layers Problem

I am running GeoServer 2.1.1, and have a datastore from ArcSDE populated with features projected in EPSG:26918. I can successfully add a WMS to an OpenLayers map, but am having issues with WFS. I have ...
4
votes
1answer
6k views

register event “loadend” on layer

I'm trying to register a listener event on "loadend" for my google maps layer on OpenLayers. But for some reason it's not firing. There must be something small i'm overlooking. What is wrong with my ...
3
votes
0answers
117 views

How to determine and send alert SMS for next bus stop in a GPS tracking system?

In my gps tracking system (PHP/MySql) I have got 5 Stops for a vehicle. Whenever the bus reaches stop 1, the passengers at stop 2 should get an SMS alert. And in the same way for the sops followed ...
3
votes
2answers
778 views

Cluster Strategy different Labeling at Different Level

what I did? I am trying to plot some points using cluster strategy of openlayer using animatedCluster plugin. I have gson data as given: { "type": "FeatureCollection", "features": [ { ...
3
votes
2answers
325 views

Question Regarding Interpretation of Openlayers BBOX in 4326 Projection

I have a BBOX strategy in my Vector layer, which is sending HTTP GET Requests to my server in order to get the features I wish to display. The projection of the layer is EPSG:4326, so it is my ...
3
votes
1answer
278 views

Can I use QGIS plugins in PyQGIS as a stand alone script without iface?

Can I use a qgis plugin especially (openlayers plugin) in stand alone pyqgis script? I don't find examples, just code using iface but that cannot used in stand alone script.
3
votes
2answers
514 views

How to get column names of layer (WMS) using OpenLayers?

Is it somehow possible to get layer's column name using OpenLayers? any example and documentation would be really useful? Edit: I have already tried WMS_describeLayer topp:states layer: <?xml ...
3
votes
1answer
1k views

How to display a control (zoom bar) outside map container in openlayers?

Since I'm new to OpenLayers this question might be the simplest of them all but after a quick search on the subject I couldn't find anything useful, so: Is it possible to put a OpenLayers zoom ...
3
votes
3answers
1k views

openlayers attribute substitution failing on kml file

I'm trying to read in mile markers for a marathon from a .kml file and use the MILE attribute to set the label. My layer code looks like this: // add layer mile_markers_layer = new ...
3
votes
1answer
1k views

Wrong tiles generated in OpenLayers XYZ layer

I am creating a map in OpenLayers using Base layer as ESRI online map server. And second layer as our own esri map server serving the overlay. The Base layer shows correctly, but OpenLayer requests ...
3
votes
1answer
2k views

How do I clip/mask a satellite photo to a polygon?

Given a shapefile composed of contiguous polygons, I'd like to clip (or mask) regions of satellite photo to the polygon outlines, and export each resulting raster in medium resolution for further ...
3
votes
1answer
3k views

Change Vector projection in Openlayers

I have added vector layer to map vactorTest = new OpenLayers.Layer.Vector("Editable Features", { strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy], projection: new ...
3
votes
1answer
571 views

GeoServer - Serving html files

Encountering a Geoserver - Openlayer WFS layer not visible I found this interesting answer . Solution about html page on the server surprised me very much as I tried previously to load an html page ...
3
votes
1answer
4k views

Path to proxy.cgi for GeoServer is not accessible in browser

There have been several questions very similar to this asked already (including ones not involving GeoServer), but their solutions have not solved my problem. I am trying to use getFeatureInfo on my ...
3
votes
1answer
1k views

Can a layer's style be modified dynamically using an SLD in OpenLayers?

I am a complete novice with GeoServer and OpenLayers. I'm trying to ascertain at what point a style is applied to a GeoServer layer which is drawn in OpenLayers, when using an SLD. The Introduction ...
3
votes
1answer
2k views

OpenLayers SelectFeature control ignores graphicZIndex

I am having trouble with SelectFeature control with hover = true and highlightOnly = true. There are two adjacent polygons on the same layer, one on top of the other. There's also a SelectFeature ...
3
votes
2answers
4k views

Is there a way to limit the overview map to a certain zoom level?

The OpenLayers overview map control works great when I use standard options. I would like to limit the overview to one resolution, but I can't seem to find the right combination of values for the ...
3
votes
2answers
1k views

How to set a custom center and zoom level for Zoom World icon in OpenLayers?

OpenLayers Zoom Pan Control has a Zoom World Icon. When it is clicked the map zooms all the way out. Is it possible to override this behavior and define a center and zoom level to which the map should ...
3
votes
1answer
2k views

OpenLayers WFS protocol query after vector layer creation

I want to be able to create a layer on init, then load features from a WFS protocol afterward. I'm having trouble doing this. Using WFS protocol in vector constructor works fine and is not my ...
3
votes
2answers
668 views

Generate cache tiles for EPSG:27700 for use with OpenSpace

I am using GeoServer 2.1.0 (windows jetty local install for dev), open layers and Ordnance Survey openspace api and have a set of shape data that I am using as an overlay. Everything is working as ...
2
votes
2answers
224 views

How to zoom to wms layer after cql filter on Open layers

I created o layer contain points and I added it to a map as WMS layer on OpenLayers I did a CQL filter an it's work but I'd like to zoom to the selected point when I worked with getextent or ...
2
votes
1answer
674 views

Add TMS layer to OpenLayers

I have found some examples but haven't managed yet to adapt them to my needs... I have an image that is served as TMS (tiles already statically rendered): ...
2
votes
1answer
729 views

Google maps layer as the base layer and WMS as overlays shows empty map

I have a problem of showing my base layer which is Google Maps. The browser console reports "Uncaught TypeError: undefined is not a function" in var google_streets = new ...
2
votes
1answer
871 views

Problem with WFS-T save strategy in Openlayers

In my web map application, I have added the editable wfs vector layer for feature editing. But in save strategy method, Insert and Update Geometry is working fine.But Update Attributes is not saved in ...
2
votes
1answer
1k views

How to display several points of a KML with the same coordinates in OpenLayers?

I've got a KML, where several points have the same coordinate, similar to following code: <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> ...
2
votes
1answer
419 views

How to auto-update WFST store with GeoExt/Openlayers?

I built an WFS-T with a grid panel (Ext.grid.EditorGridPanel) to edit features' attributes. Now, I want the feature store (GeoExt.data.FeatureStore) to reload/update automatically so that other users ...
2
votes
2answers
1k views

KML from EPSG:4326 to EPSG:900913

im trying to create KML files manually (XML format) by extracting data from a postGIS database with "geography" values in a column. But i belive i need to transform the projection of each row in the ...
2
votes
0answers
813 views

How to add multiple nested node in GeoExt

I have following codes, but i want to add severel parent>child>chill>child>child (4 level inside) nodes with all check box options (for user choice) in the tree panel, in fact sum of all these (parent ...
2
votes
3answers
840 views

adding non spatial attributes using geoserver

I am using Openlayers + geoext to perform transaction operations in postgis database using geoserver . i can insert spatial data into postgis but cannot insert other data like road name, road type in ...