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

Unable to test any code using an openlayers' module in Jest

I'm trying to write some tests for some modules that happen to import an openlayers module or two. But as some others have found (here, here, and here), this doesn't work out of the box. Here's what I've tried: renaming .babelrc to babel.config.js…
jktravis
  • 1,427
  • 4
  • 20
  • 36
8
votes
1 answer

Cannot get the openlayers css in angular

I just started using openlayers 5 in my angular 6 and I follow this tutorial and also looking this SO question. My angular component right now has import ol-map from 'ol/map'; import ol-xyz from 'ol/source/xyz'; import ol-tile from…
codebot
  • 517
  • 8
  • 29
  • 55
7
votes
3 answers

AGM angular Google Maps Set Zoom programmatically

I am working with AGM (Angular Google Maps) and OpenLayers. I need to set the zoom of my AGM programmaticly but haven't been able to figure out how it works. HTML Maps...
5
votes
1 answer

Limit Panning OpenLayers 5

I'm using OpenLayers 5 for my project and wasn't able to find anything on here for that. In the past, OpenLayers has had restrictExtent, but that seems to have disappeared. Is there a way to limit or restrict the user's ability to pan vertically so…
Andrew
  • 89
  • 2
  • 9
5
votes
0 answers

OpenLayers 5 v5.2.0 draw circle as polygon

I'm trying to upgrade to OpenLayers v5.2.0 and I can't see that there is a clear path to drawing a circle as a polygon (which I need so that I can store it in our data base) This is what I was doing... if (webMapValues.activeDrawControl == "Circle")…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57
5
votes
1 answer

Displaying georeferenced images using OpenLayers 5

I'm trying to make an application where the user can georeference scanned maps. You can look at an example here: https://codesandbox.io/s/2o99jvrnyy There are two images: assets/test.png - without rotation assets/test_rotation.png - with…
4
votes
1 answer

amCharts cursor zoom not working in OpenLayers map overlay

I added amCharts chart to OpenLayers map overlay but chart cursor zoom not work like the image provided below: The example provided below: // Overlays init variables and function var container; var content; var closer =…
Abolfazl Mohajeri
  • 1,734
  • 2
  • 14
  • 26
4
votes
1 answer

Difference between OpenLayers 5 and OpenLayers 6

Quick question regarding upcoming release of OpenLayers 6. Does anyone know what are the main differences between OpenLayers 5 and OpenLayers 6. I read something here but additional questions arose: Is it true that OpenLayers 6 will be complete…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
4
votes
1 answer

WMTS and WMTSTileGrid causing "Cannot read property 'every' of undefined"

What i'm basically doing is trying to get a Map in Open Layers, which have a view limited to Denmark. I want to do it using EPSG:25832, because i need some overlays from a specific service, which is using this projection. I'm trying to create a…
Anders Jensen
  • 330
  • 3
  • 20
4
votes
1 answer

Click feature on marker of open layers version 5

I am using open layers library version 5. I need an onClick event on marker to do some business logic. Anybody could help me with this out thankyou. I have tried every code and snippets. I am using this library to react js. import Feature from…
4
votes
3 answers

openlayers 5 annoying flash on vector.getSource().clear()

When I load more than around 500 vector features in Openlayers, performance on tablets and telephones reduces severely. My solution has been to clear the source on the map's moveend event. This works, but results in an annoying flash, presumably…
minisaurus
  • 1,099
  • 4
  • 17
  • 30
4
votes
1 answer

Add text to marker (feature)

I did some research on labeled markers with OpenLayers 5.3. Unfortunately, I didn't get the text to work. I inserted text to the feature object. The marker with it's image is visible and works as expected, but it doesn't show any text. Here's my…
user1000698
  • 77
  • 1
  • 6
4
votes
2 answers

Importing node_modules into Laravel via Mix

I'm trying to use OpenLayers (v5.3.0) in a Laravel 5.7 project, but am having a lot of trouble importing ol from node_modules. I installed ol as follows (based on https://www.npmjs.com/package/ol): npm install ol I then updated my…
Gareth Jones
  • 517
  • 1
  • 10
  • 25
4
votes
2 answers

The relative path in Vue single file components does not work properly

So recently I am doing a small challenge with Vue.js and OpenLayers 5. The first step I want to do is create a simple Open street map and put my own GPS data as vector layer onto it. Things are going well until I got some issue with the "path" in…
Min XIE
  • 463
  • 8
  • 19
3
votes
2 answers

Openlayers 5 Darken the Map

I want to have a dark map just like in the photo in order to make the other features inside the other layers more visible. What is the best approach to achieving this? map = new ol.Map({ layers: [ new ol.layer.Tile({ source: new…
Solomon
  • 159
  • 1
  • 13
1
2 3
21 22