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

learn more… | top users | synonyms

6
votes
2answers
1k 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 ...
6
votes
4answers
2k views

WMS GetFeatureInfo and CQL on Multiple Layers

I am having issues with querying CQL filtered layers with OpenLayers and GeoServer, using the GetFeatureInfo control. It is ignoring the CQL filter and just querying the entire layer (as evidenced by ...
6
votes
1answer
436 views

Do OpenLayers maps always show/flash an empty screen while zooming?

When double-clicking on an OpenLayers map, the screen is momentarily blank while the next zoom level draws. Is this avoidable? It's not ideal, given that many other mapping APIs show a smooth zooming ...
6
votes
2answers
2k views

OpenLayers filter: OGC (xml) or CQL?

While having not used filtering that much in OpenLayers, we are discussing which type of filtering we should use: The OGC XML filter or the more simple CQL filter? Are one of them more appropriate ...
6
votes
3answers
2k views

How to generate a thumbnail of an openlayers map?

I would like to allow the user to generate a thumbnail image of what the user is seeing in the OpenLayers map canvas so the user may print, save, share, email, or whatever. Any ideas of how i would ...
6
votes
1answer
429 views

How does OpenLayers determine a layer's projection?

Could anyone explain the strategy OpenLayers take to determine the layer's projection? For example, if I didn't explicitly specify any projection for a marker layer, what projection would the layer ...
6
votes
2answers
2k views

OpenLayers/proj4js and the EPSG:27700 (UK) Projection

I'm trying to use OpenLayers to transform projections, which in turn uses the http://proj4js.org/ library. var ll = new OpenLayers.Projection('EPSG:4326'); var a = new ...
6
votes
1answer
2k views

How to add KML data but from variable - not from url?

I have a working map that retrieves KML from a url, but now I need to get the KML data from a local variable instead. Is there support for this, and if so what is the syntax. Searched the api and ...
6
votes
1answer
3k views

Trying to place a Point geometry on OSM map, unsuccessfully

I have a piece of code that takes a map layer and places a vector layer on top of that. Currently, I'm just trying to place a few points on top of the map, unsuccessfully. I managed to place 1 point ...
6
votes
2answers
105 views

How can I zoomToExtent and then zoom out?

I use openlayers 2.12 I use HTML5's geolocation API to get the coords and then I insert them in a layer as feature (point). After that, I zoom in , since the layer has no other feature. ...
6
votes
1answer
179 views

Fast data representation on the vector layers

I have found an interesting article about how HTML5 supports representation on large datasets. Article can be found here. In the article it is said that HTML5 and feature simplification can ...
6
votes
1answer
1k views

Add a OpenStreetMaps road data layer on Google Maps API v3

I've successfully embedded a Google Maps API v3 map on my site, and added OpenStreetMaps (OSM) as the base layer. Is it possible to use Google's tiles as the base layer, and then overlay street data ...
6
votes
1answer
2k views

How to select multiple Features from multiple Layers in OpenLayers?

Is there a way to select multiple features from multiple vector layers by using clickTolerance in click? I checked the documents of getFeature control and selectFeature control, seems not work in ...
6
votes
2answers
2k views

OpenLayers tooltips

Please point me to examples of combining OpenLayers and any external tooltip libraries like this. I try to use native OL tools for building tooltips here, but they not flexible and customizable. ...
6
votes
3answers
242 views

Create interactive map with no server

I have managed to build a great web mapping application using tiles created from GeoWebCache and a custom gridset, but I now need to add an overlay to the base maps. The only interactivity I need is a ...
6
votes
1answer
2k views

What's the difference in using OpenLayers and Mapbox?

Hey guys I found this tilemill to develop WebGIS application using MapBox. I wanted to know how is it better than OpenLayers and if I have to develop which would be a better options to go for, as I ...
6
votes
1answer
2k views

Draw route direction overlay on Google Maps or OpenLayers

I'd like to display the route direction generated from GraphServer on either Google Map or OpenLayers. The result I want is basically identical to how Google Map shows route directions, by ...
6
votes
3answers
814 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
832 views

How import a shapefile on-the-fly and have GeoServer render it instantly?

I am tasked with adding one feature to an existing app. It was built with OpenLayers and GeoServer. The task is to import a shapefile on-the-fly and have GeoServer render it instantly. However, I ...
6
votes
1answer
154 views

Is it possible to display an OpenLayers map upside-down?

This is more fun than a serious question, but I'd like to know if it's possible to display an OpenLayers map upside-down as per the uncommon, but interesting upside-down maps. I guess it's mostly a ...
6
votes
1answer
627 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
1answer
2k views

Changing the geometry of polygon in OpenLayers

i would like to programatically change the geometry of a polygon. feature.geometry.move() works ok, but i rather need supply a whole new geometry. When i try feature.geometry = newGeometry, the ...
6
votes
1answer
2k views

Using local mbtiles in openlayers?

--The problem-- I've successfully added mbtiles from Mapbox free online source to OpenLayers, but cannot figure out how to get the mbtiles I've created/stored locally to show up in OpenLayers. --The ...
6
votes
2answers
857 views

Can the new Mapbox Vector Tiles be used as a QGIS basemap?

With the implementation of the mapbox vector tiles begs the question of how these could be used as a basemap in a QGIS printed map (assuming anyone cares about printed maps anymore!). To use OSM data ...
6
votes
1answer
1k views

Possible ways to display maps offline, inside mobile hybrid app

I want to develop a mobile hybrid application to run on both Android & iPhone devices in which i want to display my own map data. I have the SHP files with the data i need. I have Geoserver and ...
6
votes
2answers
453 views

Is there a way to use image sprite for different marker icons?

I just made the switch from Google Maps V3 to OpenLayers. I realise that OpenLayers API uses a lot of inline styling. If an image file consisting of several images can be used, it would cut down ...
6
votes
2answers
291 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 ...
6
votes
3answers
741 views

OpenLayers WFS flip coordinates

I have a problem integrating WMS and WFS. Basically what i want is when user clicks on WMS then a clicked polygon is added to vector (and selected). The problem is that the WMS is in version 1.3.0 and ...
6
votes
1answer
6k views

Openlayers and Geoserver: OSM/Google Maps and WMS Overlay

I am experiencing projection problems with the following set up: GeoServer with ESPG:4326 based shapefiles (*.shp) OpenJump to edit my shapefiles Openlayers with EPSG:900913 base layers GeoServer ...
6
votes
3answers
3k views

Difficulty to display WMS and Googlemaps layers using Geoext and ext

i have the following code on my html file: // World Geodetic System 1984 projection var WGS84 = new OpenLayers.Projection("EPSG:4326"); // WGS84 Google Mercator projection var ...
6
votes
1answer
818 views

How to preserve topology while editing polygons in OpenLayers?

I’m facing this issue: I have a chloropleth map based on a set of polygons with some data. Using WFS-T (postgis, geoserver, openlayers) I am able to edit the geometry of the polygons. This works fine. ...
6
votes
2answers
663 views

Tilemill Dynamic Tile Generation

I have recently used Tilemill and I wish to implement it for dynamic tile rendering.As I've seen an CartoDB doing in cloud system,they can query & generate dynamic tile for request with UTFGrid. ...
6
votes
5answers
925 views

Deactivating Openlayers Cluster after a certain zoom level

I want to deactivate the cluster strategy after zoom level 16. The Cluster strategy gets deactivated and I also change the style of the original features and redraw the layer. But still it takes the ...
6
votes
2answers
2k views

Openlayers geometry: how to convert area from degrees to square kilometres?

I get a multypolygon from my web service and want to calculate the area of that polygon. I was trying to use this piece of code: var poly = new OpenLayers.Geometry.MultiPolygon(poligon); var area = ...
6
votes
1answer
66 views

Geoserver and PostGis output [closed]

I have a peculiar rendering of a small table in PostGis of polygones (imported from a shape file) from Geoserver (layer preview with OpenLayers) The object are just cloned ... Would you give me a ...
6
votes
1answer
140 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, ...
6
votes
2answers
876 views

Options for PostGIS and Mapserver outputing SVG, and client with OpenLayers

This question is related to "Options for displaying PostGIS vectors in OpenLayers?", but I need SVG output on server. OpenLayers must render SVG directly. We are using Mapserver6, and thinking on WFS ...
5
votes
4answers
3k views

OpenLayers: How to create a rectangle?

I want to use OpenLayers to draw a simple rectangle (based on 4 coordinates) on my map. I would also like to fill the rectangle with a color. For example (EPSG:4326): 13.40, 52.50 13.50, 52.50 ...
5
votes
2answers
4k views

How to change the WMS Background Color in OpenLayers?

I am using geoserver to serve up an image pyramid basemap. I want to have all areas outside of the data extent be black (instead of white). I have the map displayed inside of a div tag and changing ...
5
votes
4answers
7k 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
4answers
7k views

Customizing Popups in Openlayers

Is it possible to customize the shape of popups in OpenLayers? For example, I am creating a pop-up using the following approach: var popup = new OpenLayers.Popup.FramedCloud( "popup", ...
5
votes
2answers
4k views

OpenLayers custom request for WMS GetFeatureInfo

In OpenLayers, there is a WMSGetFeatureInfo control that can be attached to a layer and listen to click or hover events on the map, requesting info on the feature being currently clicked (or pointed) ...
5
votes
3answers
1k views

Determine if a polygon intersects itself in OpenLayers

I let the users draw polygons and then I try to save them out to the SQL Server 2008 SQLGeography field, but it is giving me an error: Error 24200: The specified input does not represent a valid ...
5
votes
2answers
4k 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 ...
5
votes
2answers
4k views

OpenLayers canvas renderer - redraws all features on selecting a single feature

I am currently trying to learn more about OpenLayers, and I'm coming up against performance / behaviour issues that I wouldn't expect to see. To elaborate... I have combined this example for ...
5
votes
3answers
3k views

OpenLayers on mobile device: possible to use local map tiles?

Is that possible for an OpenLayers app (running on mobile device) to load the map tiles that are deployed in the device, if the app is able to access these files (e.g., using PhoneGap)? from this ...
5
votes
4answers
934 views

Where to start with Web GIS development, or which technology to select?

I am very new to GIS development, and to be be frank I have no background about it at all. I searched the web but the tutorials I found seemed to assume the reader has some background information. ...
5
votes
3answers
4k views

OpenLayers load WFS vector layer: how to check whether all features are returned from server?

My app takes several seconds to return all features of a WFS layer from server, I am wondering whether there is a way to check whether all features are returned in coding, so that we can add a ...
5
votes
1answer
3k views

Can image layer be rotated in OpenLayers?

While working on Ground Overlays, I noticed that it has a tag called <rotation> <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> ...
5
votes
2answers
605 views

How to time function calls in OpenLayers?

We have an existing application that has a function that wraps the OpenLayers.Layer.Vector constructor, which gets its layer info from a KML source over http. Once this function completes, I need to ...