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

learn more… | top users | synonyms

2
votes
1answer
2k views

Openlayers - Get extent of WFS vector layer and zoom to that extent when map

I would like to do the following: 1) While loading an OpenLayers map object get the lat/long Bounding Box of a WFS vector layer served from GeoServer. 2) Use the extent from the WFS vector layer to ...
2
votes
4answers
1k views

creating 2 dragable layers at the same time in OpenLayers?

I have been been working with this for a while now. Whenever you add 2 seperate draggable layers, openlayers will only activate the last one added. I wish it could be as simple as the code below. But ...
2
votes
1answer
2k views

QGis failed with error: latitude or longitude exceeded limits

I have some shapefiles from vegetationtypes in QGis and i wanted to put a googlemap in background, so i installed the open layers plug in. But every time i tried to load the map, theres an error ...
2
votes
1answer
3k views

Creating Vector features onload in Openlayers

Using openlayers and javascript I wish to create two vector layers and add a polygon to one of them and a circle with a centre point to the other My polygon will be in WKT and my circle will be a ...
2
votes
1answer
980 views

How to unproject coordinates on a Google map with Openlayers?

Below is my code and a pic. When I finish making my circle on a Google map with Openlayers, I get the following coordinates but I want coordinates like E.G: bottom: -27.762124575762 left: ...
2
votes
1answer
880 views

geoserver wfs insert error

I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below var Projection = new OpenLayers.Projection("EPSG:4326"); ...
2
votes
4answers
674 views

Incremental retrieval of data from a database - OpenLayers

I have a new task now: The user will input the lat-lon values in a html Form and when an INSERT button is clicked these values should be stored the DB. Now when a submit button is clicked the markers ...
1
vote
1answer
126 views

Problem with using a circle as polygon for querying PostGIS

I'm trying to query PostGIS and find some object features that intersect with a circular buffer created by the user using OpenLayers, JavaScript and PHP. I use the following code for creating the ...
1
vote
1answer
861 views

Probleme with WFS protocol in OpenLayers

Sorry for disturbing. I know my problem look common, but I really don't know what to make. Here is my code for getting a WMS layer in OpenLayers from Geoserver. var wfs2 = new ...
1
vote
1answer
314 views

Load a feature from geoserver using WFS protocol on localhost

I am a student enginner in GIS , I want to load my features from geoserver using WFS protocol. I'm using this code but it's not appearing in my browser OpenLayers.ProxyHost = ...
1
vote
1answer
3k views

Integrate GeoJSON file with openlayers.protocol.http

I've got a problem with (the title says it) integrating a geojson file in my openlayers map. I have to use the openlayers.protocol.http way. I examined lots of examples on the web (and on ...
1
vote
1answer
909 views

GetFeature Request with Polygon Intersecting Polygons

My task is very straightforward: a user draws a polygon and query all parcel polygons. The query string extends the URL limit. So I am posting XML to WFS. However, GeoServer always returned 0 feature, ...
1
vote
1answer
804 views

Googlemaps Layer on Openscales

I'm using openscales in a web mapping project, i would like to add a Google maps layer, i know that there's some licence problems , but i don't care for these licence issues, i'm looking to add ...
1
vote
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
32 views

OpenLayers/jQuery without CDN?

I was wondering what are the necessary files for hosting a webgis server with OpenLayers3 without using a CDN? I am testing on a localhost without internet access. It doesn't work to merely copy ...
0
votes
1answer
551 views

How get Map extents for draw polygon when final click is done?

I am using openLayer js to draw a polygon and now i want map extents of the drawn polygon one final click (i.e. user finish drawing polygon or double click is done). For drawing the polygon i am using ...
0
votes
2answers
10k views

Openlayers How would i get a hover label over my polygon

make a hover/mouseover label for a polygon in Openlayers? I made a map with draw, delete and drag polygon function. Now I need to make a hover mouseover for this. How to get a hover label for ...
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
2k 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
769 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
731 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, ...
5
votes
0answers
410 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 ...
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
612 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
1answer
313 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.
4
votes
3answers
5k 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
1k 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
661 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
3answers
620 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
3k 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
3answers
5k views

How do I include proj4js in openlayers?

in my Openlayers app, since the base map projection is not epsg900913 or 4326, I need to include proj4js in order to use geolocation feature. but i got such a error notice: GET ...
4
votes
2answers
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 ...
4
votes
1answer
1k views

OpenLayers Style Question … not working in IE

I'm trying to use OpenLayers to produce a map I'm using the following to style a layer in the map. It seems to work fine in Firefox but I get javascript error in IE 'symbolizer' is null or not an ...
3
votes
0answers
130 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
914 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
344 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
1k views

How to add SLD to a wms layer dynamically from javascript

How to add SLD style which is written in String format and stored in a 'var' variable of javascript and asign it to a WMS layer while creating it.
3
votes
2answers
616 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
2k 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
3k 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 ...