3

See the documentation https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html "Declutter images and text". CircleStyle is an image: function pointStyleFunction(feature, resolution) { return new Style({ image: new CircleStyle({ radius: 10, fill: new Fill({ color: "rgba(255, 0, 0, 0.1)" }), stroke: new Stroke({ ...


3

The feature property in a vector source must be an array of features. Only readFeatures returns an array. Results from the other methods need to be made into an array of features features: (new ol.format.GeoJSON()).readFeatures(geojson_object), features: [ (new ol.format.GeoJSON()).readFeature(geojson_object) ], features: [ new ol.Feature((...


1

You can use an alternative tile source like Thunderforest which is used by OpenSteetMap https://tile.thunderforest.com/cycle/${z}/${x}/${y}.png or even: https://tile.thunderforest.com/landscape/${z}/${x}/${y}.png For more alternative tile sources see: https://wiki.openstreetmap.org/wiki/Tile_servers


1

Updating the code to // very approximate calculation of projection extent var worldExtent = [bbox[1], bbox[2], bbox[3], bbox[0]]; newProj.setWorldExtent(worldExtent); var extent = applyTransform(worldExtent, fromLonLat); newProj.setExtent(extent); will prevent the errors https://codesandbox.io/s/reprojection-by-codegraticule-5ujx2 The graticule ...


1

You will need a custom DragPan interaction with custom condition import { defaults as defaultInteractions, DragPan } from "ol/interaction"; import { noModifierKeys } from "ol/events/condition"; const primaryMiddle = function(mapBrowserEvent) { const pointerEvent = mapBrowserEvent.pointerEvent; return pointerEvent.isPrimary && pointerEvent....


1

I think the best way to update the label here is when you switch the layers. If I follow your code correctly you could do something like this, constructor(options: any) { const button = document.createElement("button"); // initialize label button.innerHTML = this.getNextLayer().getProperties().label; const element = document.createElement("...


Only top voted, non community-wiki answers of a minimum length are eligible