mirror of
https://github.com/maputnik/editor.git
synced 2026-12-06 00:34:22 +00:00
Update all dependencies
This commit is contained in:
1 parent
eaf9892a88
commit
9bea7634bb
11 files changed
+531
-637
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import Color from "color";
|
||||
import ChromePicker from "react-color/lib/components/chrome/Chrome";
|
||||
import {type ColorResult} from "react-color";
|
||||
import {ChromePicker, type ColorResult} from "react-color";
|
||||
import lodash from "lodash";
|
||||
|
||||
function formatColor(color: ColorResult): string {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import {createRoot} from "react-dom/client";
|
||||
import MapLibreGl, {type LayerSpecification, type LngLat, type Map, type MapOptions, type SourceSpecification, type StyleSpecification} from "maplibre-gl";
|
||||
import * as MapLibreGl from "maplibre-gl";
|
||||
import {type LayerSpecification, type LngLat, type Map, type MapOptions, type SourceSpecification, type StyleSpecification} from "maplibre-gl";
|
||||
import MaplibreInspect from "@maplibre/maplibre-gl-inspect";
|
||||
import colors from "@maplibre/maplibre-gl-inspect/lib/colors";
|
||||
import { FeatureLayerPopup as MapMaplibreGlLayerPopup } from "./MapMaplibreGlLayerPopup";
|
||||
@@ -10,7 +11,7 @@ import { ZoomControl } from "../libs/zoomcontrol";
|
||||
import { type HighlightedLayer, colorHighlightedLayer } from "../libs/highlight";
|
||||
import "maplibre-gl/dist/maplibre-gl.css";
|
||||
import "../maplibregl.css";
|
||||
import "../libs/maplibre-rtl";
|
||||
import "../libs/maplibre-init";
|
||||
import MaplibreGeocoder, { type MaplibreGeocoderApi, type MaplibreGeocoderApiConfig } from "@maplibre/maplibre-gl-geocoder";
|
||||
import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
|
||||
import { withTranslation, type WithTranslation } from "react-i18next";
|
||||
@@ -238,7 +239,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
||||
});
|
||||
|
||||
map.on("data", e => {
|
||||
if(e.dataType !== "tile") return;
|
||||
if(e.dataType !== "source" || !e.tile) return;
|
||||
this.props.onDataChange!({
|
||||
map: this.state.map
|
||||
});
|
||||
|
||||
@@ -59,7 +59,6 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
|
||||
<meta charset="utf-8" />
|
||||
<title>${htmlTitle}</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<script src="https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.js"></script>
|
||||
<link href="https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
@@ -68,8 +67,9 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
const map = new maplibregl.Map({
|
||||
<script type="module">
|
||||
import {Map} from 'https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.mjs';
|
||||
const map = new Map({
|
||||
container: 'map',
|
||||
style: ${tokenStyle},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { setRTLTextPlugin, setWorkerUrl } from "maplibre-gl";
|
||||
// maplibre-gl v6 is ESM only and cannot locate its worker through a bundler's
|
||||
// module graph, so every consumer has to point it at the worker once.
|
||||
// `?worker&url` (rather than plain `?url`) routes the file through Vite's worker
|
||||
// pipeline, which emits a self-contained chunk including its `maplibre-gl-shared`
|
||||
// sibling. See https://maplibre.org/maplibre-gl-js/docs/#vite
|
||||
import workerUrl from "maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url";
|
||||
|
||||
// Order matters: registering the RTL plugin spins up the worker pool, so the
|
||||
// worker URL has to be in place before it.
|
||||
setWorkerUrl(workerUrl);
|
||||
|
||||
// Served out of @mapbox/mapbox-gl-rtl-text via `publicDir` in vite.config.ts, so
|
||||
// the version comes from package.json rather than a pinned CDN URL.
|
||||
setRTLTextPlugin(`${import.meta.env.BASE_URL}mapbox-gl-rtl-text.js`, false);
|
||||
@@ -1,3 +0,0 @@
|
||||
import MapLibreGl from "maplibre-gl";
|
||||
|
||||
MapLibreGl.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js", false);
|
||||
@@ -32,8 +32,6 @@ export class ZoomControl {
|
||||
|
||||
addEventListeners (){
|
||||
this._map!.on("render", () => this.updateZoomLevel());
|
||||
this._map!.on("zoomIn", () => this.updateZoomLevel());
|
||||
this._map!.on("zoomOut", () => this.updateZoomLevel());
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
Reference in new issue
Block a user