Questions tagged [openlayers-6]

v6 specific questions on the OpenLayers mapping library

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

412 questions
1
vote
0 answers

Change layer color on zoom in OpenLayers

I had a problem with changing the color of a layer in Openlayers on zoom. During initialization, I draw a heat map with data on atmospheric pressure. And at first everything is fine. But after zooming or moving around the map, the color of the…
XaVi7777
  • 13
  • 3
1
vote
1 answer

FeatureLoader not loading features in OpenLayers

Trying to use a featureLoader in OpenLayers 6 so that I can gain access to the featuresloadend event but when I try to load the features nothing shows up. Further examination of the pointLayer shows that no features had been added to the…
deadpickle
  • 115
  • 2
  • 15
1
vote
0 answers

Reloading WMTS layer in OpenLayers 6

I'm trying to reload the WMTS layer after changing some tiles on the remote WMTS server. The problem is that I am not able to reload tiles in the current viewport (or in the current zoom level). Other lower resolution tiles are getting reloaded…
petrgon
  • 111
  • 10
1
vote
0 answers

Openlayer interaction: callbacks not getting fired

I'm trying to listen for PinchZoom interaction but I'm getting nothing in the callback. Creating the map this.map = new Map({ target: 'map', layers: [ new TileLayer({ source: new OSM(), }), ], view:…
Daud
  • 7,429
  • 18
  • 68
  • 115
1
vote
2 answers

OpenLayers6 and React

I am trying to implement OpenLayers6 ("ol": "^6.14.1") into a ReactJS project, but all the documentation is created in normal JS files and I can't find any good examples or tutorials with functional components and OpenLayers6. I have troubles…
GeorgeMet
  • 35
  • 8
1
vote
1 answer

Using OpenLayers Map as an Angular service

I want to know if I you're aware of a way to use a service in Angular to create an OpenLayers map and pass that service to other components and update the map based on the interactions on those components. Below is my approach. I am not seeing the…
Sarbraj Dulai
  • 180
  • 10
1
vote
0 answers

Cursor pointer in OpenLayers on hover

Using the latest version of OpenLayers with React. Trying to change the cursor to pointer in the following way: function mapOnMove(evt) { if (evt.dragging) return; const pixel = map.getEventPixel(evt.originalEvent); const hit…
kertal
  • 55
  • 6
1
vote
1 answer

GetFeatureInfo query only for visible layers in OpenLayers 6

I'm a newby with JS and OL, and I have an Openlayers 6 map with different WMS layers grouped into several ol.layer.Group. I want to request feature information through "getGetFeatureInfoUrl". Visibility of layers can be turned on/off in the layer…
jpinilla
  • 115
  • 6
1
vote
1 answer

Bug when adding multiple features one by one to map

I am currently working on school project and I am desperate because I have tried everything within past hours.... I am listening with useEffect on checkbox change. When checkbox is checked I add route feature to map with user's route properties like…
MKvasco
  • 48
  • 6
1
vote
1 answer

OpenLayers 6, Iterate through all features of a layer?

In OpenLayers 6... I'm not familiar with the thing, but... How can I iterate through all features on my layer with the title "firmenGeoJSON" and hide or show some of them with specific property "name"? Thank you... let myLayers =…
snowman
  • 11
  • 1
1
vote
1 answer

Vuetify Custom Control for OpenLayers

I want to create a few custom controls for an OpenLayers 6 map in a Vue SPA. I have read through a bunch of answers (1, 2, 3, 4 and others), but they all have to do with very simple JS and HTML setups that I am having trouble adapting to a Vue SPA…
Curious
  • 383
  • 3
  • 13
1
vote
2 answers

openlayers 15k+ image markers performance

I'm migrating from leaflet map to openlayers. My map requires me to display about 12k markers right now and this amount could grow up to about 60k (most of markers are rotated by various angles). In leaflet, after a lot of attempts I've achived…
xwild
  • 1,114
  • 2
  • 9
  • 25
1
vote
1 answer

How to access updated useState in Openlayers event listener callback

How do I access the updated useState value inside a Openlayers event listener callback function? select.getFeatures().on(['add'], selectAddCallback); Example here: https://stackblitz.com/edit/react-ts-zs4uvs?file=Map.tsx Click the button and it…
1
vote
0 answers

render option in Layer

Anyone know what the use of the render option that can be passed to Layer constructor? it's seem that is not effect on anything or that the render function is missing the prefix if(this.render) return this.render(frameState, target)
tzahi_levi
  • 11
  • 5
1
vote
0 answers

How to center Openlayers map according to the popup size

In Openlayers 6, when the popup appears, the map pan to make the popup fully visible. You can try in this Openlayers example to click near the top border of the map. https://openlayers.org/en/latest/examples/popup.html But when modifying the popup…
Philiz
  • 429
  • 5
  • 25