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

learn more… | top users | synonyms

2
votes
1answer
1k views

Openlayers error after removing selectFeature control

I am using a selectFeature control for a point layer in OpenLayers 2.12. I have a problem after removing the selectFeature control from the map. The reason why I want to remove the control is because ...
3
votes
2answers
2k views

zoomToExtent on Vector Layer

Can someone explain if I am doing this correctly please? I've added some vectors to my map, now wish to zoom and centre the map based on the extends of those vectors. I'm using the following code: ...
2
votes
0answers
65 views

Features disapearing

When I add a polygon feature it shows on the map. When I add another one the first one disappears. The code for adding is below: $.postJSON('@Url.Action("GetLayers")', { "planId": planId }, ...
2
votes
1answer
1k views

How to remove a layer from the Layerswitcher in Openlayers

I have an init-Function, there some layers are added with the option displayInLayerSwitcher = false; Thats ok, but in some situations i need to set this later in the application to true. So i want to ...
2
votes
1answer
160 views

Applying styles to Polygons

Still learning OpenLayers and I think my problem may be a lack of understanding the terminology, however. Is it possible to draw polygons in a different colour within one vector layer, or do all ...
3
votes
2answers
646 views

How to speed up the process of vector data visualization for a web application

I have a GIS web application and vector data that is going from the model to the web application. For developing the User Interface I am using JavaScript and OpenLayers. But sometimes the amount of ...
6
votes
2answers
386 views

How to visualize geolocated data on a slippy map on a website?

I am trying to visualize some data on a website that has been measured while driving around. My source is a CSV file with longitude, latitude and my measured data. I have been able to export it to a ...
7
votes
1answer
186 views

Load third-party APIs only when the corresponding map layer is requested?

OpenLayers allows multiple map layers to be hosted on a common platform. If the map application supports a wide variety of maps, say from Google, Yahoo and Microsoft, I find that upon initialization, ...
4
votes
2answers
2k views

How to implement Routing in openlayers [closed]

I need to add routing functionality in my application how to add the routing in openlayers.
2
votes
1answer
2k views

How to record a base layer change event in OpenLayers?

The OpenLayers.Control class possesses an eventListener property which could be used in the layer switcher control. I am not sure how to make use of it to detect a base layer change event so that I ...
2
votes
1answer
456 views

Vector Layer not visible in openlayers

I'm trying to create a map where I have one wms layer and then a vector layer which is created from a kml file - held in the same directory as the web page. I'm trying to implement the cluster ...
7
votes
1answer
748 views

Is dynamically generating Choropleth maps a solved problem?

I am trying to work out what mapping tools I would need to use to dynamically create Choropleth maps from our data. I am working on a project where the backend is a big database of statistics, and ...
5
votes
3answers
1k views

How to update feature positions with clustering in OpenLayers?

I have an OpenLayers 2.12 map with a vector layer with a cluster strategy. All the static behavior is how I want it. Now I'd like to add the possibility to update the features' position. I do this ...
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 ...
2
votes
1answer
934 views

How to suppress moveend event while switching the base layer?

I have created a map that contains a two base layers (Google Street Map and Open Street Map). A moveend event listener is registered to listen for any map movement which would perform a function call ...
4
votes
1answer
112 views

How to reverse the drawing order of markers?

I saw this example which demonstrates how ordering can be controlled with markers added using styling options (graphicZIndex) applied to a vector layer. Due to the limitations in the combination of ...
2
votes
1answer
1k views

Determine why OpenLayers.Bounds containsLonLat() returns false

In this code, I'm loading a bunch of random points that are roughly in the contiguous USA. I've created a OpenLayers.Bounds object roughly corresponding to that extent. When I select a point, I want ...
0
votes
1answer
287 views

Vector data(point) is drawn in wrong place on map (OpenLayers)

I need to show a map (world map, used default OpenLayers WMS) and one point on it (with events like onhover, etc). Here is my code: var options = { ...
1
vote
0answers
492 views

Add wfs layer to openlayers map

(UPDATE QUESTION) Hi guys. I have a problem with WFS request, mine is follow: var wfs = new OpenLayers.Layer.Vector("WFS",{ strategies: [new OpenLayers.Strategy.Fixed()], ...
1
vote
1answer
474 views

How to trigger a map click event?

I have a map with some markers. On clicking a marker, a popup would appear and on clicking the map, any visible popup would be hidden. I want to hide any currently visible popup upon clicking a marker ...
1
vote
1answer
240 views

Click to Openlayers shows blank pop up - All Formats for Images Works

I am totally new to GeoServer and all this WebServer stuff, so please understand that all the gray hairs on my head over the last 2 weeks are from trying to get this all set up and working. When I ...
1
vote
1answer
618 views

OpenLayers - Navigation History CSS

I am having a problem assigning background-images to my OpenLayers NAVIGATION HISTORY tool on a custom OpenLayers panel. Here is the code I use to create the tools and add them to my panel: ...
0
votes
2answers
2k views

Create different CSS for Two Buttons in One Control Panel

I am having a problem applying CSS to two custom OpenLayers buttons. I create a PANEL toolbar and then add 8 buttons to it. The ZoomBox, DragPan, ZoomOut, ZoomIn, and nav.next and nav.previous buttons ...
1
vote
0answers
206 views

Problem HTTP request for KML

i have a problem with HTTP request for KML to add to map. This is my HTTP request: var x = new OpenLayers.Layer.Vector("X", { projection: new OpenLayers.Projection("EPSG:4326"), strategies: ...
1
vote
2answers
1k views

OpenLayers - Test Control To See If It Is Active

I am trying to get the active state of an OpenLayers SelectFeature control. I create this control and add it to my map but I do NOT activate it yet. This part works fine. Here is the script to create ...
3
votes
2answers
1k views

OpenLayers spatial filter polygon problem

I've got a dataset of English Counties (currently cut down for testing) that I'm serving from SQL 2008 using MapServer and OpenLayers. The features in my dataset are appearing in the right location on ...
1
vote
0answers
362 views

What are the differences between Anchored, Framed and FramedCloud?

From the API document for OpenLayers, I can tell that a FramedCloud has more functionalities than Framed, which in turn has more functionalities than Anchored. I am hoping for someone to describe ...
2
votes
0answers
390 views

OpenLayers BBOX sending double requests

I've implemented a openlayers bbox strategy on a vector layer. I have my server return a nice jsonp object wrapped in the callback given by the request. The problem is that during normal use of the ...
3
votes
1answer
167 views

Does OpenLayers have the ability to mask a raster with another layer?

Does OpenLayers have the ability to mask (in the GIS sense) one raster layer by another vector (or raster) layer? For instance this would be the ability to show only the parts of one layer that are ...
0
votes
1answer
1k views

delete feature from database by selecting feature from vector layer [closed]

I want to delete a feature attribute for example say grid completely from the map that is it has to be deleted from database. I am using OpenLayers 2.12, postgis 2.0 and postgresql 9.0. Please guide ...
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 ...
2
votes
1answer
1k views

applying SLD to WMS raster in OpenLayers

I am attempting to adjust the symbology of a loaded WMS raster layer (img file through MapServer). It is the NLCD dataset. The WMS layer loads find with nlcd = new OpenLayers.Layer.WMS( 'nlcd', ...
1
vote
1answer
105 views

Double output with getfeaureinfo request with Mapserver and Openlayers

I am trying to make an popup InfoTool in OpenLayers with a Mapserver file. Everything is working fine now. But when I click on the map I gives a double output. So I get for instance: cityname, ...
1
vote
2answers
699 views

How to Add image and hyperlink along with GetFeatureInfo Popup?

I want to cutomize the Geoserver GetFeatureInfo Popup. I want to add image against each parcel I click. For this purpose I've read to change the content.ftl file of geoserver. But I found that file ...
4
votes
0answers
150 views

GeoServer pregeneralized layers not working as expected

I've set up GeoServer 2.1.4 and installed the feature-pregeneralized-2.1.4.jar plug in and processed my shape files into each of their separate folders with the generalized shapefiles and I've check ...
5
votes
2answers
1k views

How to create a simple drop down box in openlayers?

I am trying to place a simple drop down box above the open street maps. Can some one guide me how to achieve this... I know we need to make use of open layers.... i tried to create a button with below ...
3
votes
1answer
378 views

Limit Zooming Geometry Features in OpenLayers

I draw flag feature on my map as follows: myVectorLayer = new OpenLayers.Layer.Vector("Flag Geometry", { renderers: renderer, isBaseLayer: true, projection: new OpenLayers.Projection("EPSG:900913"), ...
2
votes
2answers
1k views

Howto change OpenLayers BBOX request projection?

My map uses EPSG:900913 projection on the map. All coördinates in the database are stored in the 'normal' google format / GPS coordinates (WGS84). For instance, if you save a new location..Before I ...
3
votes
1answer
811 views

adding polygon to database in openlayers

I want to add a polygon to the database. I used the following code. The problem is that I am to able to save in database. Whatever polygon I draw on map it gets save temporary and as soon as I reload ...
2
votes
1answer
817 views

LoadingPanel - Waiting for Vector & WFS loading

I have vector layer with WFS protocol. and because I have a huge amount of data, there is a while before features loaded on the map. So i need to tell user to wait a moment until they load by ...
10
votes
1answer
213 views

Stratified OpenLayers Clustering

I have an OpenLayers map with point clustering, but I want to apply a much finer granularity to the data represented in the map. Specifically, I want to stratify the clusters according to an ...
6
votes
2answers
2k views

How can several vector layers have different controls, using Openlayers?

Using openlayers I have two vector layers. One layer is called lineLayer consisting of vector lines, and the other is called pointLayer consisting of points. When I hover on the lines I want to be ...
9
votes
2answers
446 views

Best design for Open Source Python / PostGIS prototype

I am writing a data intensive web application that is delivered through apache. My question is about how to best arrange processing given that there are multiple options. I have at my disposal ...
1
vote
1answer
693 views

Openlayers - Vector Layer - Combining hide/show features using style property

I am trying to filter vector layer features according to their attributes. I have 4 check boxes: type_1, type_2, shape_1 and shape_2 Note that I am using Extjs for interface. at beginning I could ...
5
votes
1answer
904 views

OpenLayers and Google Maps when panning tiles not in sync [duplicate]

I want to overlay WMS tiles on Google maps using the following scales 1:287 / 1:573 / 1:1146 / 1:2292 (layer preview in geoserver) I set a bounding box and a centroid for a specific area to set ...
2
votes
2answers
2k views

How to update a Vector layer with WFS protocol, after updating the filter?

I am using a Vector Layer with WFS protocol to show only a subset of the data. The filter which defines the subset, changes dynamically from the code. How do I refresh the layer, to show only the data ...
1
vote
1answer
251 views

How can I change the CSS style of the geoserver rendered map produced when I click on “Open Layer ”Tab under “Common format”?

I have tried many times with left no stone unturned, but all efforts came in vain. I might be of less knowledge in this area. Then through surfing I found this site as a newbie. I will be very ...
3
votes
1answer
799 views

OpenLayers code didn't response popup featureinfo

Hey I'm trying to popup the featureinfo of WMS layer using OpenLayers code. But it does'nt work. Instead the cursor moves in the state of continous moving when I click on map. Here is my code: ...
1
vote
2answers
519 views

Make Openlayers request WMS tiles only within a certain bounds

Is there a way to actually tell openLayers not to request tiles out of particular bounds? I want the rest of map and other layers still accessible, so maxExtent on map is not an option for me. I ...
2
votes
1answer
60 views

What is the purpose of having a separate Layer property for sphericalMercator?

The Beginner's Guide to OpenLayers 2.10 says the following: sphericalMercator {Boolean} This property determines if the map should behave as a Mercator-projected map. Setting this to true ...