Relative Content

Tag Archive for javascriptopenlayers

How to prevent OpenLayers Icons to scale when zooming

I know that this question has been asked many times already, cause it’s the whole day I navigate through forums for a solutions, but I can’t get it to work so I’ll ask my question aswell and hope someone will be able to help me.

impossible to add a layer switcher with openlayers

Good morning,
I want to add a layer selector to my map with openlayers. the selector logo appears correctly but nothing happens when I click on it. I’m looking but I can’t find it, thank you for your help, here is the code:

Cannot read properties of undefined (reading ‘getGeometry’)

I’ve started playing around with OpenLayers, and the first thing I tried was to do one of the out-of-the-box tutorial exercises from the open library. I chose this one: https://openlayers.org/en/latest/examples/center.html and somehow it’s not working out of the box, and I’m unable to determine why exactly.

OpenLayers: feature.set() -> feature.changed() doesn’t seem to change data

I want my features to change every time I hit checkbox. I’ve added event listenter to a change. I supposed I would go this statement (as I stated that the ‘zero’ value is [0]) if (currentValue.length == 1) { feature.set('number', data_languages[language][index]); feature.changed() }
Then it was supposed to go ‘else’ statement (as any data in my variable data_languages[language][index] is an array of 4 elements). But I keep going the ‘if’ statement.

Cannot rotate polygon and point in one geomCollection

i started developing on openlayers (ol + ol-ext). And having problems with interactions. Wrong logic transform/rotate on feature with GeometryCollection. I can rotate only markers, not polygons.
Leaflet has some problems with GeometryCollections?