diff options
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/map/CurrentLocationMap.js | 4 | ||||
-rw-r--r-- | modern/src/map/Map.js | 10 | ||||
-rw-r--r-- | modern/src/map/PositionsMap.js | 6 | ||||
-rw-r--r-- | modern/src/map/ReplayPathMap.js | 4 | ||||
-rw-r--r-- | modern/src/map/switcher/switcher.css | 12 | ||||
-rw-r--r-- | modern/src/map/switcher/switcher.js | 10 | ||||
-rw-r--r-- | modern/src/reports/ReportFilter.js | 2 |
7 files changed, 24 insertions, 24 deletions
diff --git a/modern/src/map/CurrentLocationMap.js b/modern/src/map/CurrentLocationMap.js index 31e6e285..06aaad0f 100644 --- a/modern/src/map/CurrentLocationMap.js +++ b/modern/src/map/CurrentLocationMap.js @@ -1,10 +1,10 @@ -import mapboxgl from 'mapbox-gl'; +import maplibregl from 'maplibre-gl'; import { useEffect } from 'react'; import { map } from './Map'; const CurrentLocationMap = () => { useEffect(() => { - const control = new mapboxgl.GeolocateControl({ + const control = new maplibregl.GeolocateControl({ positionOptions: { enableHighAccuracy: true, timeout: 5000, 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(() => { diff --git a/modern/src/map/PositionsMap.js b/modern/src/map/PositionsMap.js index baa801fb..35d6d926 100644 --- a/modern/src/map/PositionsMap.js +++ b/modern/src/map/PositionsMap.js @@ -1,6 +1,6 @@ import React, { useCallback, useEffect } from 'react'; import ReactDOM from 'react-dom'; -import mapboxgl from 'mapbox-gl'; +import maplibregl from 'maplibre-gl'; import { Provider, useSelector } from 'react-redux'; import { map } from './Map'; @@ -54,7 +54,7 @@ const PositionsMap = ({ positions }) => { placeholder ); - new mapboxgl.Popup({ + new maplibregl.Popup({ offset: 25, anchor: 'top' }) @@ -129,7 +129,7 @@ const PositionsMap = ({ positions }) => { map.on('click', clusters, onClusterClick); return () => { - Array.from(map.getContainer().getElementsByClassName('mapboxgl-popup')).forEach(el => el.remove()); + Array.from(map.getContainer().getElementsByClassName('maplibregl-popup')).forEach(el => el.remove()); map.off('mouseenter', id, onMouseEnter); map.off('mouseleave', id, onMouseLeave); diff --git a/modern/src/map/ReplayPathMap.js b/modern/src/map/ReplayPathMap.js index feab0718..b40aa690 100644 --- a/modern/src/map/ReplayPathMap.js +++ b/modern/src/map/ReplayPathMap.js @@ -1,4 +1,4 @@ -import mapboxgl from 'mapbox-gl'; +import maplibregl from 'maplibre-gl'; import { useEffect } from 'react'; import { map } from './Map'; @@ -46,7 +46,7 @@ const ReplayPathMap = ({ positions }) => { }, }); if (coordinates.length) { - const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new mapboxgl.LngLatBounds(coordinates[0], coordinates[0])); + const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new maplibregl.LngLatBounds(coordinates[0], coordinates[0])); map.fitBounds(bounds, { padding: { top: 50, bottom: 250, left: 25, right: 25 }, }); diff --git a/modern/src/map/switcher/switcher.css b/modern/src/map/switcher/switcher.css index 6c8fdb4e..e3d491c4 100644 --- a/modern/src/map/switcher/switcher.css +++ b/modern/src/map/switcher/switcher.css @@ -1,9 +1,9 @@ -.mapboxgl-style-list +.maplibregl-style-list { display: none; } -.mapboxgl-ctrl-group .mapboxgl-style-list button +.maplibregl-ctrl-group .maplibregl-style-list button { background: none; border: none; @@ -16,22 +16,22 @@ height: auto; } -.mapboxgl-style-list button.active +.maplibregl-style-list button.active { font-weight: bold; } -.mapboxgl-style-list button:hover +.maplibregl-style-list button:hover { background-color: rgba(0, 0, 0, 0.05); } -.mapboxgl-style-list button + button +.maplibregl-style-list button + button { border-top: 1px solid #ddd; } -.mapboxgl-style-switcher +.maplibregl-style-switcher { background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTQuODQ5cHgiIGhlaWdodD0iNTQuODQ5cHgiIHZpZXdCb3g9IjAgMCA1NC44NDkgNTQuODQ5IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1NC44NDkgNTQuODQ5OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGc+PGc+PGc+PHBhdGggZD0iTTU0LjQ5NywzOS42MTRsLTEwLjM2My00LjQ5bC0xNC45MTcsNS45NjhjLTAuNTM3LDAuMjE0LTEuMTY1LDAuMzE5LTEuNzkzLDAuMz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48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjwvc3ZnPg==); background-position: center; diff --git a/modern/src/map/switcher/switcher.js b/modern/src/map/switcher/switcher.js index ff9fbe97..a755645b 100644 --- a/modern/src/map/switcher/switcher.js +++ b/modern/src/map/switcher/switcher.js @@ -15,12 +15,12 @@ export class SwitcherControl { onAdd(map) { this.map = map; this.controlContainer = document.createElement('div'); - this.controlContainer.classList.add('mapboxgl-ctrl'); - this.controlContainer.classList.add('mapboxgl-ctrl-group'); + this.controlContainer.classList.add('maplibregl-ctrl'); + this.controlContainer.classList.add('maplibregl-ctrl-group'); this.mapStyleContainer = document.createElement('div'); this.styleButton = document.createElement('button'); this.styleButton.type = 'button'; - this.mapStyleContainer.classList.add('mapboxgl-style-list'); + this.mapStyleContainer.classList.add('maplibregl-style-list'); for (const style of this.styles) { const styleElement = document.createElement('button'); styleElement.type = 'button'; @@ -48,8 +48,8 @@ export class SwitcherControl { } this.mapStyleContainer.appendChild(styleElement); } - this.styleButton.classList.add('mapboxgl-ctrl-icon'); - this.styleButton.classList.add('mapboxgl-style-switcher'); + this.styleButton.classList.add('maplibregl-ctrl-icon'); + this.styleButton.classList.add('maplibregl-style-switcher'); this.styleButton.addEventListener('click', () => { this.styleButton.style.display = 'none'; this.mapStyleContainer.style.display = 'block'; diff --git a/modern/src/reports/ReportFilter.js b/modern/src/reports/ReportFilter.js index 516891e8..524f7bbf 100644 --- a/modern/src/reports/ReportFilter.js +++ b/modern/src/reports/ReportFilter.js @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { FormControl, InputLabel, Select, MenuItem, Button, TextField, Grid, Typography} from '@material-ui/core'; +import { FormControl, InputLabel, Select, MenuItem, Button, TextField, Grid, Typography } from '@material-ui/core'; import { useSelector } from 'react-redux'; import moment from 'moment'; import t from '../common/localization'; |