-
-
- {{ text }}
-
-
-
- {{ value || default_value }}
-
-
+
+
diff --git a/libs/map/dataset/src/modules/StyleControl/lang/style/circle-style.json b/libs/map/dataset/src/modules/StyleControl/lang/style/circle-style.json
index 2073cd1..ddade3b 100644
--- a/libs/map/dataset/src/modules/StyleControl/lang/style/circle-style.json
+++ b/libs/map/dataset/src/modules/StyleControl/lang/style/circle-style.json
@@ -8,6 +8,7 @@
"circle-pitch-alignment": "Pitch alignment",
"circle-pitch-scale": "Pitch scale",
"stroke-width": "Stroke width",
- "stroke-opacity": "Stroke opacity"
+ "stroke-opacity": "Stroke opacity",
+ "translate": "Translate"
}
}
diff --git a/libs/map/dataset/src/modules/StyleControl/lang/style/symbol-style.json b/libs/map/dataset/src/modules/StyleControl/lang/style/symbol-style.json
index 6f0506a..10a9959 100644
--- a/libs/map/dataset/src/modules/StyleControl/lang/style/symbol-style.json
+++ b/libs/map/dataset/src/modules/StyleControl/lang/style/symbol-style.json
@@ -6,20 +6,50 @@
"placement": "Placement"
},
"setting": {
- "text-field": "Text field",
+ "text-font": "Font",
"text-color": "Color",
- "text-size": "Size",
- "text-opacity": "Opacity",
- "text-transform": "Transform",
- "text-letter-spacing": "Letter spacing",
- "text-line-height": "Line height",
- "text-max-width": "Max width",
- "text-halo-blur": "Halo blur",
- "text-halo-width": "Halo width",
- "text-halo-color": "Halo color",
- "icon-image": "Image",
- "icon-size": "Size",
- "icon-opacity": "Opacity",
- "icon-text-fit": "Fill icon to text"
+ "text-field": "Content",
+ "image": "Image",
+ "color": "Color",
+ "opacity": "Opacity",
+ "font": "Font",
+ "letter-spacing": "Letter spacing",
+ "line-height": "Line height",
+ "max-width": "Max width",
+ "transform": "Transform",
+ "halo-color": "Halo color",
+ "halo-width": "Halo width",
+ "halo-blur": "Halo blur",
+ "fit-icon": "Fit icon to text",
+ "size": "Size",
+ "icon-opacity": "Icon opacity",
+ "icon-size": "Icon size",
+ "icon-text-fit": "Fit icon to text",
+ "icon-text-fit-padding": "Icon-text padding",
+ "icon-image": "Icon image",
+ "text-justify": "Text justification",
+ "text-anchor": "Text anchor",
+ "text-offset": "Text offset",
+ "text-radial-offset": "Text radial offset",
+ "text-translate": "Text translation",
+ "text-rotate": "Text rotation",
+ "text-pitch-alignment": "Text pitch alignment",
+ "icon-offset": "Icon offset",
+ "icon-translate": "Icon translation",
+ "icon-rotate": "Icon rotation",
+ "symbol-placement": "Symbol placement",
+ "symbol-spacing": "Symbol spacing",
+ "text-max-angle": "Max text angle",
+ "avoid-edges": "Avoid edges",
+ "sort-key": "Sort key",
+ "text-orientation": "Text orientation",
+ "text-padding": "Text padding",
+ "allow-text-overlap": "Allow text overlap",
+ "text-ignore-placement": "Text ignore placement",
+ "text-optional": "Text optional",
+ "icon-padding": "Icon padding",
+ "allow-icon-overlap": "Allow icon overlap",
+ "icon-ignore-placement": "Icon ignore placement",
+ "icon-optional": "Icon optional"
}
}
diff --git a/libs/map/dataset/src/modules/StyleControl/style-control.vue b/libs/map/dataset/src/modules/StyleControl/style-control.vue
index 6292fe3..5ab5c07 100644
--- a/libs/map/dataset/src/modules/StyleControl/style-control.vue
+++ b/libs/map/dataset/src/modules/StyleControl/style-control.vue
@@ -39,16 +39,7 @@ let layer_map_component: any = shallowRef('');
onMounted(() => {
toggleShow(true);
layer_map.value = undefined;
- const layerView = findSiblingOrNearestLeaf(props.item, (dataset) =>
- isMapboxLayerView(dataset)
- );
- if (layerView) {
- if (isMapboxLayerView(layerView)) {
- layer_map.value = layerView || undefined;
- layer_map_component.value = layerView.getComponentUpdate();
- layer.value = copyByJson(layerView.getData());
- }
- }
+ updateValue();
});
const onClose = () => {
layer_map.value = undefined;
@@ -62,6 +53,19 @@ const onUpdateStyle = (value: any) => {
}
layer_map.value.updateValue(map, value);
});
+ updateValue();
+};
+const updateValue = () => {
+ const layerView = findSiblingOrNearestLeaf(props.item, (dataset) =>
+ isMapboxLayerView(dataset)
+ );
+ if (layerView) {
+ if (isMapboxLayerView(layerView)) {
+ layer_map.value = layerView || undefined;
+ layer_map_component.value = layerView.getComponentUpdate();
+ layer.value = copyByJson(layerView.getData());
+ }
+ }
};
diff --git a/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayIndex.vue b/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayIndex.vue
new file mode 100644
index 0000000..03f9bf5
--- /dev/null
+++ b/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayIndex.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
diff --git a/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayXY.vue b/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayXY.vue
new file mode 100644
index 0000000..2f1aa59
--- /dev/null
+++ b/libs/map/dataset/src/modules/StyleControl/style/field/InputArrayXY.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
diff --git a/libs/map/dataset/src/modules/StyleControl/style/field/InputImage.vue b/libs/map/dataset/src/modules/StyleControl/style/field/InputImage.vue
new file mode 100644
index 0000000..80aee55
--- /dev/null
+++ b/libs/map/dataset/src/modules/StyleControl/style/field/InputImage.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
diff --git a/libs/map/dataset/src/modules/StyleControl/style/field/InputMultiple.vue b/libs/map/dataset/src/modules/StyleControl/style/field/InputMultiple.vue
new file mode 100644
index 0000000..d3399d4
--- /dev/null
+++ b/libs/map/dataset/src/modules/StyleControl/style/field/InputMultiple.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
diff --git a/libs/map/dataset/src/modules/StyleControl/style/multi-style.vue b/libs/map/dataset/src/modules/StyleControl/style/multi-style.vue
index f55c2c7..b5ba57d 100644
--- a/libs/map/dataset/src/modules/StyleControl/style/multi-style.vue
+++ b/libs/map/dataset/src/modules/StyleControl/style/multi-style.vue
@@ -2,11 +2,17 @@
import { BaseButton, InputSelect, useShow } from '@hungpvq/vue-map-core';
import SvgIcon from '@jamescoyle/vue-icon';
import { mdiClose, mdiDelete, mdiPlus } from '@mdi/js';
-import { Layer } from 'mapbox-gl';
+import { LayerSpecification } from 'maplibre-gl';
import { computed, nextTick, ref, watch } from 'vue';
import { LayerSimpleMapboxBuild } from '../../../utils/layer-simple-builder';
import SingleStyle from './single-style.vue';
-const props = defineProps({
+defineExpose({
+ SvgIcon,
+ SingleStyle,
+ BaseButton,
+ InputSelect,
+});
+defineProps({
trans: {
required: true,
},
@@ -15,7 +21,10 @@ const props = defineProps({
},
});
const emit = defineEmits(['input', 'update-style', 'close']);
-const layers = defineModel({ required: true, default: () => [] });
+const layers = defineModel({
+ required: true,
+ default: () => [],
+});
watch(layers, () => {
if (!tab.value && layers.value.length > 0) {
tab.value = layers.value[layers.value.length - 1].id;
@@ -27,7 +36,7 @@ const onSelectTab = (layer_id: string) => {
tab.value = layer_id;
});
};
-const onUpdateStyleLayer = (layer: Layer, layer_id: string) => {
+const onUpdateStyleLayer = (layer: LayerSpecification, layer_id: string) => {
emit('update-style', {
type: 'update-one-layer',
layer,
@@ -57,6 +66,12 @@ const onRemoveStyleLayer = (layer_id: string) => {
layer: layers.value[index],
});
layers.value.splice(index, 1);
+ if (layers.value.length === 0) {
+ tab.value = undefined;
+ onShowAddStyle(true);
+ } else {
+ tab.value = layers.value[layers.value.length - 1]?.id; // Nếu tab hiện tại là layer bị xóa, chọn lại layer đầu tiên còn lại
+ }
if (layers.value[0]) onSelectTab(layers.value[0].id);
};
const tab = ref(layers.value[0].id);
@@ -82,37 +97,29 @@ const onShowAddStyle = (value: boolean) => {
@@ -135,6 +142,7 @@ const onShowAddStyle = (value: boolean) => {
:modelValue="current_layer"
:trans="trans"
:mapId="mapId"
+ :key="tab"
@update-style="onUpdateStyleLayer($event, tab)"
/>
@@ -148,7 +156,7 @@ const onShowAddStyle = (value: boolean) => {
}
.style-container {
flex-grow: 1;
- overflow: auto;
+ overflow: hidden;
display: flex;
height: 100%;
}
@@ -170,11 +178,12 @@ const onShowAddStyle = (value: boolean) => {
padding: 8px 16px;
}
.tab-add {
+ flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
- max-width: 20px;
+ background: transparent;
}
}
diff --git a/libs/map/dataset/src/modules/StyleControl/style/single-style.vue b/libs/map/dataset/src/modules/StyleControl/style/single-style.vue
index 4121722..288027b 100644
--- a/libs/map/dataset/src/modules/StyleControl/style/single-style.vue
+++ b/libs/map/dataset/src/modules/StyleControl/style/single-style.vue
@@ -1,11 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libs/map/draw/src/modules/InspectControl/colors.ts b/libs/map/draw/src/modules/InspectControl/colors.ts
new file mode 100644
index 0000000..0655dab
--- /dev/null
+++ b/libs/map/draw/src/modules/InspectControl/colors.ts
@@ -0,0 +1,57 @@
+import randomColor from 'randomcolor';
+
+/**
+ * Assign a color to a unique layer ID and also considering
+ * common layer names such as water or wood.
+ * @param layerId - a layer ID
+ * @param alpha - alpha value for the color, default is 1
+ * @return a color in rgba string format
+ */
+export function brightColor(layerId: string, alpha?: number) {
+ let luminosity: NonNullable
[0]>['luminosity'] =
+ 'bright';
+ let hue: NonNullable[0]>['hue'] = undefined;
+
+ if (/water|ocean|lake|sea|river/.test(layerId)) {
+ hue = 'blue';
+ }
+
+ if (/state|country|place/.test(layerId)) {
+ hue = 'pink';
+ }
+
+ if (/road|highway|transport|streets/.test(layerId)) {
+ hue = 'orange';
+ }
+
+ if (/contour|building|earth/.test(layerId)) {
+ hue = 'monochrome';
+ }
+
+ if (/building/.test(layerId)) {
+ luminosity = 'dark';
+ }
+
+ if (/earth/.test(layerId)) {
+ luminosity = 'light';
+ }
+
+ if (/contour|landuse/.test(layerId)) {
+ hue = 'yellow';
+ }
+
+ if (/wood|forest|park|landcover|land|natural/.test(layerId)) {
+ hue = 'green';
+ }
+
+ const rgb = randomColor({
+ luminosity,
+ hue,
+ seed: layerId,
+ format: 'rgbArray',
+ }) as unknown as string[];
+
+ return `rgba(${rgb.join(', ')}, ${alpha || '1'})`;
+}
+
+export default { brightColor };
diff --git a/libs/map/draw/src/modules/InspectControl/inspect.ts b/libs/map/draw/src/modules/InspectControl/inspect.ts
new file mode 100644
index 0000000..f5f0f2a
--- /dev/null
+++ b/libs/map/draw/src/modules/InspectControl/inspect.ts
@@ -0,0 +1,35 @@
+import { MapSimple } from '@hungpvq/shared-map';
+import { StyleSpecification } from 'maplibre-gl';
+
+export type InspectStyleSpecification = StyleSpecification & {
+ metadata: { 'maplibregl-inspect:inspect': boolean };
+};
+
+export function isInspectStyle(style: InspectStyleSpecification) {
+ return style.metadata && style.metadata['maplibregl-inspect:inspect'];
+}
+export function getSourcesFromMap(map: MapSimple) {
+ const sources: Record = {};
+ //NOTE: This heavily depends on the internal API of Maplibre GL
+ //so this breaks between Maplibre GL JS releases
+ Object.keys(map.style.sourceCaches).forEach((sourceId) => {
+ const sourceCache = map.style.sourceCaches[sourceId] || {
+ _source: {},
+ };
+ const layerIds = sourceCache._source.vectorLayerIds;
+ if (layerIds) {
+ sources[sourceId] = layerIds;
+ } else if (sourceCache._source.type === 'geojson') {
+ sources[sourceId] = [];
+ }
+ });
+ return sources;
+}
+
+export function markInspectStyle(style: StyleSpecification) {
+ return Object.assign(style, {
+ metadata: Object.assign({}, style.metadata, {
+ 'maplibregl-inspect:inspect': true,
+ }),
+ });
+}
diff --git a/libs/map/draw/src/modules/InspectControl/renderPopup.ts b/libs/map/draw/src/modules/InspectControl/renderPopup.ts
new file mode 100644
index 0000000..344b865
--- /dev/null
+++ b/libs/map/draw/src/modules/InspectControl/renderPopup.ts
@@ -0,0 +1,66 @@
+import type { MapGeoJSONFeature } from 'maplibre-gl';
+
+/**
+ * A GeoJSON feature with a source layer
+ */
+export type GeoJSONFeatureWithSourceLayer = MapGeoJSONFeature & {
+ layer: { 'source-layer'?: string };
+};
+
+function displayValue(value: unknown) {
+ if (typeof value === 'undefined' || value === null) return value;
+ if (value instanceof Date) return value.toLocaleString();
+ if (
+ typeof value === 'object' ||
+ typeof value === 'number' ||
+ typeof value === 'string'
+ )
+ return value.toString();
+ return value;
+}
+
+function renderProperty(propertyName: string, property: unknown) {
+ return (
+ `${
+ '' +
+ '
'
+ }${propertyName}
` +
+ `
${displayValue(
+ property
+ )}
` +
+ '
'
+ );
+}
+
+function renderLayer(layerId: string) {
+ return `${layerId}
`;
+}
+
+function renderProperties(feature: GeoJSONFeatureWithSourceLayer) {
+ const sourceProperty = renderLayer(
+ feature.layer['source-layer'] || feature.layer.source
+ );
+ const idProperty = renderProperty('$id', feature.id);
+ const typeProperty = renderProperty('$type', feature.geometry.type);
+ const properties = Object.keys(feature.properties).map((propertyName) =>
+ renderProperty(propertyName, feature.properties[propertyName])
+ );
+ return [sourceProperty, idProperty, typeProperty].concat(properties).join('');
+}
+
+function renderFeatures(features: GeoJSONFeatureWithSourceLayer[]) {
+ return features
+ .map(
+ (ft) =>
+ `${renderProperties(ft)}
`
+ )
+ .join('');
+}
+
+function renderPopup(features: GeoJSONFeatureWithSourceLayer[]) {
+ return ``;
+}
+
+export default renderPopup;
diff --git a/libs/map/draw/src/modules/InspectControl/stylegen.ts b/libs/map/draw/src/modules/InspectControl/stylegen.ts
new file mode 100644
index 0000000..8cf4c41
--- /dev/null
+++ b/libs/map/draw/src/modules/InspectControl/stylegen.ts
@@ -0,0 +1,161 @@
+import type { LayerSpecification, StyleSpecification } from 'maplibre-gl';
+
+function circleLayer(color: string, source: string, vectorLayer?: string) {
+ const layer: LayerSpecification = {
+ id: [source, vectorLayer, 'circle'].join('_'),
+ source,
+ type: 'circle',
+ paint: {
+ 'circle-color': color,
+ 'circle-radius': 2,
+ },
+ filter: ['==', '$type', 'Point'],
+ };
+ if (vectorLayer) {
+ layer['source-layer'] = vectorLayer;
+ }
+ return layer;
+}
+
+function polygonLayer(
+ color: string,
+ _outlineColor: string,
+ source: string,
+ vectorLayer?: string
+) {
+ const layer: LayerSpecification = {
+ id: [source, vectorLayer, 'polygon'].join('_'),
+ source,
+ type: 'fill',
+ paint: {
+ 'fill-color': color,
+ 'fill-antialias': true,
+ 'fill-outline-color': color,
+ },
+ filter: ['==', '$type', 'Polygon'],
+ };
+ if (vectorLayer) {
+ layer['source-layer'] = vectorLayer;
+ }
+ return layer;
+}
+
+function lineLayer(color: string, source: string, vectorLayer?: string) {
+ const layer: LayerSpecification = {
+ id: [source, vectorLayer, 'line'].join('_'),
+ source,
+ layout: {
+ 'line-join': 'round',
+ 'line-cap': 'round',
+ },
+ type: 'line',
+ paint: {
+ 'line-color': color,
+ },
+ filter: ['==', '$type', 'LineString'],
+ };
+ if (vectorLayer) {
+ layer['source-layer'] = vectorLayer;
+ }
+ return layer;
+}
+
+/**
+ * Generate colored layer styles for the given sources
+ * @param sources dictionary containing the vector layer IDs
+ * @param Function to generate a color for a layer
+ * @return Array of Maplibre GL layers
+ */
+export function generateColoredLayers(
+ sources: { [key: string]: string[] },
+ assignLayerColor: (layerId: string, alpha: number) => string
+): LayerSpecification[] {
+ const polyLayers: LayerSpecification[] = [];
+ const circleLayers: LayerSpecification[] = [];
+ const lineLayers: LayerSpecification[] = [];
+
+ function alphaColors(layerId: string) {
+ const obj = {
+ circle: assignLayerColor(layerId, 0.8),
+ line: assignLayerColor(layerId, 0.6),
+ polygon: assignLayerColor(layerId, 0.3),
+ polygonOutline: assignLayerColor(layerId, 0.6),
+ default: assignLayerColor(layerId, 1),
+ };
+ return obj;
+ }
+
+ Object.keys(sources).forEach((sourceId) => {
+ const layers = sources[sourceId];
+
+ if (!layers || layers.length === 0) {
+ const colors = alphaColors(sourceId);
+ circleLayers.push(circleLayer(colors.circle, sourceId));
+ lineLayers.push(lineLayer(colors.line, sourceId));
+ polyLayers.push(
+ polygonLayer(colors.polygon, colors.polygonOutline, sourceId)
+ );
+ } else {
+ layers.forEach((layerId: string) => {
+ const colors = alphaColors(layerId);
+
+ circleLayers.push(circleLayer(colors.circle, sourceId, layerId));
+ lineLayers.push(lineLayer(colors.line, sourceId, layerId));
+ polyLayers.push(
+ polygonLayer(colors.polygon, colors.polygonOutline, sourceId, layerId)
+ );
+ });
+ }
+ });
+
+ return polyLayers.concat(lineLayers).concat(circleLayers);
+}
+
+/**
+ * Create inspection style out of the original style and the new colored layers
+ * @param originalMapStyle - map style
+ * @param coloredLayers - array of colored Maplibre GL layers
+ * @param opts - options
+ * @return {Object} Colored inspect style
+ */
+export function generateInspectStyle(
+ originalMapStyle: StyleSpecification,
+ coloredLayers: LayerSpecification[],
+ opts: { backgroundColor?: string }
+): StyleSpecification {
+ opts = Object.assign(
+ {
+ backgroundColor: '#fff',
+ },
+ opts
+ );
+
+ const backgroundLayer: LayerSpecification = {
+ id: 'background',
+ type: 'background',
+ paint: {
+ 'background-color': opts.backgroundColor,
+ },
+ };
+
+ const sources: StyleSpecification['sources'] = {};
+ Object.keys(originalMapStyle.sources).forEach((sourceId) => {
+ const source = originalMapStyle.sources[sourceId];
+ if (source.type === 'vector' || source.type === 'geojson') {
+ sources[sourceId] = source;
+ }
+ });
+
+ return Object.assign(originalMapStyle, {
+ layers: ([backgroundLayer] as LayerSpecification[]).concat(coloredLayers),
+ sources,
+ });
+}
+
+export default {
+ polygonLayer,
+ lineLayer,
+ circleLayer,
+ generateInspectStyle,
+ generateColoredLayers,
+};
diff --git a/libs/map/draw/src/modules/index.ts b/libs/map/draw/src/modules/index.ts
index 657e64b..3f0a845 100644
--- a/libs/map/draw/src/modules/index.ts
+++ b/libs/map/draw/src/modules/index.ts
@@ -1,4 +1,5 @@
export { default as DrawControl } from './DrawControl/DrawControl.vue';
+export { default as InspectControl } from './InspectControl/InspectControl.vue';
export const DrawingType = {
POINT: 'draw_point',
LINE_STRING: 'draw_line_string',
diff --git a/libs/map/draw/src/store/index.ts b/libs/map/draw/src/store/index.ts
index bc6c763..0d4612d 100644
--- a/libs/map/draw/src/store/index.ts
+++ b/libs/map/draw/src/store/index.ts
@@ -1,17 +1,11 @@
import { getUUIDv4 } from '@hungpvq/shared';
-import {
- addStore,
- addToQueue,
- getStore,
- store as storeMap,
-} from '@hungpvq/vue-map-core';
+import { addStore, addToQueue, getStore } from '@hungpvq/vue-map-core';
import type { Feature, FeatureCollection, GeoJSON } from 'geojson';
import { reactive } from 'vue';
import {
DrawOption,
DrawSaveFc,
DrawSaveFcParams,
- ILayerDrawView,
MapDrawStore,
} from '../types';
export const KEY = 'draw';
diff --git a/libs/map/draw/src/types/index.ts b/libs/map/draw/src/types/index.ts
index cd0601e..857027f 100644
--- a/libs/map/draw/src/types/index.ts
+++ b/libs/map/draw/src/types/index.ts
@@ -46,10 +46,10 @@ export type ILayerDrawView = {
export type DrawOption = {
draw_support: ILayerDrawView['draw_support'];
- addFeatures: IDrawHandler['addFeatures'];
- getFeatures: IDrawHandler['getFeatures'];
- updateFeatures: IDrawHandler['updateFeatures'];
- deleteFeatures: IDrawHandler['deleteFeatures'];
+ addFeatures?: IDrawHandler['addFeatures'];
+ getFeatures?: IDrawHandler['getFeatures'];
+ updateFeatures?: IDrawHandler['updateFeatures'];
+ deleteFeatures?: IDrawHandler['deleteFeatures'];
reset?: () => Promise;
save?: (geojson?: GeoJSON) => Promise;
cleanAfterDone?: boolean;
diff --git a/libs/map/measurement/package.json b/libs/map/measurement/package.json
index 7557046..24b2f2c 100644
--- a/libs/map/measurement/package.json
+++ b/libs/map/measurement/package.json
@@ -33,7 +33,7 @@
"@mdi/js": "^7.4.47",
"@turf/turf": "^6.5.0",
"@turf/helpers": "^6.5.0",
- "mapbox-gl": ">=1.13.0",
+ "maplibre-gl": "^5.4.0",
"@hungpvq/shared": ">=0.0.1",
"file-saver": "^2.0.5"
}
diff --git a/libs/map/measurement/src/modules/MeasurementControl.vue b/libs/map/measurement/src/modules/MeasurementControl.vue
index 02a3157..1f6a1e8 100644
--- a/libs/map/measurement/src/modules/MeasurementControl.vue
+++ b/libs/map/measurement/src/modules/MeasurementControl.vue
@@ -109,7 +109,7 @@ import {
mdiRulerSquareCompass,
mdiTableHeadersEye,
} from '@mdi/js';
-import { MapMouseEvent } from 'mapbox-gl';
+import { MapMouseEvent } from 'maplibre-gl';
import { nextTick, ref } from 'vue';
import MeasurementSettingPopup from './MeasurementSettingPopup.vue';
import {
diff --git a/libs/map/measurement/src/modules/helper/_viewMap.ts b/libs/map/measurement/src/modules/helper/_viewMap.ts
index 7a3ee6d..290ead0 100644
--- a/libs/map/measurement/src/modules/helper/_viewMap.ts
+++ b/libs/map/measurement/src/modules/helper/_viewMap.ts
@@ -1,6 +1,6 @@
import { getUUIDv4 } from '@hungpvq/shared';
import type { MapSimple } from '@hungpvq/shared-map';
-import { GeoJSONSource } from 'mapbox-gl';
+import { GeoJSONSource } from 'maplibre-gl';
import { View } from './_view';
export class MapView extends View {
diff --git a/libs/map/measurement/src/modules/helper/_viewMapMarker.ts b/libs/map/measurement/src/modules/helper/_viewMapMarker.ts
index 837035e..eae80a4 100644
--- a/libs/map/measurement/src/modules/helper/_viewMapMarker.ts
+++ b/libs/map/measurement/src/modules/helper/_viewMapMarker.ts
@@ -1,7 +1,7 @@
/* eslint-disable no-unused-vars */
import type { Color, CoordinatesNumber, MapSimple } from '@hungpvq/shared-map';
-import { Marker } from 'mapbox-gl';
+import { Marker } from 'maplibre-gl';
import { IViewSetting } from '../types';
import { View } from './_view';
diff --git a/libs/map/print/package.json b/libs/map/print/package.json
index a08b948..38c87a3 100644
--- a/libs/map/print/package.json
+++ b/libs/map/print/package.json
@@ -32,6 +32,6 @@
"@hungpvq/vue-draggable": ">=0.0.1",
"@hungpvq/shared-map": ">=0.0.1",
"file-saver": "^2.0.5",
- "mapbox-gl": ">=1.13.0"
+ "maplibre-gl": "^5.4.0"
}
}
diff --git a/libs/map/print/src/modules/print/ExportManager.ts b/libs/map/print/src/modules/print/ExportManager.ts
index 5901b25..9627901 100644
--- a/libs/map/print/src/modules/print/ExportManager.ts
+++ b/libs/map/print/src/modules/print/ExportManager.ts
@@ -1,5 +1,5 @@
import type { MapSimple } from '@hungpvq/shared-map';
-import maplibregl from 'mapbox-gl';
+import maplibregl from 'maplibre-gl';
export function exportMapbox(map: MapSimple): Promise {
const { renderMap, hidden } = getMapBoxCanvas(map, (container) => {
diff --git a/libs/share/map/package.json b/libs/share/map/package.json
index 047da26..22a878f 100644
--- a/libs/share/map/package.json
+++ b/libs/share/map/package.json
@@ -15,7 +15,7 @@
},
"dependencies": {
"tslib": "^2.3.0",
- "mapbox-gl": "^1.13.0",
+ "maplibre-gl": "^5.4.0",
"@turf/turf": "^6.5.0"
},
"type": "commonjs",
diff --git a/libs/share/map/src/fillBound/index.ts b/libs/share/map/src/fillBound/index.ts
index 76a6399..820ae66 100644
--- a/libs/share/map/src/fillBound/index.ts
+++ b/libs/share/map/src/fillBound/index.ts
@@ -1,4 +1,4 @@
-import { EaseToOptions, PaddingOptions } from 'mapbox-gl';
+import { EaseToOptions, PaddingOptions } from 'maplibre-gl';
import { bbox, lineString, point, polygon } from '@turf/turf';
import { CoordinatesNumber, MapSimple } from '../types';
diff --git a/libs/share/map/src/types/index.ts b/libs/share/map/src/types/index.ts
index e21be4e..90e2e6a 100644
--- a/libs/share/map/src/types/index.ts
+++ b/libs/share/map/src/types/index.ts
@@ -1,4 +1,4 @@
-import { Map } from 'mapbox-gl';
+import { Map } from 'maplibre-gl';
export type MapSimple = Map & {
id: string;
diff --git a/package-lock.json b/package-lock.json
index 31242d8..a3d4116 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,17 +21,17 @@
"@types/file-saver": "^2.0.7",
"@types/js-yaml": "^4.0.9",
"@types/mapbox__mapbox-gl-draw": "^1.4.6",
- "@types/mapbox-gl": "^3.1.0",
"codemirror": "^6.0.1",
"file-saver": "^2.0.5",
"geojson-validation": "^1.0.2",
"js-yaml": "^4.1.0",
"jspdf": "^2.5.1",
"lodash": "^4.17.21",
- "mapbox-gl": "^1.13.0",
+ "maplibre-gl": "^5.4.0",
"mitt": "^3.0.1",
"papaparse": "^5.5.2",
"proj4": "^2.11.0",
+ "randomcolor": "^0.6.2",
"rollup-plugin-copy": "^3.5.0",
"sortablejs": "^1.15.2",
"tokml": "^0.4.0",
@@ -67,6 +67,7 @@
"@types/node": "18.16.9",
"@types/papaparse": "^5.3.15",
"@types/proj4": "^2.5.5",
+ "@types/randomcolor": "^0.5.9",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^7.3.0",
"@typescript-eslint/parser": "^7.3.0",
@@ -4644,11 +4645,6 @@
"geojson-rewind": "geojson-rewind"
}
},
- "node_modules/@mapbox/geojson-types": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
- "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
- },
"node_modules/@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
@@ -4671,14 +4667,6 @@
"xtend": "^4.0.2"
}
},
- "node_modules/@mapbox/mapbox-gl-supported": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
- "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==",
- "peerDependencies": {
- "mapbox-gl": ">=0.32.1 <2.0.0"
- }
- },
"node_modules/@mapbox/mapbox-gl-sync-move": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-sync-move/-/mapbox-gl-sync-move-0.3.1.tgz",
@@ -4699,16 +4687,6 @@
"jszip": "^3.10.1"
}
},
- "node_modules/@mapbox/tiny-sdf": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
- "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
- },
- "node_modules/@mapbox/unitbezier": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
- "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
- },
"node_modules/@mapbox/vector-tile": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz",
@@ -4725,6 +4703,50 @@
"node": ">=6.0.0"
}
},
+ "node_modules/@maplibre/maplibre-gl-style-spec": {
+ "version": "23.2.1",
+ "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-23.2.1.tgz",
+ "integrity": "sha512-SDeCvKyrPqkW1wsoNKRLuE+urRgnYa9qDE/9bVZnz7alNILPPIFPa5jcq1VgFSivnktbnoVZNNXXqNoOUKZYNg==",
+ "license": "ISC",
+ "dependencies": {
+ "@mapbox/jsonlint-lines-primitives": "~2.0.2",
+ "@mapbox/unitbezier": "^0.0.1",
+ "json-stringify-pretty-compact": "^4.0.0",
+ "minimist": "^1.2.8",
+ "quickselect": "^3.0.0",
+ "rw": "^1.3.3",
+ "tinyqueue": "^3.0.0"
+ },
+ "bin": {
+ "gl-style-format": "dist/gl-style-format.mjs",
+ "gl-style-migrate": "dist/gl-style-migrate.mjs",
+ "gl-style-validate": "dist/gl-style-validate.mjs"
+ }
+ },
+ "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
+ "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
+ "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==",
+ "license": "ISC"
+ },
+ "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/rw": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
+ "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==",
+ "license": "ISC"
+ },
"node_modules/@mdi/js": {
"version": "7.4.47",
"resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz",
@@ -7747,9 +7769,10 @@
}
},
"node_modules/@types/geojson": {
- "version": "7946.0.14",
- "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz",
- "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg=="
+ "version": "7946.0.16",
+ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
+ "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
+ "license": "MIT"
},
"node_modules/@types/geojson-validation": {
"version": "1.0.3",
@@ -7757,6 +7780,15 @@
"integrity": "sha512-S+Ka75g23eK33jblC6u3Tc7GKrBfo0VuHhydPw9WdWRib7sGPAubUbNiUkdTrX9dl5F18/iD8ERzH31AYLFiKg==",
"dev": true
},
+ "node_modules/@types/geojson-vt": {
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
+ "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
@@ -7841,6 +7873,23 @@
"@types/mapbox-gl": "*"
}
},
+ "node_modules/@types/mapbox__point-geometry": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
+ "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/mapbox__vector-tile": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
+ "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/geojson": "*",
+ "@types/mapbox__point-geometry": "*",
+ "@types/pbf": "*"
+ }
+ },
"node_modules/@types/mapbox-gl": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/mapbox-gl/-/mapbox-gl-3.1.0.tgz",
@@ -7890,6 +7939,12 @@
"integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==",
"dev": true
},
+ "node_modules/@types/pbf": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
+ "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==",
+ "license": "MIT"
+ },
"node_modules/@types/proj4": {
"version": "2.5.5",
"resolved": "https://registry.npmjs.org/@types/proj4/-/proj4-2.5.5.tgz",
@@ -7902,6 +7957,12 @@
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
"optional": true
},
+ "node_modules/@types/randomcolor": {
+ "version": "0.5.9",
+ "resolved": "https://registry.npmjs.org/@types/randomcolor/-/randomcolor-0.5.9.tgz",
+ "integrity": "sha512-k58cfpkK15AKn1m+oRd9nh5BnuiowhbyvBBdAzcddtARMr3xRzP0VlFaAKovSG6N6Knx08EicjPlOMzDejerrQ==",
+ "dev": true
+ },
"node_modules/@types/semver": {
"version": "7.5.8",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz",
@@ -7920,6 +7981,15 @@
"integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==",
"dev": true
},
+ "node_modules/@types/supercluster": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
+ "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/web-bluetooth": {
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
@@ -12219,11 +12289,6 @@
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
}
},
- "node_modules/csscolorparser": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz",
- "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="
- },
"node_modules/cssesc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
@@ -14369,11 +14434,6 @@
"gjv": "bin/gjv"
}
},
- "node_modules/geojson-vt": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
- "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
- },
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -14700,11 +14760,6 @@
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true
},
- "node_modules/grid-index": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz",
- "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA=="
- },
"node_modules/gunzip-maybe": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.2.tgz",
@@ -16676,6 +16731,12 @@
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true
},
+ "node_modules/json-stringify-pretty-compact": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz",
+ "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==",
+ "license": "MIT"
+ },
"node_modules/json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -16877,11 +16938,6 @@
"safe-buffer": "^5.0.1"
}
},
- "node_modules/kdbush": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
- "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
- },
"node_modules/keyv": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@@ -16891,6 +16947,15 @@
"json-buffer": "3.0.1"
}
},
+ "node_modules/kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/kleur": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
@@ -17745,42 +17810,150 @@
"tmpl": "1.0.5"
}
},
- "node_modules/mapbox-gl": {
- "version": "1.13.3",
- "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.3.tgz",
- "integrity": "sha512-p8lJFEiqmEQlyv+DQxFAOG/XPWN0Wp7j/Psq93Zywz7qt9CcUKFYDBOoOEKzqe6gudHVJY8/Bhqw6VDpX2lSBg==",
+ "node_modules/maplibre-gl": {
+ "version": "5.4.0",
+ "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.4.0.tgz",
+ "integrity": "sha512-ZVrtdFIhFAqt53H2k5Ssqn7QIKNI19fW+He5tr4loxZxWZffp1aZYY9ImNncAJaALU/NYlV6Eul7UVB56/N7WQ==",
+ "license": "BSD-3-Clause",
"dependencies": {
"@mapbox/geojson-rewind": "^0.5.2",
- "@mapbox/geojson-types": "^1.0.2",
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
- "@mapbox/mapbox-gl-supported": "^1.5.0",
"@mapbox/point-geometry": "^0.1.0",
- "@mapbox/tiny-sdf": "^1.1.1",
- "@mapbox/unitbezier": "^0.0.0",
+ "@mapbox/tiny-sdf": "^2.0.6",
+ "@mapbox/unitbezier": "^0.0.1",
"@mapbox/vector-tile": "^1.3.1",
"@mapbox/whoots-js": "^3.1.0",
- "csscolorparser": "~1.0.3",
- "earcut": "^2.2.2",
- "geojson-vt": "^3.2.1",
- "gl-matrix": "^3.2.1",
- "grid-index": "^1.1.0",
+ "@maplibre/maplibre-gl-style-spec": "^23.1.0",
+ "@types/geojson": "^7946.0.16",
+ "@types/geojson-vt": "3.2.5",
+ "@types/mapbox__point-geometry": "^0.1.4",
+ "@types/mapbox__vector-tile": "^1.3.4",
+ "@types/pbf": "^3.0.5",
+ "@types/supercluster": "^7.1.3",
+ "earcut": "^3.0.1",
+ "geojson-vt": "^4.0.2",
+ "gl-matrix": "^3.4.3",
+ "global-prefix": "^4.0.0",
+ "kdbush": "^4.0.2",
"murmurhash-js": "^1.0.0",
- "pbf": "^3.2.1",
- "potpack": "^1.0.1",
- "quickselect": "^2.0.0",
- "rw": "^1.3.3",
- "supercluster": "^7.1.0",
- "tinyqueue": "^2.0.3",
- "vt-pbf": "^3.1.1"
+ "pbf": "^3.3.0",
+ "potpack": "^2.0.0",
+ "quickselect": "^3.0.0",
+ "supercluster": "^8.0.1",
+ "tinyqueue": "^3.0.0",
+ "vt-pbf": "^3.1.3"
},
"engines": {
- "node": ">=6.4.0"
+ "node": ">=16.14.0",
+ "npm": ">=8.1.0"
+ },
+ "funding": {
+ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1"
}
},
- "node_modules/mapbox-gl/node_modules/rw": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
- "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
+ "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz",
+ "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
+ "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/maplibre-gl/node_modules/earcut": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz",
+ "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/geojson-vt": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz",
+ "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/global-prefix": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz",
+ "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==",
+ "license": "MIT",
+ "dependencies": {
+ "ini": "^4.1.3",
+ "kind-of": "^6.0.3",
+ "which": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/maplibre-gl/node_modules/ini": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz",
+ "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==",
+ "license": "ISC",
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/maplibre-gl/node_modules/isexe": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
+ "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/maplibre-gl/node_modules/kdbush": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
+ "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/potpack": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz",
+ "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/quickselect": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
+ "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/supercluster": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz",
+ "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==",
+ "license": "ISC",
+ "dependencies": {
+ "kdbush": "^4.0.2"
+ }
+ },
+ "node_modules/maplibre-gl/node_modules/tinyqueue": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
+ "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==",
+ "license": "ISC"
+ },
+ "node_modules/maplibre-gl/node_modules/which": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^3.1.1"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^16.13.0 || >=18.0.0"
+ }
},
"node_modules/mark.js": {
"version": "8.11.1",
@@ -18775,9 +18948,10 @@
}
},
"node_modules/pbf": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
- "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz",
+ "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==",
+ "license": "BSD-3-Clause",
"dependencies": {
"ieee754": "^1.1.12",
"resolve-protobuf-schema": "^2.1.0"
@@ -19155,11 +19329,6 @@
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"dev": true
},
- "node_modules/potpack": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
- "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
- },
"node_modules/preact": {
"version": "10.22.0",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.22.0.tgz",
@@ -19449,6 +19618,11 @@
"performance-now": "^2.1.0"
}
},
+ "node_modules/randomcolor": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/randomcolor/-/randomcolor-0.6.2.tgz",
+ "integrity": "sha512-Mn6TbyYpFgwFuQ8KJKqf3bqqY9O1y37/0jgSK/61PUxV4QfIMv0+K2ioq8DfOjkBslcjwSzRfIDEXfzA9aCx7A=="
+ },
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@@ -20696,14 +20870,6 @@
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz",
"integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw=="
},
- "node_modules/supercluster": {
- "version": "7.1.5",
- "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
- "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
- "dependencies": {
- "kdbush": "^3.0.0"
- }
- },
"node_modules/superjson": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.1.tgz",
diff --git a/package.json b/package.json
index 7b77541..d92ed74 100644
--- a/package.json
+++ b/package.json
@@ -44,17 +44,17 @@
"@types/file-saver": "^2.0.7",
"@types/js-yaml": "^4.0.9",
"@types/mapbox__mapbox-gl-draw": "^1.4.6",
- "@types/mapbox-gl": "^3.1.0",
"codemirror": "^6.0.1",
"file-saver": "^2.0.5",
"geojson-validation": "^1.0.2",
"js-yaml": "^4.1.0",
"jspdf": "^2.5.1",
"lodash": "^4.17.21",
- "mapbox-gl": "^1.13.0",
+ "maplibre-gl": "^5.4.0",
"mitt": "^3.0.1",
"papaparse": "^5.5.2",
"proj4": "^2.11.0",
+ "randomcolor": "^0.6.2",
"rollup-plugin-copy": "^3.5.0",
"sortablejs": "^1.15.2",
"tokml": "^0.4.0",
@@ -90,6 +90,7 @@
"@types/node": "18.16.9",
"@types/papaparse": "^5.3.15",
"@types/proj4": "^2.5.5",
+ "@types/randomcolor": "^0.5.9",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^7.3.0",
"@typescript-eslint/parser": "^7.3.0",