ol-owm
Version:
Weather layer for OpenLayers and Leaflet using OpenWeatherMap
22 lines (21 loc) • 568 B
JavaScript
export class OpenLayersAdapter {
constructor(map) {
this.map = map;
this.type = "openlayers"; // 👈 добавляем поле type
}
getZoom() {
return this.map.getView().getZoom();
}
onZoomChange(callback) {
return this.map.getView().on("change:resolution", callback);
}
offZoomChange(listenerKey) {
this.map.getView().un("change:resolution", listenerKey);
}
addLayer(layer) {
layer.appendTo(this.map);
}
removeLayer(layer) {
this.map.removeLayer(layer);
}
}