Questions tagged [openlayers-5]

v5 specific questions on the OpenLayers mapping library

OpenLayers v5 is the latest release of the OpenLayers mapping library.

From https://openlayers.org/:

OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).

v5 reworked the library as a set of ES Modules, and improved compatibility with mainstream module bundlers.

317 questions
3
votes
1 answer

OpenLayers 5 draw interactions - "n is not a constructor" at Draw.js:338

I'm trying to allow the user to draw and modify features, following this example: https://openlayers.org/en/v5.3.0/examples/draw-and-modify-features.html - but I'm getting two errors: Uncaught TypeError: n is not a constructor at e.r [as…
Gareth Jones
  • 517
  • 1
  • 10
  • 25
3
votes
2 answers

How to clip and show clipped vector geometry in OpenLayers 5.3.0

I have to clip vector layer based on the main/restriction vector layer. Upon drawing, if some part of the drawn layer is outside restriction layer, clip area that is outside restriction layer. Example 1. As we can see, part of the bottom border is…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
3
votes
1 answer

changing the icon size with map zooming

I'm using a icon 20x20 pxl to be displayed at the map with below code: When I zoom the map, the icon appears to be small, how can I change the icon size with map zooming?
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203
3
votes
1 answer

Open layers feature hover change style

I am trying to change the opacity of a multipolygon feature on mouseover. I am able to get the feature on mouseover and change the style but am unable to animate the process of the opacity going from 0.3 to 0.8 for example. I have read through the…
Mike Lammers
  • 542
  • 9
  • 27
3
votes
1 answer

How To Implement Feature Popups in OpenLayers 5 on Mouse Hover and Click

I learned that OpenLayer 2 has an OpenLayer.control.featurepopup control that allow one to add popups that show when you hover on a feature on the map and when you click on a feature. I am looking for a way to do that with OpenLayer 5
Obi Dennis Chizolu
  • 108
  • 1
  • 1
  • 8
3
votes
1 answer

How to remove feature on right click in openlayers 5

I have a feature on the map in openlayers, my requirement is to allow the user to remove the feature by right click. Here is the reference screenshots : When user clicks on "Remove", the feature should be removed. If user clicks else where after…
capnam
  • 429
  • 9
  • 25
3
votes
2 answers

Is there a way to force a map reload/refresh in openlayers 5?

Using openlayers 5, I'm getting an issue where geometry persists on the map after deleting it - seems like the map isn't updating properly. Is there a way to force an update / refresh of the map and its features? Can't find anything related to that…
Ben
  • 62
  • 1
  • 8
3
votes
1 answer

Debugging openlayers 5 application, using source map

I am migrating from openlayers 2 to 5. I have downloaded distribution with minified js and source maps. Then I included js file in index.html: Now I want to debug sources. When I am step…
Zufar Muhamadeev
  • 3,085
  • 5
  • 23
  • 51
3
votes
2 answers

How can I plot Point type geometry in OpenLayers from a JSON file

I have a web page which contains a MAP instance which is created using OpenLayers. It is supposed to display all straits in the world by Point type geometry. The data (Latitude,Longitude) is available in JSON format. I was able to draw a single…
capnam
  • 429
  • 9
  • 25
2
votes
1 answer

Move vector features by dragging

If I have a polygon, line, text, and point on a layer I want to be able to select 1 feature, right click to select "Move" and then be able to drag the feature to another location on the map and when I release the mouse button save the new location…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57
2
votes
1 answer

Open Layer remove passed line when marker moves

I'm working with open layer I have stumbled on a problem. Here is what am I trying to achieve is to remove passed line, when the marker moves. To explain a bit more, check bellow…
Loki
  • 1,064
  • 2
  • 26
  • 55
2
votes
1 answer

OpenLayers increase or decrease extent by a percentage

I have a map that has features on it and when I zoom to those features the user has the ability to set a preference as to the zoom buffer. I'm not sure if there is a built-in way of doing this in OL...I've looked at the documentation but couldn't…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57
2
votes
1 answer

OpenLayers - Map scales differently if viewed from file system vs web server

I'm trying to add a VectorLayer to an existing TileLayer, so I can place ol.geom.Point to mark places of interest. Originally this worked how I wanted - the points of interest were drawn on the TileLayer exactly where they should. Since then I've…
barrett777
  • 282
  • 3
  • 14
2
votes
0 answers

How to validate openlayers map bounding box

I have couple of sub layers in WMS service. All of them have EX_GeographicBoundingBox with same format like: 0: 100 1: -50.0243292 2: 180.05332479999998 3: 0.0089988 except one layer has format like: 0: 12245143.9872601 1: -5621521.48619207 2:…
Hey
  • 53
  • 4
2
votes
1 answer

Blurry features while moving OpenLayers map

I'm using OpenLayers 6.0.1 (had the same problem on version 5) to display multiple features on the map. Everything is nice and sharp until I start moving map. The features look like that: But when I will move the map they become blurry till I…
Dawid Rutkowski
  • 2,658
  • 1
  • 29
  • 36
1
2
3
21 22