Skip to content

Commit

Permalink
rename Map for maplibre control
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Jan 8, 2025
1 parent 0cf8092 commit 5c3fdde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/layer/format/maplibre.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default async layer => {

layer.mapview.Map.getTargetElement().prepend(layer.container)

const Map = await MaplibreGL({
const maplibreMap = await MaplibreGL({
container: layer.container,
pixelRatio: 1,
style: layer.style.URL,
Expand Down Expand Up @@ -83,7 +83,7 @@ export default async layer => {
if (!Map) return;

// The Maplibre Map control must resize with mapview Map targetElement.
layer.mapview.Map.getTargetElement().addEventListener('resize', () => Map.resize())
layer.mapview.Map.getTargetElement().addEventListener('resize', () => maplibreMap.resize())

// Handle layer.style.zIndex deprecation.
if (layer.style.zIndex) {
Expand All @@ -100,7 +100,7 @@ export default async layer => {
layer.container.style.visibility = 'visible';

// adjust view parameters in mapbox
Map.jumpTo({
maplibreMap.jumpTo({
center: ol.proj.toLonLat(frameState.viewState.center),
zoom: frameState.viewState.zoom - 1,
bearing: (-frameState.viewState.rotation * 180) / Math.PI,
Expand Down

0 comments on commit 5c3fdde

Please sign in to comment.