New answers tagged

0 votes

OpenLayers 6 custom control using Vuetify and a resizable div

I ended up abandoning the templates I kept finding on forums and trying to use the addControl function of the Map object and passing as element a v-container with a unique id I wrote just as you would ...
user avatar
  • 11
1 vote
Accepted

OpenLayers import CspLine with KML

Your code is styling the drawn line as cspline. To save it you must convert it to cspline. Either when drawn by changing event.feature.set("cspline", true); to event.feature....
user avatar
  • 9,693
0 votes

Toggle dark mode on and off using on and un in OpenLayers

As mentioned in this answer the problem I had was that I was reassigning the function each time and therefore un was not matching it to the binded signature of the on listener.
user avatar
  • 11
0 votes

OpenLayers trigger map click on specific coordinates

Try to look for a different event triggering method here.
user avatar
1 vote

Change the color of map elements with a unique ID

If your GeoJSON features have unique id as feature attribute id, this becomes also OL feature id, and then you can retrieve this feature from layer source by .getFeatureById method. You can then set ...
user avatar
  • 16.7k
0 votes

How to set different style and name for each feature individually OpenLayers

You have to use a 'style' function on your vector layer definition. It will be called for each feature before rendering and should return the corresponding style. var layer = new ol.layer.Vector({ ...
user avatar
0 votes

Layer Preview not working at all on GeoServer

After the correct configuration of JAVA_HOME and Path variables, with IDK 8 directions : path= %JAVA_HOME%\bin; JAVA_HOME=C:\Program Files\Java\jre1.8.0_321 and, after the reboot of the PC, the ...
user avatar
3 votes

OpenLayers GeometryCollection styling issue

Problem is that you are referencing global value labelInput.value when defining text label in the style. This causes style to always reflect current value of labelInput.value when styling features. ...
user avatar
  • 16.7k
1 vote
Accepted

GetFeatureInfo in OpenLayers only if the layer is visible

You can check the visibility of the layer in the callback function, and exit if not visible: map.on('singleclick', function(evt){ if (!wmsLayer3.getVisible()) return; document....
user avatar
  • 9,693
0 votes

OpenLayers/Angular/ol-cesium : Point vectors show on both 2D/3D map / polygons don't

I have made some progress regarding this issue and I wanted to let you know. At first, the map I was displayed with the projection EPSG:3857. Then I had to change the projection (for reasons unrelated ...
user avatar
2 votes
Accepted

How to get layers name added to OpenLayers map v6.14.1?

Layers in OL do not have names by default, but you can give layer a name by setting some custom layer property, like for example using custom option name: 'My layer name'. Then your code above will ...
user avatar
  • 16.7k

Top 50 recent answers are included