Questions tagged [openlayers]

Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later

Filter by
Sorted by
Tagged with
59
votes
7answers
12k views

Creating Vector Polygons with rendering performance like GISCloud?

I have been looking for a solid solution which would allow me to create a web map and overlay vector polygons without taking forever to load such data with the goal of allowing me to make each polygon ...
27
votes
6answers
13k views

Maximum number of point features in an OpenLayers vector layer

In your experience, how many point features can be added to an OpenLayers vector layer (new OpenLayers.Layer.Vector("Point Layer")) before it goes unusably slow? My use case is to display points from ...
26
votes
6answers
6k views

Creating a small web-mapping/map-tiling service

I am looking for a small-scale and easy way to present one or more polygon shapefiles online (on a municipal website without any existing map-server infrastructure, to be precise). Right now, I'm ...
22
votes
7answers
10k views

Options for displaying PostGIS vectors in OpenLayers

I am very new to web-mapping, so this question may be a little misguided. I want to have a very simple web interface using OpenLayers (or even Google Maps if that will be easier) which can display a ...
18
votes
5answers
21k views

Using layer loadstart & loadend events in OpenLayers 3?

OpenLayers 2 has these layer events "loadstart & loadend." What is equivalent to them in OpenLayers 3? While a vector layer loads and is rendered, I need to show a loading icon.
15
votes
4answers
15k views

Openlayers 3 Max Extent

I want to restrict where the user can pan on the map, but I can't seem to find any resources that tell how to set the max extent of a map view in OpenLayers 3. I know there was a solution in ...
15
votes
1answer
51k views

Add feature manually to a vector layer in ol3

I'm trying to add a layer manually to a vector layer with javascript. I can't seem to determine why this is failing: http://jsfiddle.net/Kieveli/f4t6n6v1/4/ I've tried sane coordinates like 16,22, ...
14
votes
1answer
511 views

Pausing WMS layer auto refresh in OpenLayers 3?

I have an application which has to perform a HTTP request (which will handle some map transformations) before fetching WMS tiles from server. Is there a way to pause TileWMS auto-refreshing after ...
13
votes
3answers
43k views

Change OpenLayers 3 view center

I'm using OpenLayers 3 to interact with some maps. I first declare my map: map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ ...
13
votes
6answers
21k views

Equivalent of layer.redraw(true) in OpenLayers 3?

I have a geojson layer in my OL3 app which I want to redraw every 5 seconds (to show movement on map) . How do I do it ? Couldn't find the equivalent of Layer.redraw().
13
votes
5answers
17k views

Z-index in OpenLayers 3: layer ordering in OL3

Is there a method to change Z-indexes of layers in OpenLayers3 like it was in old version? map.setLayerIndex(markers, 99); //set the marker layer to an arbitrarily high layer index I need to change ...
13
votes
1answer
12k views

How to resize a feature and prevent it from scaling when zooming in OpenLayers 3

I have initialized a custom OpenLayers 3 map (used to show houses for sale in the neighborhood) with an image as the map. Then, I create additionnal features and layers dynamically for each house (...
12
votes
4answers
17k views

Missing LayerSwitcher in OpenLayers3?

I was wondering if there is a LayerSwitcher control in OpenLayers 3? I read that ol3 is a complete rewrite. But I can't seem to find the equivalent of LayerSwitcher from http://openlayers.org/en/...
12
votes
4answers
17k views

Hosting GeoServer+Openlayers web mapping application on internet? [closed]

I have created a web mapping application prototype using GeoServer (running on Tomcat as the servlet), Openlayers and PostGIS. Since it was a prototype, at that time, i did not bother about the ...
11
votes
1answer
24k views

How to get the feature location in OpenLayers v3

After I am using the drawing interaction or modify interaction I have a listener that returns the feature that modified or added. Example draw.on('drawend', function (event) { // get the feature ...
11
votes
1answer
18k views

OpenLayers Hide/Show Layers from external checkboxes

I'm using OpenLayers with mapserver to display a lot of raster images and queryable wms layers. Everything works fine, the layers can be turned on/off in the OpenLayers layer switcher...But now I want ...
10
votes
1answer
9k views

Dashed lines in OL3?

I know Line dash not working OL3 (Openlayers 3) has been asked earlier but the solution proposed is not working. My code is : var calculateStyle= new ol.style.Style({ fill: new ol.style.Fill({ ...
10
votes
1answer
18k views

OpenLayers 3 - draw multiple lines/paths based on coordinates

I am trying to draw a line(s) based on give coordinates (starting and ending point). Googled , found few examples but non of them seem to work probably because they are for OL2, so this is my last ...
10
votes
2answers
2k views

What's the best way to display thousands of polygons in Openlayers?

I am trying to create an Openlayers map that will display thousands of polygons. And when the user clicks on each, I want some of the metadata to display. Working with this large of a dataset seems ...
9
votes
3answers
38k views

Add GeoJSON layer to OpenLayers 3

I have a GeoJSON file called mygeojson.json and I want to add it as a layer in OpenLayers 3 on top of an openstreetmap layer. So far I could display the openstreetmap world including zoom etc. but for ...
9
votes
3answers
20k views

Get Center of Geometry in OpenLayers 3

Given a Geometry object in OpenLayers 3. How would one go about getting its center? Older versions of OpenLayers provided a getCentroid method. There was also a getBounds workaround. But these appear ...
9
votes
3answers
12k views

How to get names of all layers in a store in GeoServer using OpenLayers

I have strict requirement to retrieve names of all layers in a GeoServer store using OpenLayers. I've gone through the post here, but it doesn't answer my question. I've also gone through GeoServer's ...
9
votes
3answers
19k views

OpenLayers 3 Layer Visibility

I'm trying to upgrade my Openlayers 2.12 map to Openlayers 3 to take advantage of the fantastic transition effects on transparent layers (Something OL2 and Leaflet can't do attractively). This and I ...
9
votes
2answers
12k views

How to create circular polygon in openlayers 3?

So i would really like to modify this example: http://openlayers.org/en/v3.0.0/examples/tissot.html?q=circle Problem is that when I try to apply it to my map it doesn't work, probably because I use ...
9
votes
1answer
7k views

OpenLayers 4 differences from 3.x [closed]

In OpenLayers 4 changelogs, it explains: Unlike the switch from v2.x to v3.x, which marked a complete rewrite of the library with an entirely new API, major version increments now simply mean ...
8
votes
6answers
15k views

Openlayers v4.0.1 support Google Maps Javascript API?

I want to know if the latest version of Openlayers (v4.0.1) supports Google Maps as a Tile Layer. I can't find any document ion about this. If Openlayers doesn't support Google Maps, could someone ...
8
votes
3answers
3k 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 database table and retrieve them (trivial tasks). Which is better MySQL or PostGIS? Can anybody give ...
8
votes
4answers
3k views

Implementing WPS client in OpenLayers 3?

Is it possible (and what is the recommended way) to use OpenLayers 3 to do the work of theOpenLayers.WPSClient? As shown in the old WPS client example, OpenLayers 2 can be used to operate WPS. ...
8
votes
2answers
29k views

OpenLayers 3 creating popups on a click

I have an OSM map on which I display a GeoJSON file (point). I'd like to create a popup on click for each point to show attributes. I can't find a sort of very basic step by step tutorial to do ...
8
votes
2answers
6k views

Disable doubleclick zooming in OpenLayers 3

I've searched for it on the entire web and finally I found on artamstrong.com how to disable a single feature like "mouseWheelZoom". Here is how doubleclick zooming in OpenLayers 3 can be disabled: ...
8
votes
2answers
18k views

Remove selected feature Openlayers 3

I'm using openlayers 3 to create web application that allow to user to draw LineString features in the map. this is the code: var raster = new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: '...
8
votes
1answer
5k views

what is the rightclick handler in openlayers3

I used rightclick handler with openlayers2 and now I am upgrading my website to openlayers3 and I cannot find this handler in ol3
8
votes
1answer
9k views

OpenLayers 3 modify end event

I want to save the geometry data after I modify it, so I need an event that fire after I finish to modify the feature. I use the following from this post: listener modify interaction var ...
8
votes
3answers
8k views

OpenLayers 3: How to check if vector source is ready?

ol.source.getState() doesn't seem to be reliable. When I call it on a vector source it returns ready, but the features are not available yet. Code looks like this: var vectorSource = new ol.source....
8
votes
5answers
23k views

OpenLayers 3: Cross-Origin Request Blocked: The Same Origin Policy disallows

Using OpenLayers 3, I cannot get this message to go away: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://myserver:8085/geoserver/sf/ows?service=...
8
votes
1answer
3k views

Is there an easy way to use Postgis GeoJSON in Openlayers 3

I was using google-vector-layers and leaflet-vector-layers from Jason Sanford (https://github.com/JasonSanford) to easily display, style and add customized popups for data from Postgis-databases. ...
8
votes
3answers
12k views

How can I use WFS from Geoserver with OpenLayers 3?

I have tried with different setups and formats, but no success. With firebug, I can see that the json data is loaded, but nothing shows up on the map. Have anyone experience with geoserver and wfs ...
8
votes
1answer
1k views

OpenLayers 3: getting rid of 'blue dot' selection icon

I am working on a digitizing tool. There are four buttons as of now: add point add line add polygon remove geometry The user always starts by first drawing some geometries. I am using the Draw ...
8
votes
1answer
2k views

How print map in ol3 with top resolution?

I'm developing a GIS app using OpenLayers-3. In this app, users draw features and print the map. Suppose the user draws his features in a large area. Now to print all his features, he would zoom out ...
7
votes
2answers
7k views

How to get layer type in OpenLayers 3?

I would like to iterate through all of the added layers in an ol.Map instance and only select the vector layers. So far I could get the individual layers with the a property of the resulting object of ...
7
votes
2answers
9k views

How do I disable mouse scroll zoom in OpenLayers 3?

I'm trying to override it 'cause it's so dang sensitive. Bonus points if you can also demonstrate a elegant way to override, but, well, I can probably figure that out.
7
votes
3answers
15k views

Is there a On Map Move event in OpenLayers?

In my OpenLayers web app I have registered an onmousemove event which performs certain functions. What I am really after though is a way to register and handle the user panning or zooming the map.
7
votes
2answers
22k views

OpenLayers 3 capturing various click events

I would like my KML layer in OpenLayers 3 (OL3) to respond to different types of click events. I have a single click method working nicely. But how do I get it working for "shift-clicks" "double ...
7
votes
1answer
8k views

OpenLayers 3 get current center

Is it possible to get the current position (lat/lng/zoom) in OpenLayers 3 (Like map.getCenter() in Leaflet)? I couldn't find anything in the docs.
7
votes
5answers
5k views

Using OpenLayers Selectfeature get mouse position? [closed]

How do I get mouse coordinates after a SelectFeature, which returns the feature by itself?
7
votes
4answers
23k views

Get single layer in OpenLayers 3

I am doing an upgrade from OpenLayers 2 to Openlayers 3 and it seems to me that in OL3 there is no direct way to get a layer from map by its id. In OL2 it was like: map.getLayer(id) If we look in ...
7
votes
6answers
2k views

Identifying OpenLayers 3 version at runtime?

I'm looking for a way to check/confirm which build of OpenLayers 3 is loaded in a browser. I was expecting that this might be accessible through something like ol.VERSION or ol.getVersion() or ...
7
votes
2answers
1k views

Open layers supercluster integration - is it possible to fetch underlying features for each cluster?

I am using the open layers 3 with supercluster at the moment, extending the example provided here : https://jsfiddle.net/d5gwvz2y/2/ My question is: How does one fetch all the underlying features ...
7
votes
2answers
5k views

Can't get WFS working in Openlayers 3

I try to get my WFS working but with no success. Actually I use nearly the same Code like in the OL3-Examples. In Firebug I can see a lot of WFS-Requests and a GML-Response which looks fine to me. ...
7
votes
4answers
7k views

OpenLayers3: How to reload a layer from GeoServer when underlying data change?

I have a webpage that displays a GeoTIFF served via GeoServer as an OpenLayers3 ImageWMS layer. What I need is to (via a button) reload the OL3 layer after the underlying GeoTIFF changes. I searched ...