maplair 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +118 -0
- package/dist/esm/Maplair.js +14 -14
- package/dist/esm/control/AttributionControl.js +24 -14
- package/dist/esm/control/AttributionControl.js.map +1 -1
- package/dist/esm/control/ButtonControl.js +9 -11
- package/dist/esm/control/ButtonControl.js.map +1 -1
- package/dist/esm/control/ContextMenu.js +1 -3
- package/dist/esm/control/ContextMenu.js.map +1 -1
- package/dist/esm/control/Control.js +9 -16
- package/dist/esm/control/Control.js.map +1 -1
- package/dist/esm/control/FullscreenControl.js +5 -7
- package/dist/esm/control/FullscreenControl.js.map +1 -1
- package/dist/esm/control/LayersControl.js +144 -35
- package/dist/esm/control/LayersControl.js.map +1 -1
- package/dist/esm/control/LegendControl.js +7 -9
- package/dist/esm/control/LegendControl.js.map +1 -1
- package/dist/esm/control/MiniMapControl.js +14 -16
- package/dist/esm/control/MiniMapControl.js.map +1 -1
- package/dist/esm/control/RotateControl.js +1 -3
- package/dist/esm/control/RotateControl.js.map +1 -1
- package/dist/esm/control/ScaleControl.js +7 -9
- package/dist/esm/control/ScaleControl.js.map +1 -1
- package/dist/esm/control/SearchControl.js +99 -17
- package/dist/esm/control/SearchControl.js.map +1 -1
- package/dist/esm/control/SideBySideControl.js +1 -3
- package/dist/esm/control/SideBySideControl.js.map +1 -1
- package/dist/esm/control/TextControl.js +5 -7
- package/dist/esm/control/TextControl.js.map +1 -1
- package/dist/esm/control/TimeControl.js +408 -0
- package/dist/esm/control/TimeControl.js.map +1 -0
- package/dist/esm/control/ZoomControl.js +5 -7
- package/dist/esm/control/ZoomControl.js.map +1 -1
- package/dist/esm/core/Class.js +28 -37
- package/dist/esm/core/Class.js.map +1 -1
- package/dist/esm/core/Events.js +21 -8
- package/dist/esm/core/Events.js.map +1 -1
- package/dist/esm/core/Handler.js +13 -11
- package/dist/esm/core/Handler.js.map +1 -1
- package/dist/esm/core/Util.js +13 -1
- package/dist/esm/core/Util.js.map +1 -1
- package/dist/esm/dom/DomEvent.DoubleTap.js +25 -22
- package/dist/esm/dom/DomEvent.DoubleTap.js.map +1 -1
- package/dist/esm/dom/DomEvent.PointerEvents.js +2 -16
- package/dist/esm/dom/DomEvent.PointerEvents.js.map +1 -1
- package/dist/esm/dom/DomEvent.js +8 -42
- package/dist/esm/dom/DomEvent.js.map +1 -1
- package/dist/esm/dom/DomUtil.js +14 -68
- package/dist/esm/dom/DomUtil.js.map +1 -1
- package/dist/esm/dom/Draggable.js +17 -18
- package/dist/esm/dom/Draggable.js.map +1 -1
- package/dist/esm/dom/PosAnimation.js +3 -25
- package/dist/esm/dom/PosAnimation.js.map +1 -1
- package/dist/esm/geo/LatLng.js +15 -5
- package/dist/esm/geo/LatLng.js.map +1 -1
- package/dist/esm/geo/crs/EPSG3395.js +1 -1
- package/dist/esm/geo/crs/EPSG3395.js.map +1 -1
- package/dist/esm/geo/crs/EPSG3857.js +1 -1
- package/dist/esm/geo/crs/EPSG3857.js.map +1 -1
- package/dist/esm/geo/crs/EPSG4326.js +1 -1
- package/dist/esm/geo/crs/EPSG4326.js.map +1 -1
- package/dist/esm/geo/crs/EarthCRS.js +2 -2
- package/dist/esm/geo/crs/EarthCRS.js.map +1 -1
- package/dist/esm/geo/crs/SimpleCRS.js +1 -1
- package/dist/esm/geo/crs/SimpleCRS.js.map +1 -1
- package/dist/esm/geo/projection/Projection.LonLat.js +1 -1
- package/dist/esm/geo/projection/Projection.LonLat.js.map +1 -1
- package/dist/esm/geo/projection/Projection.Mercator.js +1 -1
- package/dist/esm/geo/projection/Projection.Mercator.js.map +1 -1
- package/dist/esm/geo/projection/Projection.SphericalMercator.js +1 -1
- package/dist/esm/geo/projection/Projection.SphericalMercator.js.map +1 -1
- package/dist/esm/geometry/LineUtil.js +36 -30
- package/dist/esm/geometry/LineUtil.js.map +1 -1
- package/dist/esm/geometry/PolyUtil.js +8 -27
- package/dist/esm/geometry/PolyUtil.js.map +1 -1
- package/dist/esm/layer/BlanketOverlay.js +6 -8
- package/dist/esm/layer/BlanketOverlay.js.map +1 -1
- package/dist/esm/layer/DivOverlay.js +15 -20
- package/dist/esm/layer/DivOverlay.js.map +1 -1
- package/dist/esm/layer/GeoJSON.js +9 -145
- package/dist/esm/layer/GeoJSON.js.map +1 -1
- package/dist/esm/layer/GeoJSONUtil.js +75 -0
- package/dist/esm/layer/GeoJSONUtil.js.map +1 -0
- package/dist/esm/layer/HeatLayer.js +15 -17
- package/dist/esm/layer/HeatLayer.js.map +1 -1
- package/dist/esm/layer/ImageOverlay.js +20 -26
- package/dist/esm/layer/ImageOverlay.js.map +1 -1
- package/dist/esm/layer/Layer.js +8 -10
- package/dist/esm/layer/Layer.js.map +1 -1
- package/dist/esm/layer/LayerGroup.js +51 -0
- package/dist/esm/layer/LayerGroup.js.map +1 -1
- package/dist/esm/layer/Popup.js +26 -42
- package/dist/esm/layer/Popup.js.map +1 -1
- package/dist/esm/layer/SVGOverlay.js +2 -5
- package/dist/esm/layer/SVGOverlay.js.map +1 -1
- package/dist/esm/layer/Tooltip.js +15 -17
- package/dist/esm/layer/Tooltip.js.map +1 -1
- package/dist/esm/layer/VideoOverlay.js +12 -15
- package/dist/esm/layer/VideoOverlay.js.map +1 -1
- package/dist/esm/layer/marker/DefaultIcon.js +15 -48
- package/dist/esm/layer/marker/DefaultIcon.js.map +1 -1
- package/dist/esm/layer/marker/DivIcon.js +7 -9
- package/dist/esm/layer/marker/DivIcon.js.map +1 -1
- package/dist/esm/layer/marker/Icon.js +7 -10
- package/dist/esm/layer/marker/Icon.js.map +1 -1
- package/dist/esm/layer/marker/Marker.Drag.js +1 -1
- package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
- package/dist/esm/layer/marker/Marker.Move.js +1 -2
- package/dist/esm/layer/marker/Marker.Move.js.map +1 -1
- package/dist/esm/layer/marker/Marker.js +61 -33
- package/dist/esm/layer/marker/Marker.js.map +1 -1
- package/dist/esm/layer/marker/MarkerClusterGroup.js +302 -0
- package/dist/esm/layer/marker/MarkerClusterGroup.js.map +1 -0
- package/dist/esm/layer/marker/SvgIcon.js +6 -8
- package/dist/esm/layer/marker/SvgIcon.js.map +1 -1
- package/dist/esm/layer/tile/GridLayer.js +85 -97
- package/dist/esm/layer/tile/GridLayer.js.map +1 -1
- package/dist/esm/layer/tile/TileLayer.js +28 -36
- package/dist/esm/layer/tile/TileLayer.js.map +1 -1
- package/dist/esm/layer/tile/WMSTileLayer.js +28 -23
- package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
- package/dist/esm/layer/vector/Canvas.js +1 -3
- package/dist/esm/layer/vector/Canvas.js.map +1 -1
- package/dist/esm/layer/vector/Circle.js +2 -2
- package/dist/esm/layer/vector/Circle.js.map +1 -1
- package/dist/esm/layer/vector/CircleMarker.js +17 -7
- package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
- package/dist/esm/layer/vector/Path.DashAnimation.js +2 -3
- package/dist/esm/layer/vector/Path.DashAnimation.js.map +1 -1
- package/dist/esm/layer/vector/Path.js +27 -20
- package/dist/esm/layer/vector/Path.js.map +1 -1
- package/dist/esm/layer/vector/Polygon.js +20 -4
- package/dist/esm/layer/vector/Polygon.js.map +1 -1
- package/dist/esm/layer/vector/Polyline.Decorations.js +2 -2
- package/dist/esm/layer/vector/Polyline.js +23 -7
- package/dist/esm/layer/vector/Polyline.js.map +1 -1
- package/dist/esm/layer/vector/Renderer.getRenderer.js +14 -13
- package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
- package/dist/esm/layer/vector/SVG.js +5 -5
- package/dist/esm/layer/vector/SVG.js.map +1 -1
- package/dist/esm/map/Map.Rotation.js +10 -6
- package/dist/esm/map/Map.Rotation.js.map +1 -1
- package/dist/esm/map/Map.js +116 -110
- package/dist/esm/map/Map.js.map +1 -1
- package/dist/esm/map/handler/BoxZoomHandler.js +5 -7
- package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/DisplaceHandler.js +6 -8
- package/dist/esm/map/handler/DisplaceHandler.js.map +1 -1
- package/dist/esm/map/handler/DragHandler.js +19 -19
- package/dist/esm/map/handler/DragHandler.js.map +1 -1
- package/dist/esm/map/handler/KeyboardHandler.js +35 -35
- package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
- package/dist/esm/map/handler/PinchZoomHandler.js +12 -3
- package/dist/esm/map/handler/PinchZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js +3 -4
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/TapHoldHandler.js +12 -5
- package/dist/esm/map/handler/TapHoldHandler.js.map +1 -1
- package/dist/esm/package.js +1 -1
- package/dist/maplair-global-src.js +8009 -7369
- package/dist/maplair-global-src.js.map +1 -1
- package/dist/maplair-global.js +2 -2
- package/dist/maplair-global.js.map +1 -1
- package/dist/maplair-src.js +10040 -9381
- package/dist/maplair-src.js.map +1 -1
- package/dist/maplair.css +148 -98
- package/dist/maplair.js +2 -2
- package/dist/maplair.js.map +1 -1
- package/i18n/cs.json +6 -0
- package/i18n/de.json +6 -0
- package/i18n/en.json +6 -0
- package/i18n/es.json +6 -0
- package/i18n/fr.json +6 -0
- package/i18n/hu.json +6 -0
- package/i18n/it.json +6 -0
- package/i18n/rm.json +6 -0
- package/i18n/sk.json +6 -0
- package/i18n/sl.json +6 -0
- package/package.json +9 -11
- package/src/control/AttributionControl.js +25 -18
- package/src/control/ButtonControl.js +9 -11
- package/src/control/ContextMenu.js +3 -5
- package/src/control/Control.js +9 -19
- package/src/control/FullscreenControl.js +5 -7
- package/src/control/LayersControl.js +159 -36
- package/src/control/LegendControl.js +7 -9
- package/src/control/MiniMapControl.js +9 -11
- package/src/control/RotateControl.js +3 -5
- package/src/control/ScaleControl.js +7 -9
- package/src/control/SearchControl.js +102 -19
- package/src/control/SideBySideControl.js +3 -5
- package/src/control/TextControl.js +5 -7
- package/src/control/TimeControl.js +471 -0
- package/src/control/ZoomControl.js +5 -7
- package/src/control/index.js +1 -0
- package/src/core/Class.js +35 -34
- package/src/core/Events.js +22 -3
- package/src/core/Handler.js +14 -12
- package/src/core/Util.js +19 -1
- package/src/core/index.js +0 -1
- package/src/dom/DomEvent.DoubleTap.js +18 -10
- package/src/dom/DomEvent.PointerEvents.js +3 -26
- package/src/dom/DomEvent.js +8 -66
- package/src/dom/DomUtil.js +22 -78
- package/src/dom/Draggable.js +27 -22
- package/src/dom/PosAnimation.js +3 -25
- package/src/dom/index.js +0 -1
- package/src/geo/LatLng.js +20 -3
- package/src/geo/crs/EPSG3395.js +1 -1
- package/src/geo/crs/EPSG3857.js +1 -1
- package/src/geo/crs/EPSG4326.js +1 -1
- package/src/geo/crs/EarthCRS.js +2 -8
- package/src/geo/crs/SimpleCRS.js +1 -1
- package/src/geo/projection/Projection.LonLat.js +1 -1
- package/src/geo/projection/Projection.Mercator.js +1 -1
- package/src/geo/projection/Projection.SphericalMercator.js +1 -1
- package/src/geometry/LineUtil.js +47 -48
- package/src/geometry/PolyUtil.js +14 -43
- package/src/layer/BlanketOverlay.js +6 -10
- package/src/layer/DivOverlay.js +15 -26
- package/src/layer/GeoJSON.js +7 -205
- package/src/layer/GeoJSONUtil.js +85 -0
- package/src/layer/HeatLayer.js +9 -11
- package/src/layer/ImageOverlay.js +19 -30
- package/src/layer/Layer.js +8 -10
- package/src/layer/LayerGroup.js +71 -0
- package/src/layer/Popup.js +28 -43
- package/src/layer/SVGOverlay.js +1 -5
- package/src/layer/Tooltip.js +15 -19
- package/src/layer/VideoOverlay.js +12 -15
- package/src/layer/marker/DefaultIcon.js +15 -61
- package/src/layer/marker/DivIcon.js +9 -11
- package/src/layer/marker/Icon.js +7 -10
- package/src/layer/marker/Marker.Drag.js +1 -1
- package/src/layer/marker/Marker.Move.js +1 -2
- package/src/layer/marker/Marker.js +81 -39
- package/src/layer/marker/MarkerClusterGroup.js +370 -0
- package/src/layer/marker/SvgIcon.js +7 -9
- package/src/layer/marker/index.js +1 -0
- package/src/layer/tile/GridLayer.js +103 -133
- package/src/layer/tile/TileLayer.js +35 -43
- package/src/layer/tile/WMSTileLayer.js +26 -24
- package/src/layer/vector/Canvas.js +3 -5
- package/src/layer/vector/Circle.js +5 -2
- package/src/layer/vector/CircleMarker.js +17 -6
- package/src/layer/vector/Path.DashAnimation.js +1 -2
- package/src/layer/vector/Path.js +30 -21
- package/src/layer/vector/Polygon.js +28 -5
- package/src/layer/vector/Polyline.js +25 -6
- package/src/layer/vector/Renderer.getRenderer.js +17 -17
- package/src/layer/vector/SVG.js +5 -5
- package/src/map/Map.Rotation.js +12 -4
- package/src/map/Map.js +142 -133
- package/src/map/handler/BoxZoomHandler.js +9 -8
- package/src/map/handler/DisplaceHandler.js +6 -8
- package/src/map/handler/DragHandler.js +25 -28
- package/src/map/handler/KeyboardHandler.js +42 -48
- package/src/map/handler/PinchZoomHandler.js +16 -5
- package/src/map/handler/ScrollWheelZoomHandler.js +6 -4
- package/src/map/handler/TapHoldHandler.js +15 -4
- package/src/map/index.js +1 -1
- package/src/maplair.css +148 -98
- package/dist/esm/core/Browser.js +0 -100
- package/dist/esm/core/Browser.js.map +0 -1
- package/dist/images/layers.svg +0 -1
- package/dist/images/marker-icon.svg +0 -1
- package/dist/images/marker-shadow.svg +0 -1
- package/src/core/Browser.js +0 -110
- package/src/images/layers.svg +0 -1
- package/src/images/marker-icon.svg +0 -1
- package/src/images/marker-shadow.svg +0 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { Point } from "../../geometry/Point.js";
|
|
2
|
+
import { I18n } from "../../core/I18n.js";
|
|
3
|
+
import { LatLngBounds } from "../../geo/LatLngBounds.js";
|
|
4
|
+
import { LatLng } from "../../geo/LatLng.js";
|
|
5
|
+
import { FeatureGroup } from "../FeatureGroup.js";
|
|
6
|
+
import { Polyline } from "../vector/Polyline.js";
|
|
7
|
+
import { Marker } from "./Marker.js";
|
|
8
|
+
import { DivIcon } from "./DivIcon.js";
|
|
9
|
+
//#region src/layer/marker/MarkerClusterGroup.js
|
|
10
|
+
/** @import {Layer, LayerOptions} from '../Layer.js' */
|
|
11
|
+
/** @import {MaplairEvent} from '../../core/Events.js' */
|
|
12
|
+
/**
|
|
13
|
+
* A cluster of markers, see `MarkerClusterGroup`.
|
|
14
|
+
* @typedef {object} MarkerCluster
|
|
15
|
+
* @property {LatLng} latlng The position of the cluster marker: the mean of the
|
|
16
|
+
* positions of its markers.
|
|
17
|
+
* @property {LatLngBounds} bounds The bounds of its markers.
|
|
18
|
+
* @property {Layer[]} markers Its markers.
|
|
19
|
+
* @property {number} count The number of its markers.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The event object of `clusterclick`.
|
|
23
|
+
* @typedef {object} ClusterClickEvent
|
|
24
|
+
* @property {MarkerCluster} cluster The clicked cluster.
|
|
25
|
+
* @property {Marker} layer The marker of the cluster.
|
|
26
|
+
* @property {Event} originalEvent The DOM event of the click.
|
|
27
|
+
* @extends MaplairEvent
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Options of `MarkerClusterGroup`.
|
|
31
|
+
* @typedef {object} MarkerClusterGroupOptions
|
|
32
|
+
* @property {number} [maxClusterRadius=80] The maximum distance in pixels between the
|
|
33
|
+
* first marker of a cluster and the other ones.
|
|
34
|
+
* @property {number} [disableClusteringAtZoom] From this zoom level on, the markers are
|
|
35
|
+
* shown without clustering.
|
|
36
|
+
* @property {boolean} [zoomToBoundsOnClick=true] Whether a click on a cluster zooms to
|
|
37
|
+
* the bounds of its markers.
|
|
38
|
+
* @property {boolean} [spiderfyOnMaxZoom=true] Whether a click on a cluster which
|
|
39
|
+
* zooming in doesn't split (e.g. markers at the same position, or at the maximum
|
|
40
|
+
* zoom) spreads its markers in a circle around it ("spiderfies" them). Until the next
|
|
41
|
+
* click on the map, change of the zoom or of the layers, their `getLatLng()` returns
|
|
42
|
+
* the spread positions. Clusters can also be activated with the <kbd>Enter</kbd> key.
|
|
43
|
+
* @property {(cluster: MarkerCluster) => DivIcon} [iconCreateFunction] Returns the icon
|
|
44
|
+
* of a cluster, by default a circle with the count, sized and colored by the
|
|
45
|
+
* `maplair-cluster-small`, `-medium` and `-large` CSS classes (for up to 9, 99 and
|
|
46
|
+
* more markers).
|
|
47
|
+
* @extends LayerOptions
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* A layer group clustering its markers: nearby markers are shown as one marker with
|
|
51
|
+
* their count, which zooms in to them when clicked. The clusters are computed for
|
|
52
|
+
* the zoom level of the map, and only the ones near the view are on the map, so
|
|
53
|
+
* that tens of thousands of markers stay fast. Accepts all layers with a single
|
|
54
|
+
* position (`getLatLng()`), e.g. markers and circle markers; other layers are shown
|
|
55
|
+
* without clustering. Events of the markers (e.g. `click`) propagate to the group.
|
|
56
|
+
*
|
|
57
|
+
* Replaces the [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster)
|
|
58
|
+
* plugin for the common use cases, with its option names; without animations and
|
|
59
|
+
* cluster coverage polygons.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```js
|
|
63
|
+
* const clusters = new MarkerClusterGroup();
|
|
64
|
+
* for (const [lat, lng, name] of places) {
|
|
65
|
+
* clusters.addLayer(new Marker([lat, lng]).bindPopup(name));
|
|
66
|
+
* }
|
|
67
|
+
* map.addLayer(clusters);
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @fires MarkerClusterGroup#clusterclick {ClusterClickEvent} Fired when a cluster is
|
|
71
|
+
* clicked.
|
|
72
|
+
*/
|
|
73
|
+
var MarkerClusterGroup = class MarkerClusterGroup extends FeatureGroup {
|
|
74
|
+
static defaultOptions = {
|
|
75
|
+
maxClusterRadius: 80,
|
|
76
|
+
disableClusteringAtZoom: void 0,
|
|
77
|
+
zoomToBoundsOnClick: true,
|
|
78
|
+
spiderfyOnMaxZoom: true,
|
|
79
|
+
iconCreateFunction: void 0
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Creates a cluster group with the given layers.
|
|
83
|
+
* @param {Layer[]} [layers]
|
|
84
|
+
* @param {MarkerClusterGroupOptions} [options]
|
|
85
|
+
*/
|
|
86
|
+
constructor(layers, options) {
|
|
87
|
+
super(layers, options);
|
|
88
|
+
this._shown = /* @__PURE__ */ new Set();
|
|
89
|
+
this.callInitHooks(MarkerClusterGroup);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Adds the given layer to the group.
|
|
93
|
+
* @param {Layer} layer
|
|
94
|
+
* @returns {this}
|
|
95
|
+
*/
|
|
96
|
+
addLayer(layer) {
|
|
97
|
+
return this.addLayers([layer]);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Adds the given layers to the group, clustering once instead of for each layer.
|
|
101
|
+
* @param {Layer[]} layers
|
|
102
|
+
* @returns {this}
|
|
103
|
+
*/
|
|
104
|
+
addLayers(layers) {
|
|
105
|
+
for (const layer of layers) if (!this.hasLayer(layer)) {
|
|
106
|
+
layer.addEventParent(this).on("dragend", this._onDragEnd, this);
|
|
107
|
+
this._layers[this.getLayerId(layer)] = layer;
|
|
108
|
+
this.fire("layeradd", { layer });
|
|
109
|
+
}
|
|
110
|
+
return this.refreshClusters();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Removes the given layer from the group.
|
|
114
|
+
* @param {Layer|number} layer The layer or its id.
|
|
115
|
+
* @returns {this}
|
|
116
|
+
*/
|
|
117
|
+
removeLayer(layer) {
|
|
118
|
+
layer = typeof layer === "number" ? this._layers[layer] : layer;
|
|
119
|
+
if (!layer || !this.hasLayer(layer)) return this;
|
|
120
|
+
this._unspiderfy();
|
|
121
|
+
layer.removeEventParent(this).off("dragend", this._onDragEnd, this);
|
|
122
|
+
delete this._layers[this.getLayerId(layer)];
|
|
123
|
+
if (this._shown?.delete(layer)) this._map.removeLayer(layer);
|
|
124
|
+
this.fire("layerremove", { layer });
|
|
125
|
+
return this.refreshClusters();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Removes all layers from the group.
|
|
129
|
+
* @returns {this}
|
|
130
|
+
*/
|
|
131
|
+
clearLayers() {
|
|
132
|
+
this._unspiderfy();
|
|
133
|
+
for (const layer of this.getLayers()) {
|
|
134
|
+
layer.removeEventParent(this).off("dragend", this._onDragEnd, this);
|
|
135
|
+
this.fire("layerremove", { layer });
|
|
136
|
+
}
|
|
137
|
+
this._layers = {};
|
|
138
|
+
return this.refreshClusters();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Computes the clusters again, e.g. after markers of the group were moved with
|
|
142
|
+
* `setLatLng()`. Happens by itself when the zoom changes or layers are added or
|
|
143
|
+
* removed.
|
|
144
|
+
* @returns {this}
|
|
145
|
+
*/
|
|
146
|
+
refreshClusters() {
|
|
147
|
+
this._clusters = null;
|
|
148
|
+
if (this._map) this._update();
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
onAdd() {
|
|
152
|
+
this._clusters = null;
|
|
153
|
+
this._update();
|
|
154
|
+
}
|
|
155
|
+
onRemove(map) {
|
|
156
|
+
this._unspiderfy();
|
|
157
|
+
for (const layer of this._shown) map.removeLayer(layer);
|
|
158
|
+
this._shown.clear();
|
|
159
|
+
}
|
|
160
|
+
getEvents() {
|
|
161
|
+
return {
|
|
162
|
+
moveend: this._update,
|
|
163
|
+
zoomstart: this._unspiderfy,
|
|
164
|
+
click: this._unspiderfy
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
_onDragEnd({ target: marker }) {
|
|
168
|
+
if (marker._clusterLatLng) marker._clusterLatLng = marker.getLatLng();
|
|
169
|
+
this.refreshClusters();
|
|
170
|
+
}
|
|
171
|
+
_update() {
|
|
172
|
+
const map = this._map, zoom = map.getZoom();
|
|
173
|
+
if (!this._clusters || this._clustersZoom !== zoom) {
|
|
174
|
+
this._unspiderfy();
|
|
175
|
+
this._clusters = this._cluster();
|
|
176
|
+
this._clustersZoom = zoom;
|
|
177
|
+
}
|
|
178
|
+
const view = map.getPixelBounds().pad(.5), shown = /* @__PURE__ */ new Set();
|
|
179
|
+
for (const cluster of this._clusters) {
|
|
180
|
+
const { markers, point } = cluster;
|
|
181
|
+
if (markers.length > 1) {
|
|
182
|
+
if (view.contains(point)) {
|
|
183
|
+
cluster.marker ??= this._createClusterMarker(cluster);
|
|
184
|
+
shown.add(cluster.marker);
|
|
185
|
+
}
|
|
186
|
+
} else if (!markers[0].getLatLng || view.contains(point)) shown.add(markers[0]);
|
|
187
|
+
}
|
|
188
|
+
const spiderfied = this._spider?.clusterMarker;
|
|
189
|
+
for (const layer of this._shown) if (!shown.has(layer)) map.removeLayer(layer);
|
|
190
|
+
for (const layer of shown) if (layer !== spiderfied) map.addLayer(layer);
|
|
191
|
+
this._shown = shown;
|
|
192
|
+
}
|
|
193
|
+
_cluster() {
|
|
194
|
+
const map = this._map, zoom = map.getZoom(), radius = this.options.maxClusterRadius, noClustering = zoom >= (this.options.disableClusteringAtZoom ?? Infinity), grid = /* @__PURE__ */ new Map(), clusters = [];
|
|
195
|
+
for (const layer of Object.values(this._layers)) {
|
|
196
|
+
if (!layer.getLatLng) {
|
|
197
|
+
clusters.push({ markers: [layer] });
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const point = map.project(layer.getLatLng(), zoom), x = Math.floor(point.x / radius), y = Math.floor(point.y / radius);
|
|
201
|
+
let nearest, minDistance = radius;
|
|
202
|
+
for (let i = x - 1; i <= x + 1; i++) for (let j = y - 1; j <= y + 1; j++) for (const cluster of noClustering ? [] : grid.get(`${i}:${j}`) ?? []) {
|
|
203
|
+
const distance = cluster.point.distanceTo(point);
|
|
204
|
+
if (distance <= minDistance) {
|
|
205
|
+
nearest = cluster;
|
|
206
|
+
minDistance = distance;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (nearest) nearest.markers.push(layer);
|
|
210
|
+
else {
|
|
211
|
+
const cluster = {
|
|
212
|
+
point,
|
|
213
|
+
markers: [layer]
|
|
214
|
+
}, key = `${x}:${y}`;
|
|
215
|
+
if (!grid.has(key)) grid.set(key, []);
|
|
216
|
+
grid.get(key).push(cluster);
|
|
217
|
+
clusters.push(cluster);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
for (const cluster of clusters) if (cluster.markers.length > 1) {
|
|
221
|
+
const latlngs = cluster.markers.map((marker) => marker.getLatLng());
|
|
222
|
+
cluster.latlng = new LatLng(latlngs.reduce((sum, latlng) => sum + latlng.lat, 0) / latlngs.length, latlngs.reduce((sum, latlng) => sum + latlng.lng, 0) / latlngs.length);
|
|
223
|
+
cluster.point = map.project(cluster.latlng, zoom);
|
|
224
|
+
}
|
|
225
|
+
return clusters;
|
|
226
|
+
}
|
|
227
|
+
_createClusterMarker({ latlng, markers }) {
|
|
228
|
+
const cluster = {
|
|
229
|
+
latlng,
|
|
230
|
+
bounds: new LatLngBounds(markers.map((marker) => marker.getLatLng())),
|
|
231
|
+
markers,
|
|
232
|
+
count: markers.length
|
|
233
|
+
}, icon = this.options.iconCreateFunction?.(cluster) ?? this._createIcon(cluster), marker = new Marker(latlng, {
|
|
234
|
+
icon,
|
|
235
|
+
title: I18n.translate("{count} markers", { count: cluster.count })
|
|
236
|
+
});
|
|
237
|
+
marker.on("click", (e) => this._onClusterClick(cluster, marker, e));
|
|
238
|
+
return marker;
|
|
239
|
+
}
|
|
240
|
+
_createIcon({ count }) {
|
|
241
|
+
const size = count < 10 ? "small" : count < 100 ? "medium" : "large";
|
|
242
|
+
return new DivIcon({
|
|
243
|
+
html: `<span>${count}</span>`,
|
|
244
|
+
className: `maplair-cluster maplair-cluster-${size}`,
|
|
245
|
+
iconSize: {
|
|
246
|
+
small: 32,
|
|
247
|
+
medium: 38,
|
|
248
|
+
large: 44
|
|
249
|
+
}[size]
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
_onClusterClick(cluster, marker, e) {
|
|
253
|
+
this.fire("clusterclick", {
|
|
254
|
+
cluster,
|
|
255
|
+
layer: marker,
|
|
256
|
+
originalEvent: e.originalEvent
|
|
257
|
+
});
|
|
258
|
+
const map = this._map, maxZoom = map.getMaxZoom(), { bounds } = cluster;
|
|
259
|
+
if (map.getZoom() < maxZoom && (this.options.disableClusteringAtZoom <= maxZoom || map.project(bounds.getNorthEast(), maxZoom).distanceTo(map.project(bounds.getSouthWest(), maxZoom)) > this.options.maxClusterRadius)) {
|
|
260
|
+
if (this.options.zoomToBoundsOnClick) map.fitBounds(bounds);
|
|
261
|
+
} else if (this.options.spiderfyOnMaxZoom) this._spiderfy(cluster, marker);
|
|
262
|
+
}
|
|
263
|
+
_spiderfy({ markers }, clusterMarker) {
|
|
264
|
+
this._unspiderfy();
|
|
265
|
+
const map = this._map, center = map.latLngToLayerPoint(clusterMarker.getLatLng()), radius = Math.max(30, markers.length * 30 / (2 * Math.PI)), spider = this._spider = {
|
|
266
|
+
markers,
|
|
267
|
+
clusterMarker,
|
|
268
|
+
legs: []
|
|
269
|
+
};
|
|
270
|
+
map.removeLayer(clusterMarker);
|
|
271
|
+
markers.forEach((marker, i) => {
|
|
272
|
+
const angle = 2 * Math.PI * i / markers.length, latlng = map.layerPointToLatLng(center.add(new Point(Math.cos(angle), Math.sin(angle)).multiplyBy(radius)));
|
|
273
|
+
marker._clusterLatLng = marker.getLatLng();
|
|
274
|
+
marker.setLatLng(latlng);
|
|
275
|
+
const leg = new Polyline([clusterMarker.getLatLng(), latlng], {
|
|
276
|
+
className: "maplair-cluster-leg",
|
|
277
|
+
interactive: false,
|
|
278
|
+
weight: 1.5
|
|
279
|
+
});
|
|
280
|
+
spider.legs.push(leg);
|
|
281
|
+
map.addLayer(leg);
|
|
282
|
+
map.addLayer(marker);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
_unspiderfy() {
|
|
286
|
+
const spider = this._spider;
|
|
287
|
+
if (!spider) return;
|
|
288
|
+
this._spider = null;
|
|
289
|
+
const map = this._map;
|
|
290
|
+
for (const leg of spider.legs) map?.removeLayer(leg);
|
|
291
|
+
for (const marker of spider.markers) {
|
|
292
|
+
map?.removeLayer(marker);
|
|
293
|
+
marker.setLatLng(marker._clusterLatLng);
|
|
294
|
+
delete marker._clusterLatLng;
|
|
295
|
+
}
|
|
296
|
+
if (map && this._shown.has(spider.clusterMarker)) map.addLayer(spider.clusterMarker);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
//#endregion
|
|
300
|
+
export { MarkerClusterGroup };
|
|
301
|
+
|
|
302
|
+
//# sourceMappingURL=MarkerClusterGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkerClusterGroup.js","names":[],"sources":["../../../../src/layer/marker/MarkerClusterGroup.js"],"sourcesContent":["import {FeatureGroup} from '../FeatureGroup.js';\nimport {Marker} from './Marker.js';\nimport {DivIcon} from './DivIcon.js';\nimport {Polyline} from '../vector/Polyline.js';\nimport {LatLng} from '../../geo/LatLng.js';\nimport {LatLngBounds} from '../../geo/LatLngBounds.js';\nimport {Point} from '../../geometry/Point.js';\nimport {I18n} from '../../core/I18n.js';\n/** @import {Layer, LayerOptions} from '../Layer.js' */\n/** @import {MaplairEvent} from '../../core/Events.js' */\n\n/**\n * A cluster of markers, see `MarkerClusterGroup`.\n * @typedef {object} MarkerCluster\n * @property {LatLng} latlng The position of the cluster marker: the mean of the\n * positions of its markers.\n * @property {LatLngBounds} bounds The bounds of its markers.\n * @property {Layer[]} markers Its markers.\n * @property {number} count The number of its markers.\n */\n\n/**\n * The event object of `clusterclick`.\n * @typedef {object} ClusterClickEvent\n * @property {MarkerCluster} cluster The clicked cluster.\n * @property {Marker} layer The marker of the cluster.\n * @property {Event} originalEvent The DOM event of the click.\n * @extends MaplairEvent\n */\n\n/**\n * Options of `MarkerClusterGroup`.\n * @typedef {object} MarkerClusterGroupOptions\n * @property {number} [maxClusterRadius=80] The maximum distance in pixels between the\n * first marker of a cluster and the other ones.\n * @property {number} [disableClusteringAtZoom] From this zoom level on, the markers are\n * shown without clustering.\n * @property {boolean} [zoomToBoundsOnClick=true] Whether a click on a cluster zooms to\n * the bounds of its markers.\n * @property {boolean} [spiderfyOnMaxZoom=true] Whether a click on a cluster which\n * zooming in doesn't split (e.g. markers at the same position, or at the maximum\n * zoom) spreads its markers in a circle around it (\"spiderfies\" them). Until the next\n * click on the map, change of the zoom or of the layers, their `getLatLng()` returns\n * the spread positions. Clusters can also be activated with the <kbd>Enter</kbd> key.\n * @property {(cluster: MarkerCluster) => DivIcon} [iconCreateFunction] Returns the icon\n * of a cluster, by default a circle with the count, sized and colored by the\n * `maplair-cluster-small`, `-medium` and `-large` CSS classes (for up to 9, 99 and\n * more markers).\n * @extends LayerOptions\n */\n\n/**\n * A layer group clustering its markers: nearby markers are shown as one marker with\n * their count, which zooms in to them when clicked. The clusters are computed for\n * the zoom level of the map, and only the ones near the view are on the map, so\n * that tens of thousands of markers stay fast. Accepts all layers with a single\n * position (`getLatLng()`), e.g. markers and circle markers; other layers are shown\n * without clustering. Events of the markers (e.g. `click`) propagate to the group.\n *\n * Replaces the [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster)\n * plugin for the common use cases, with its option names; without animations and\n * cluster coverage polygons.\n *\n * @example\n * ```js\n * const clusters = new MarkerClusterGroup();\n * for (const [lat, lng, name] of places) {\n * \tclusters.addLayer(new Marker([lat, lng]).bindPopup(name));\n * }\n * map.addLayer(clusters);\n * ```\n *\n * @fires MarkerClusterGroup#clusterclick {ClusterClickEvent} Fired when a cluster is\n * clicked.\n */\nexport class MarkerClusterGroup extends FeatureGroup {\n\n\tstatic defaultOptions = {\n\t\tmaxClusterRadius: 80,\n\t\tdisableClusteringAtZoom: undefined,\n\t\tzoomToBoundsOnClick: true,\n\t\tspiderfyOnMaxZoom: true,\n\t\ticonCreateFunction: undefined\n\t};\n\n\t/**\n\t * Creates a cluster group with the given layers.\n\t * @param {Layer[]} [layers]\n\t * @param {MarkerClusterGroupOptions} [options]\n\t */\n\tconstructor(layers, options) {\n\t\tsuper(layers, options);\n\t\t// the layers on the map: cluster markers, and the markers not in a cluster\n\t\tthis._shown = new Set();\n\t\tthis.callInitHooks(MarkerClusterGroup);\n\t}\n\n\t/**\n\t * Adds the given layer to the group.\n\t * @param {Layer} layer\n\t * @returns {this}\n\t */\n\taddLayer(layer) {\n\t\treturn this.addLayers([layer]);\n\t}\n\n\t/**\n\t * Adds the given layers to the group, clustering once instead of for each layer.\n\t * @param {Layer[]} layers\n\t * @returns {this}\n\t */\n\taddLayers(layers) {\n\t\tfor (const layer of layers) {\n\t\t\tif (!this.hasLayer(layer)) {\n\t\t\t\tlayer.addEventParent(this).on('dragend', this._onDragEnd, this);\n\t\t\t\tthis._layers[this.getLayerId(layer)] = layer;\n\t\t\t\tthis.fire('layeradd', {layer});\n\t\t\t}\n\t\t}\n\t\treturn this.refreshClusters();\n\t}\n\n\t/**\n\t * Removes the given layer from the group.\n\t * @param {Layer|number} layer The layer or its id.\n\t * @returns {this}\n\t */\n\tremoveLayer(layer) {\n\t\tlayer = typeof layer === 'number' ? this._layers[layer] : layer;\n\t\tif (!layer || !this.hasLayer(layer)) {\n\t\t\treturn this;\n\t\t}\n\t\tthis._unspiderfy();\n\t\tlayer.removeEventParent(this).off('dragend', this._onDragEnd, this);\n\t\tdelete this._layers[this.getLayerId(layer)];\n\t\tif (this._shown?.delete(layer)) {\n\t\t\tthis._map.removeLayer(layer);\n\t\t}\n\t\tthis.fire('layerremove', {layer});\n\t\treturn this.refreshClusters();\n\t}\n\n\t/**\n\t * Removes all layers from the group.\n\t * @returns {this}\n\t */\n\tclearLayers() {\n\t\tthis._unspiderfy();\n\t\tfor (const layer of this.getLayers()) {\n\t\t\tlayer.removeEventParent(this).off('dragend', this._onDragEnd, this);\n\t\t\tthis.fire('layerremove', {layer});\n\t\t}\n\t\tthis._layers = {};\n\t\treturn this.refreshClusters();\n\t}\n\n\t/**\n\t * Computes the clusters again, e.g. after markers of the group were moved with\n\t * `setLatLng()`. Happens by itself when the zoom changes or layers are added or\n\t * removed.\n\t * @returns {this}\n\t */\n\trefreshClusters() {\n\t\tthis._clusters = null;\n\t\tif (this._map) {\n\t\t\tthis._update();\n\t\t}\n\t\treturn this;\n\t}\n\n\tonAdd() {\n\t\tthis._clusters = null;\n\t\tthis._update();\n\t}\n\n\tonRemove(map) {\n\t\tthis._unspiderfy();\n\t\tfor (const layer of this._shown) {\n\t\t\tmap.removeLayer(layer);\n\t\t}\n\t\tthis._shown.clear();\n\t}\n\n\tgetEvents() {\n\t\treturn {\n\t\t\tmoveend: this._update,\n\t\t\tzoomstart: this._unspiderfy,\n\t\t\tclick: this._unspiderfy\n\t\t};\n\t}\n\n\t// A marker of the group was dragged: keep its new position, also if spiderfied\n\t_onDragEnd({target: marker}) {\n\t\tif (marker._clusterLatLng) {\n\t\t\tmarker._clusterLatLng = marker.getLatLng();\n\t\t}\n\t\tthis.refreshClusters();\n\t}\n\n\t// Shows the clusters and single layers near the view. The clusters are computed for\n\t// each zoom level and when the layers change, not when panning, which keeps the\n\t// cluster markers and spiderfied markers.\n\t_update() {\n\t\tconst map = this._map,\n\t\tzoom = map.getZoom();\n\t\tif (!this._clusters || this._clustersZoom !== zoom) {\n\t\t\tthis._unspiderfy();\n\t\t\tthis._clusters = this._cluster();\n\t\t\tthis._clustersZoom = zoom;\n\t\t}\n\n\t\t// the view and half of it around, in projected pixels\n\t\tconst view = map.getPixelBounds().pad(0.5),\n\t\tshown = new Set();\n\t\tfor (const cluster of this._clusters) {\n\t\t\tconst {markers, point} = cluster;\n\t\t\tif (markers.length > 1) {\n\t\t\t\tif (view.contains(point)) {\n\t\t\t\t\tcluster.marker ??= this._createClusterMarker(cluster);\n\t\t\t\t\tshown.add(cluster.marker);\n\t\t\t\t}\n\t\t\t} else if (!markers[0].getLatLng || view.contains(point)) {\n\t\t\t\tshown.add(markers[0]);\n\t\t\t}\n\t\t}\n\n\t\tconst spiderfied = this._spider?.clusterMarker;\n\t\tfor (const layer of this._shown) {\n\t\t\tif (!shown.has(layer)) {\n\t\t\t\tmap.removeLayer(layer);\n\t\t\t}\n\t\t}\n\t\tfor (const layer of shown) {\n\t\t\tif (layer !== spiderfied) {\n\t\t\t\tmap.addLayer(layer);\n\t\t\t}\n\t\t}\n\t\tthis._shown = shown;\n\t}\n\n\t// Greedy clustering on a grid with cells of the cluster radius: each marker joins the\n\t// nearest cluster whose first marker is within the radius, or starts a new one\n\t_cluster() {\n\t\tconst map = this._map,\n\t\tzoom = map.getZoom(),\n\t\tradius = this.options.maxClusterRadius,\n\t\tnoClustering = zoom >= (this.options.disableClusteringAtZoom ?? Infinity),\n\t\tgrid = new Map(),\n\t\tclusters = [];\n\n\t\tfor (const layer of Object.values(this._layers)) {\n\t\t\tif (!layer.getLatLng) {\n\t\t\t\tclusters.push({markers: [layer]});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst point = map.project(layer.getLatLng(), zoom),\n\t\t\tx = Math.floor(point.x / radius),\n\t\t\ty = Math.floor(point.y / radius);\n\t\t\tlet nearest, minDistance = radius;\n\t\t\tfor (let i = x - 1; i <= x + 1; i++) {\n\t\t\t\tfor (let j = y - 1; j <= y + 1; j++) {\n\t\t\t\t\tfor (const cluster of noClustering ? [] : grid.get(`${i}:${j}`) ?? []) {\n\t\t\t\t\t\tconst distance = cluster.point.distanceTo(point);\n\t\t\t\t\t\tif (distance <= minDistance) {\n\t\t\t\t\t\t\tnearest = cluster;\n\t\t\t\t\t\t\tminDistance = distance;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nearest) {\n\t\t\t\tnearest.markers.push(layer);\n\t\t\t} else {\n\t\t\t\tconst cluster = {point, markers: [layer]},\n\t\t\t\tkey = `${x}:${y}`;\n\t\t\t\tif (!grid.has(key)) {\n\t\t\t\t\tgrid.set(key, []);\n\t\t\t\t}\n\t\t\t\tgrid.get(key).push(cluster);\n\t\t\t\tclusters.push(cluster);\n\t\t\t}\n\t\t}\n\n\t\tfor (const cluster of clusters) {\n\t\t\tif (cluster.markers.length > 1) {\n\t\t\t\tconst latlngs = cluster.markers.map(marker => marker.getLatLng());\n\t\t\t\tcluster.latlng = new LatLng(\n\t\t\t\t\tlatlngs.reduce((sum, latlng) => sum + latlng.lat, 0) / latlngs.length,\n\t\t\t\t\tlatlngs.reduce((sum, latlng) => sum + latlng.lng, 0) / latlngs.length);\n\t\t\t\tcluster.point = map.project(cluster.latlng, zoom);\n\t\t\t}\n\t\t}\n\t\treturn clusters;\n\t}\n\n\t_createClusterMarker({latlng, markers}) {\n\t\tconst cluster = {latlng, bounds: new LatLngBounds(markers.map(marker => marker.getLatLng())), markers, count: markers.length},\n\t\ticon = this.options.iconCreateFunction?.(cluster) ?? this._createIcon(cluster),\n\t\tmarker = new Marker(latlng, {icon, title: I18n.translate('{count} markers', {count: cluster.count})});\n\t\tmarker.on('click', e => this._onClusterClick(cluster, marker, e));\n\t\treturn marker;\n\t}\n\n\t_createIcon({count}) {\n\t\tconst size = count < 10 ? 'small' : count < 100 ? 'medium' : 'large';\n\t\treturn new DivIcon({\n\t\t\thtml: `<span>${count}</span>`,\n\t\t\tclassName: `maplair-cluster maplair-cluster-${size}`,\n\t\t\ticonSize: {small: 32, medium: 38, large: 44}[size]\n\t\t});\n\t}\n\n\t_onClusterClick(cluster, marker, e) {\n\t\tthis.fire('clusterclick', {cluster, layer: marker, originalEvent: e.originalEvent});\n\t\tconst map = this._map,\n\t\tmaxZoom = map.getMaxZoom(),\n\t\t{bounds} = cluster,\n\t\t// zooming in splits the cluster if its markers are farther apart at the maximum zoom\n\t\tsplittable = map.getZoom() < maxZoom && (this.options.disableClusteringAtZoom <= maxZoom ||\n\t\t\tmap.project(bounds.getNorthEast(), maxZoom).distanceTo(map.project(bounds.getSouthWest(), maxZoom)) > this.options.maxClusterRadius);\n\t\tif (splittable) {\n\t\t\tif (this.options.zoomToBoundsOnClick) {\n\t\t\t\tmap.fitBounds(bounds);\n\t\t\t}\n\t\t} else if (this.options.spiderfyOnMaxZoom) {\n\t\t\tthis._spiderfy(cluster, marker);\n\t\t}\n\t}\n\n\t// Spreads the markers of the cluster in a circle around it, with legs to the center\n\t_spiderfy({markers}, clusterMarker) {\n\t\tthis._unspiderfy();\n\t\tconst map = this._map,\n\t\tcenter = map.latLngToLayerPoint(clusterMarker.getLatLng()),\n\t\t// about 30 pixels between the markers\n\t\tradius = Math.max(30, markers.length * 30 / (2 * Math.PI)),\n\t\tspider = this._spider = {markers, clusterMarker, legs: []};\n\n\t\tmap.removeLayer(clusterMarker);\n\t\tmarkers.forEach((marker, i) => {\n\t\t\tconst angle = 2 * Math.PI * i / markers.length,\n\t\t\tlatlng = map.layerPointToLatLng(center.add(new Point(Math.cos(angle), Math.sin(angle)).multiplyBy(radius)));\n\t\t\tmarker._clusterLatLng = marker.getLatLng();\n\t\t\tmarker.setLatLng(latlng);\n\t\t\tconst leg = new Polyline([clusterMarker.getLatLng(), latlng], {className: 'maplair-cluster-leg', interactive: false, weight: 1.5});\n\t\t\tspider.legs.push(leg);\n\t\t\tmap.addLayer(leg);\n\t\t\tmap.addLayer(marker);\n\t\t});\n\t}\n\n\t// Moves the spiderfied markers back and shows their cluster again\n\t_unspiderfy() {\n\t\tconst spider = this._spider;\n\t\tif (!spider) { return; }\n\t\tthis._spider = null;\n\t\tconst map = this._map;\n\t\tfor (const leg of spider.legs) {\n\t\t\tmap?.removeLayer(leg);\n\t\t}\n\t\tfor (const marker of spider.markers) {\n\t\t\tmap?.removeLayer(marker);\n\t\t\tmarker.setLatLng(marker._clusterLatLng);\n\t\t\tdelete marker._clusterLatLng;\n\t\t}\n\t\tif (map && this._shown.has(spider.clusterMarker)) {\n\t\t\tmap.addLayer(spider.clusterMarker);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,IAAa,qBAAb,MAAa,2BAA2B,aAAa;CAEpD,OAAO,iBAA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AAS,OAAO,aAAa;CAEnC;AACD"}
|
|
@@ -46,14 +46,12 @@ function svgElement(name, attributes, parent) {
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
var SvgIcon = class SvgIcon extends DefaultIcon {
|
|
49
|
-
static {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
}
|
|
49
|
+
static defaultOptions = {
|
|
50
|
+
color: "#d4462c",
|
|
51
|
+
glyph: void 0,
|
|
52
|
+
glyphPath: void 0,
|
|
53
|
+
glyphColor: "white"
|
|
54
|
+
};
|
|
57
55
|
/**
|
|
58
56
|
* Creates an `SvgIcon` with the given options.
|
|
59
57
|
* @param {[options?: SvgIconOptions]} args The options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgIcon.js","names":[],"sources":["../../../../src/layer/marker/SvgIcon.js"],"sourcesContent":["import {DefaultIcon} from './DefaultIcon.js';\n/** @import {DefaultIconOptions} from './DefaultIcon.js' */\n\nconst svgNS = 'http://www.w3.org/2000/svg';\n\n// The outline of the marker in a 500×820 view box (see
|
|
1
|
+
{"version":3,"file":"SvgIcon.js","names":[],"sources":["../../../../src/layer/marker/SvgIcon.js"],"sourcesContent":["import {DefaultIcon} from './DefaultIcon.js';\n/** @import {DefaultIconOptions} from './DefaultIcon.js' */\n\nconst svgNS = 'http://www.w3.org/2000/svg';\n\n// The outline of the marker in a 500×820 view box (see the iconUrl of DefaultIcon)\nconst markerPath = 'M416.500 542.096L420.919 533.569L422.024 531.437L424.460 529.996L424.233 527.174L426.670 525.732L426.382 522.881L428.720 521.213L428.075 518.393L429.979 516.125L428.342 513.639L429.080 510.777L426.581 509.207L426.168 506.292L423.266 505.773L421.781 503.221L418.898 503.859L416.511 502.112L414.131 503.870L411.248 503.241L409.766 505.793L406.865 506.302L406.439 509.216L403.933 510.775L404.661 513.641L403.023 516.136L404.935 518.393L404.271 521.204L406.590 522.896L406.299 525.752L408.738 527.189L408.516 530.011L410.956 531.448L412.065 533.578Z',\nmarkerTransform = 'translate(-7889.1 -9807.44)scale(19.5417)',\nleafPath = 'm-90 2030 45-863a95 95 0 0 0-111-98l-859 151 116-320a65 65 0 0 0-20-73l-941-762 212-99a65 65 0 0 0 34-79l-186-572 542 115a65 65 0 0 0 73-38l105-247 423 454a65 65 0 0 0 111-57l-204-1052 327 189a65 65 0 0 0 91-27l332-652 332 652a65 65 0 0 0 91 27l327-189-204 1052a65 65 0 0 0 111 57l423-454 105 247a65 65 0 0 0 73 38l542-115-186 572a65 65 0 0 0 34 79l212 99-941 762a65 65 0 0 0-20 73l116 320-859-151a95 95 0 0 0-111 98l45 863z',\nleafTransform = 'translate(250 258)scale(.068)',\n// The center of the glyph and its size in the view box\nglyphX = 250,\nglyphY = 270,\nglyphSize = 230;\n\nfunction svgElement(name, attributes, parent) {\n\tconst el = document.createElementNS(svgNS, name);\n\tfor (const [key, value] of Object.entries(attributes)) {\n\t\tel.setAttribute(key, value);\n\t}\n\tparent?.appendChild(el);\n\treturn el;\n}\n\n/**\n * Options of `SvgIcon`.\n * @typedef {object} SvgIconOptions\n * @property {string} [color='#d4462c'] The fill color of the marker, any CSS color. The\n * outline is a darker shade of it.\n * @property {string} [glyph] A character or emoji (or short text) shown in the marker\n * instead of the maple leaf.\n * @property {string} [glyphPath] The path data of an SVG glyph in a 24×24 view box (like\n * Material Design Icons), shown in the marker instead of the maple leaf.\n * @property {string} [glyphColor='white'] The color of the glyph or the maple leaf.\n * @extends DefaultIconOptions\n */\n\n/**\n * A marker icon in the shape of the default marker (with its shadow), drawn as\n * inline SVG in any color and with an optional glyph – a character, an emoji or an\n * SVG path (e.g. of an icon set) – instead of the white maple leaf. No image per\n * color is needed, and it stays sharp on any screen.\n *\n * Inspired by the [Leaflet.awesome-markers](https://github.com/lennardv2/Leaflet.awesome-markers),\n * [leaflet-color-markers](https://github.com/pointhi/leaflet-color-markers) and\n * [Leaflet.ExtraMarkers](https://github.com/coryasilva/Leaflet.ExtraMarkers) plugins.\n *\n * @example\n * ```js\n * new Marker([47.27, 11.40], {icon: new SvgIcon({color: '#2a81cb', glyph: 'P'})}).addTo(map);\n * new Marker([47.28, 11.41], {icon: new SvgIcon({color: 'green', glyph: '🚲'})}).addTo(map);\n * // a 24×24 SVG path, e.g. from Material Design Icons\n * new Marker([47.29, 11.42], {icon: new SvgIcon({color: 'purple', glyphPath: 'M12 2L2 22h20z'})}).addTo(map);\n * ```\n */\nexport class SvgIcon extends DefaultIcon {\n\n\tstatic defaultOptions = {\n\t\tcolor: '#d4462c',\n\t\tglyph: undefined,\n\t\tglyphPath: undefined,\n\t\tglyphColor: 'white'\n\t};\n\n\t/**\n\t * Creates an `SvgIcon` with the given options.\n\t * @param {[options?: SvgIconOptions]} args The options.\n\t */\n\tconstructor(...args) {\n\t\tsuper(...args);\n\t\tthis.callInitHooks(SvgIcon);\n\t}\n\n\t/**\n\t * Called internally when the icon has to be shown, returns a `<div>` element with\n\t * the SVG of the marker, styled according to the options.\n\t * @param {HTMLElement} [oldIcon] The current element of the icon, to be reused if possible.\n\t * @returns {HTMLElement}\n\t */\n\tcreateIcon(oldIcon) {\n\t\tconst div = oldIcon?.tagName === 'DIV' ? oldIcon : document.createElement('div'),\n\t\toptions = this.options,\n\t\tsvg = svgElement('svg', {viewBox: '0 0 500 820', width: '100%', height: '100%', 'aria-hidden': 'true'});\n\n\t\tsvgElement('path', {\n\t\t\td: markerPath,\n\t\t\ttransform: markerTransform,\n\t\t\tfill: options.color,\n\t\t\tstroke: `color-mix(in srgb, ${options.color}, black 30%)`,\n\t\t\t'stroke-width': '1.1',\n\t\t\t'stroke-linejoin': 'miter'\n\t\t}, svg);\n\n\t\tif (options.glyphPath) {\n\t\t\tconst scale = glyphSize / 24;\n\t\t\tsvgElement('path', {\n\t\t\t\td: options.glyphPath,\n\t\t\t\tfill: options.glyphColor,\n\t\t\t\ttransform: `translate(${glyphX - glyphSize / 2} ${glyphY - glyphSize / 2})scale(${scale})`\n\t\t\t}, svg);\n\t\t} else if (options.glyph) {\n\t\t\tsvgElement('text', {\n\t\t\t\tx: glyphX,\n\t\t\t\ty: glyphY,\n\t\t\t\tfill: options.glyphColor,\n\t\t\t\t'font-size': glyphSize,\n\t\t\t\t'font-family': 'sans-serif',\n\t\t\t\t'font-weight': 'bold',\n\t\t\t\t'text-anchor': 'middle',\n\t\t\t\t'dominant-baseline': 'central'\n\t\t\t}, svg).textContent = options.glyph;\n\t\t} else {\n\t\t\tsvgElement('path', {d: leafPath, transform: leafTransform, fill: options.glyphColor}, svg);\n\t\t}\n\n\t\tdiv.replaceChildren(svg);\n\t\tthis._setIconStyles(div, 'icon');\n\t\treturn div;\n\t}\n}\n"],"mappings":";;;AAGA,MAAM,QAAQ;AAGd,MAAM,aAAa;AACnB,MAAA,kBAAkB;AAClB,MAAA,WAAW;AACX,MAAA,gBAAgB;AAEhB,MAAA,SAAS;AACT,MAAA,SAAS;AACT,MAAA,YAAY;AAEZ,SAAS,WAAW,MAAM,YAAY,QAAQ;CAC7C,MAAM,KAAK,SAAS,gBAAgB,OAAO,IAAI;CAC/C,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GACnD,GAAG,aAAa,KAAK,KAAK;CAE3B,QAAQ,YAAY,EAAE;CACtB,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,UAAb,MAAa,gBAAgB,YAAY;CAExC,OAAO,iBAAiB;EACvB,OAAO;EACP,OAAO,KAAA;EACP,WAAW,KAAA;EACX,YAAY;CACb;;;;;CAMA,YAAY,GAAG,MAAM;EACpB,MAAM,GAAG,IAAI;EACb,KAAK,cAAc,OAAO;CAC3B;;;;;;;CAQA,WAAW,SAAS;EACnB,MAAM,MAAM,SAAS,YAAY,QAAQ,UAAU,SAAS,cAAc,KAAK,GAC/E,UAAU,KAAK,SACf,MAAM,WAAW,OAAO;GAAC,SAAS;GAAe,OAAO;GAAQ,QAAQ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