Questions tagged [openlayers-3]

OpenLayers 3 is the complete rewrite of the OpenLayers 2.x mapping library, targeting modern features of HTML5 and CSS3. It is not compatible with OpenLayers 2. OpenLayers is completely free and open source, having been released under the 2-clause BSD License.

OpenLayers 3

OpenLayers 3 is a high-performance, feature-packed library for creating interactive maps on the web.

Beginners may wish to consult the following resources:

Usual search keywords are 'OpenLayers' and 'ol'.

Source code can be found on GitHub at https://github.com/openlayers/openlayers.

Tag usage

Use of the tag was encouraged by OpenLayers developers for questions specific to OpenLayers 3, but it no longer is. The tag will probably get more attention.

2413 questions
7
votes
2 answers

How to delete a listener in OpenLayers 3

I make a copy of my question here at stackoverflow, because at gis.stackexchange all my questions do not attract any attention - many times I could not get an answer to simple questions there. So, my question now is how to delete a listener defined…
Jacobian
  • 10,122
  • 29
  • 128
  • 221
7
votes
2 answers

get coordinates of drawn feature in OpenLayers

I'm trying to create an online map using OpenLayers 3. I'm brand new to using OpenLayers, and all I'm trying to do is to get the coordinates of the points, lines, polygons that I drew on the map. I'm aware that there is a featuresadded parameter…
derBrain
  • 173
  • 1
  • 2
  • 13
7
votes
2 answers

How to cache QGIS Server WMS?

It seems like raster tiles have started to go out of fashion, but still, I need a solution to do it somehow for my QGIS Server's WMS. Up to this point I have tried TileCache, but I couldn't make it to work in OL3, and it also seems to be a little…
Benedek Simo
  • 504
  • 5
  • 15
7
votes
3 answers

Openlayers 3.6: Getting the center of the current map view

I'm trying to get the current center of an Openlayers map in lat/lon coordinates. I've got the following event handler setup: this.map.on('pointermove', function (e) { if (e.dragging) { console.log(that.map.getView().getCenter()); …
Crankycyclops
  • 552
  • 5
  • 25
7
votes
1 answer

Openlayers 3: how to select a feature programmatically using ol.interaction.Select?

I'm using OpenLayers v3.6 (this is important, because most of solutions that I found and would potentialy work are for OpenLayers 2). I have a table and when I select a row in that table, I would like to highlight/select a corresponding feature on…
DekiChan
  • 375
  • 1
  • 4
  • 14
7
votes
1 answer

OpenLayers 3: how to set fill style of a vector feature

i am trying to set the fill colour of seperate features of a vector layer. using the code below, i thought i would be able to iterate through the features and set their fill style individually, but a strange issue happens. Without the setStyle…
ThriceGood
  • 1,633
  • 3
  • 25
  • 43
7
votes
1 answer

Cannot place marker at the right coordinates using openlayers 3

I am working on openlayers 3 and want to implement a search functionality, which gets a name of the place and positions a marker on the map. I am able to get the coordinates but when I want to add it's marker on the map, I am always getting…
Amir
  • 685
  • 3
  • 13
  • 36
7
votes
1 answer

Animation of features in OpenLayers3

I was curious about the possibilities of animating features in OpenLayers3. I'm very aware of the examples presented here http://openlayers.org/en/v3.0.0/examples/animation.html and…
stopopol
  • 486
  • 7
  • 29
7
votes
3 answers

How to drag features in Open Layers 3?

In the OL3 examples I can drag objects and drop on the map, but I want to move/resize/rotate things that are already on the map like ol.geom.Point and other ol.geom objects. What is the OL3 way do do this? Example in OL2:…
more cowbell
  • 101
  • 1
  • 7
7
votes
2 answers

OL3: force redraw layer

i am currently upgrading OpenLayers client version 2.13.1 with the new version of OpenLayers, OL3. My setup consist of Mapserver as a WMS mapping server and previously mentioned OpenLayers client. In old system I made support for user interaction in…
user2473933
  • 71
  • 1
  • 1
  • 3
6
votes
1 answer

Openlayers 3 select interaction unable to add event condition

So I'm trying to add a select interaction into my maps when I hover over any feature it's clearly highlighted. import Select from 'ol/interaction/select'; import pointerMove from 'ol/events/condition.js' this.selectPointerMove = new Select({ …
Munerz
  • 1,052
  • 1
  • 13
  • 26
6
votes
2 answers

OpenLayers 4 - fit to extent of selected features

Me again. So, yesterday I faced a bit of a problem with zooming to selected features and I'm hoping that some of you can push me in right direction.Here it goes... I'm trying to implement autocomplete/search bar using Materialize Materialize…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
6
votes
1 answer

Openlayers 3 Reproject EPSG:4326 vector to EPSG:3857

I am needing to transform GeoJSON vector data from EPSG:4326 to EPSG:3857... I have a map... var olMapDiv = document.getElementById('olmap'); control.map = new ol.Map({ target: olMapDiv, renderer:…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57
6
votes
3 answers

How to integrate openlayers 3 transform extension

I am working on an openlayers 3 project, developed using typescript, hence: let ol = require("openlayers"); I would like to use the transform extension plugin, which is not published on NPM…
vicgoyso
  • 636
  • 1
  • 14
  • 35
6
votes
1 answer

Mouse rightclick on Openlayer 3

Is is possible to get the mouse right click event on Openlayer3? If so how can i get the latitude and longitude of the right clicked location. i have got the right click event by following map.getViewport().addEventListener('contextmenu', function…
Kiran k g
  • 946
  • 11
  • 19