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
0
votes
1 answer

Integrating WFS as gml in OL5

I try to visualize a WFS (from MapServer) in OL5. The WFS works well (I can implement it without any problems in QGIS). Also a request…
Kai Behncke
  • 129
  • 1
  • 7
0
votes
1 answer

How to create flying animations between two distant polygons in OpenLayers

Using Openlayers (v6.1.1.) I'm trying to create simple FlyTo animation between several polygons. FlyTo animation works fine when there is somehow small distance between them but with increase in distance there is decrease in user experience. On…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
0
votes
1 answer

How to remove a layer on map using checkbox in openlayers 5?

I want help in removing layer on map using openlayers 5 . I have done to add the the layer on map using checkbox . what i want is that if the checkbox of that is layer is checked the layer will appear on map , and if the checkbox is unchecked again…
0
votes
1 answer

Draw simple grid in OpenLayers 5

I am using OpenLayers 5 https://openlayers.org/ and want the user to draw a simple grid (like in the attached image). The user should be able to draw the grid anywhere on the map like a polygon. I was searching for a build-in solution in OpenLayers,…
K.E.
  • 818
  • 2
  • 12
  • 28
0
votes
0 answers

Zoom doesn't change always init value when zoomin. ol 5.3.0 with reactjs

It's a react.js project with OpenLayers 5.3.0 The map is defined in componentDidUpdate() { this.map = new Map({ target: this.container, view: new View({ center: [2.5, 2.5], projection: projection, zoom: 2, …
Ye Cai
  • 25
  • 3
0
votes
2 answers

Openlayers5 and ol-ext

Could anybody give me an example please how to integrate the ol-ext-library in OL5? So far I have downloaded the .css & .js-Files from here: https://github.com/Viglino/ol-ext/tree/master/dist ...to my openlayers/dist-directory. I try to link it in…
Kai Behncke
  • 129
  • 1
  • 7
0
votes
1 answer

Openlayers - shifted map

I get data like in example in this post How to fix EPSG:4326 with WMTS incorrect map overlay ,which even has the same source I just need. However, the map is shifted. private createLayer() { this.service .getTypesLayersFilter() …
gomez119
  • 11
  • 2
0
votes
1 answer

How do I get the lon/lat value in OpenLayers 5 on click

I try to receive the coordinates in lon/lat form an OpenLayer 5 map when i click on the map as an array or json with the values in order to set the map center to this clicked coordinates. I tried to get the coordinates by this var mousePosition =…
0
votes
1 answer

Get layers and features having the coordinates defined

I have defined coordinates. I need to know if there is any way to know the layers or features that exist in those coordinates. Is that possible? I have used the following function, but this does it with respect to the map pixels and I want with…
0
votes
0 answers

How to extent 3D map

Using ol-cesium and want to enable 3d view of map. 2D map extent works great, but not in 3d. could not see any extent parameter on generating olcs map object. Anyone could help to extent? Here is jsfiddle…
Niru
  • 221
  • 1
  • 4
  • 12
0
votes
2 answers

How to precisely check if one polygon overlaps another while ignoring boundary

I have one question regarding topology and relations between polygons in openlayers. Situation is this: Using https://turfjs.org/ I'm using two methods to check if polygons are overlapping, https://turfjs.org/docs/#booleanOverlap and…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
0
votes
1 answer

Added map layer. No error. Layer not visible

I generate a map layer with the following code: var GeoJSON = {}; GeoJSON.type = "FeatureCollection"; GeoJSON.features = []; var iconStyle = new ol.style.Style({ image: new ol.style.Icon(({ anchor: [0.5, 46], anchorXUnits:…
user6154614
0
votes
0 answers

Multiple select interactions on same map don't work

I added two select interactions(on different layers) to the openlayers instance but only the last one seems to work/trigger. I got it working by giving the condition "click" to the first one and "singleClick" to the second one. This certainly does…
Patrick
  • 367
  • 1
  • 13
0
votes
1 answer

Openlayers 5 - how to set for only 1 marker with a different icon / image?

In my app I use regular markers. One marker should be different. Using OL5, how can I add this different marker with a specific icon / image? Looking at (older?) examples I see this? But this will fail in OL5. const marker = new Feature({ …
tm1701
  • 7,307
  • 17
  • 79
  • 168
0
votes
1 answer

Show geotiff format images in openlayers map

I am new to Openlayers, and I have seen almost all examples and documentation .... I have several .tiff format images, some have the same coordinates. I wanted to show these images at their coordinates on the front-end using angular 8. I was just…
Paulo Ilheu
  • 61
  • 1
  • 4