diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-07-04 10:34:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-07-04 10:34:53 -0700 |
commit | d187ed9b1ffa1835c5498ff5f2e3652447d7c68c (patch) | |
tree | 9980db1c83d4c659151915879ca85c47eb3db6df /modern/src/map/Map.js | |
parent | f2c65d56b20998384c1539b5d1c62c0605a0b8f8 (diff) | |
download | trackermap-web-d187ed9b1ffa1835c5498ff5f2e3652447d7c68c.tar.gz trackermap-web-d187ed9b1ffa1835c5498ff5f2e3652447d7c68c.tar.bz2 trackermap-web-d187ed9b1ffa1835c5498ff5f2e3652447d7c68c.zip |
Migrate to MapLibre
Diffstat (limited to 'modern/src/map/Map.js')
-rw-r--r-- | modern/src/map/Map.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js index a973cf7d..46c59d2d 100644 --- a/modern/src/map/Map.js +++ b/modern/src/map/Map.js @@ -1,6 +1,6 @@ -import 'mapbox-gl/dist/mapbox-gl.css'; +import 'maplibre-gl/dist/maplibre-gl.css'; import './switcher/switcher.css'; -import mapboxgl from 'mapbox-gl'; +import maplibregl from 'maplibre-gl'; import { SwitcherControl } from './switcher/switcher'; import React, { useRef, useLayoutEffect, useEffect, useState } from 'react'; import { deviceCategories } from '../common/deviceCategories'; @@ -14,7 +14,7 @@ const element = document.createElement('div'); element.style.width = '100%'; element.style.height = '100%'; -export const map = new mapboxgl.Map({ +export const map = new maplibregl.Map({ container: element, style: styleOsm(), }); @@ -55,7 +55,7 @@ const initMap = async () => { map.on('load', initMap); -map.addControl(new mapboxgl.NavigationControl({ +map.addControl(new maplibregl.NavigationControl({ showCompass: false, })); @@ -89,7 +89,7 @@ const Map = ({ children }) => { const mapboxAccessToken = useAttributePreference('mapboxAccessToken'); useEffect(() => { - mapboxgl.accessToken = mapboxAccessToken; + maplibregl.accessToken = mapboxAccessToken; }, [mapboxAccessToken]); useEffect(() => { |