Get the center (or extent) for an XYZ source in Openlayers
Is is possible to get the center (or extent) of an XYZ source in Openlayers? (I am not talking about getting the center of a view, but obtaining the center of the map defined by the source itself.) The VectorSource
does have a getExtent
function, but unfortunately XYZ has no such method.
How to get the correct screen pixel from a coordinate with OpenLayers?
This should be an easy one, but I am not sure where the information I need is found.
How to change existing tracking icon to a random place in repeating intervals?
I want to test updating location by creating an interval that updates the tracking icon to random location given longitude and latitude.
GPX plotting issues with OpenLayers 7
I have a mapping site that plots points on a UK Ordnance Survey map using Openlayers. This has been running fine for years, running OL 7.5.0. Up to this point everything plotted on the map is a point.
Using the newest 10.0.0 version and ran into rbush being referenced somewhere without ./, ../ or /. Anyone have the same issue?
I want simple OSM map to show up with the new version. Got everything finally working just to get an error in consol stating:
Uncaught TypeError: Failed to resolve module specifier “rbush”. Relative references must start with either “/”, “./”, or “../”.
Migrate from deprecated XYZ with tileUrlFunction to TileImage with tileLoadFunction
The Openlayers 10 documentation states that tileUrlFunction is deprecated in XYZ source. I am trying to migrate to TileImage with tileLoadFunction, but nothing is showing.
Why add a control via OpenLayer’s getControls().extend?
I can change the z-index of a div so it appears above the map’s viewport div.
openlayers map.getFeaturesAtPixel returning zero features
I have added a layer group (UTM Projection) and OSM.
Map View projection set to 4326. Trying to get features at clicking position but, not getting the features at map.onclick event. Shall I need to assign projection for evt.pixel?
I want to put another map on top of the openlayer
I wanted to add another map on top of openlayers, so I wrote the code in React, but the png order came out differently. The value of tileCoord in javasciprt is different in react.