Relative Content

Tag Archive for openlayers

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.

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.

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?