maplair 4.0.0 → 4.2.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 +178 -0
- package/dist/esm/Maplair.js +18 -17
- package/dist/esm/Maplair.js.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.js +1 -2
- package/dist/esm/control/AttributionControl.js +25 -16
- package/dist/esm/control/AttributionControl.js.map +1 -1
- package/dist/esm/control/ButtonControl.js +10 -13
- package/dist/esm/control/ButtonControl.js.map +1 -1
- package/dist/esm/control/ContextMenu.js +2 -5
- package/dist/esm/control/ContextMenu.js.map +1 -1
- package/dist/esm/control/Control.js +10 -18
- package/dist/esm/control/Control.js.map +1 -1
- package/dist/esm/control/FullscreenControl.js +6 -9
- package/dist/esm/control/FullscreenControl.js.map +1 -1
- package/dist/esm/control/LayersControl.js +170 -65
- package/dist/esm/control/LayersControl.js.map +1 -1
- package/dist/esm/control/LegendControl.js +8 -11
- package/dist/esm/control/LegendControl.js.map +1 -1
- package/dist/esm/control/MiniMapControl.js +15 -18
- package/dist/esm/control/MiniMapControl.js.map +1 -1
- package/dist/esm/control/RotateControl.js +2 -5
- package/dist/esm/control/RotateControl.js.map +1 -1
- package/dist/esm/control/ScaleControl.js +8 -11
- package/dist/esm/control/ScaleControl.js.map +1 -1
- package/dist/esm/control/SearchControl.js +100 -19
- package/dist/esm/control/SearchControl.js.map +1 -1
- package/dist/esm/control/SideBySideControl.js +2 -5
- package/dist/esm/control/SideBySideControl.js.map +1 -1
- package/dist/esm/control/TextControl.js +6 -9
- package/dist/esm/control/TextControl.js.map +1 -1
- package/dist/esm/control/TimeControl.js +407 -0
- package/dist/esm/control/TimeControl.js.map +1 -0
- package/dist/esm/control/ZoomControl.js +23 -36
- package/dist/esm/control/ZoomControl.js.map +1 -1
- package/dist/esm/core/Class.js +28 -44
- package/dist/esm/core/Class.js.map +1 -1
- package/dist/esm/core/Events.js +22 -10
- package/dist/esm/core/Events.js.map +1 -1
- package/dist/esm/core/Handler.js +23 -14
- package/dist/esm/core/Handler.js.map +1 -1
- package/dist/esm/core/I18n.js +1 -2
- package/dist/esm/core/Util.js +15 -4
- package/dist/esm/core/Util.js.map +1 -1
- package/dist/esm/dom/DomEvent.DoubleTap.js +26 -24
- package/dist/esm/dom/DomEvent.DoubleTap.js.map +1 -1
- package/dist/esm/dom/DomEvent.PointerEvents.js +3 -18
- package/dist/esm/dom/DomEvent.PointerEvents.js.map +1 -1
- package/dist/esm/dom/DomEvent.js +18 -60
- package/dist/esm/dom/DomEvent.js.map +1 -1
- package/dist/esm/dom/DomUtil.js +15 -70
- package/dist/esm/dom/DomUtil.js.map +1 -1
- package/dist/esm/dom/Draggable.js +21 -21
- package/dist/esm/dom/Draggable.js.map +1 -1
- package/dist/esm/dom/PosAnimation.js +4 -27
- package/dist/esm/dom/PosAnimation.js.map +1 -1
- package/dist/esm/geo/LatLng.js +16 -7
- package/dist/esm/geo/LatLng.js.map +1 -1
- package/dist/esm/geo/LatLngBounds.js +9 -15
- package/dist/esm/geo/LatLngBounds.js.map +1 -1
- package/dist/esm/geo/crs/CRS.js +1 -2
- package/dist/esm/geo/crs/EPSG3395.js +5 -6
- package/dist/esm/geo/crs/EPSG3395.js.map +1 -1
- package/dist/esm/geo/crs/EPSG3857.js +5 -6
- package/dist/esm/geo/crs/EPSG3857.js.map +1 -1
- package/dist/esm/geo/crs/EPSG4326.js +4 -5
- package/dist/esm/geo/crs/EPSG4326.js.map +1 -1
- package/dist/esm/geo/crs/EarthCRS.js +3 -4
- package/dist/esm/geo/crs/EarthCRS.js.map +1 -1
- package/dist/esm/geo/crs/SimpleCRS.js +4 -5
- package/dist/esm/geo/crs/SimpleCRS.js.map +1 -1
- package/dist/esm/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +5 -6
- package/dist/esm/geo/projection/LonLatProjection.js.map +1 -0
- package/dist/esm/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +4 -5
- package/dist/esm/geo/projection/MercatorProjection.js.map +1 -0
- package/dist/esm/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +5 -6
- package/dist/esm/geo/projection/SphericalMercatorProjection.js.map +1 -0
- package/dist/esm/geometry/Bounds.js +10 -14
- package/dist/esm/geometry/Bounds.js.map +1 -1
- package/dist/esm/geometry/LineUtil.js +37 -32
- package/dist/esm/geometry/LineUtil.js.map +1 -1
- package/dist/esm/geometry/Point.js +1 -2
- package/dist/esm/geometry/PolyUtil.js +24 -51
- package/dist/esm/geometry/PolyUtil.js.map +1 -1
- package/dist/esm/geometry/Transformation.js +1 -2
- package/dist/esm/layer/BlanketOverlay.js +7 -10
- package/dist/esm/layer/BlanketOverlay.js.map +1 -1
- package/dist/esm/layer/Classification.js +1 -2
- package/dist/esm/layer/DivOverlay.js +16 -22
- package/dist/esm/layer/DivOverlay.js.map +1 -1
- package/dist/esm/layer/FeatureGroup.js +5 -4
- package/dist/esm/layer/FeatureGroup.js.map +1 -1
- package/dist/esm/layer/GeoJSON.Load.js +1 -2
- package/dist/esm/layer/GeoJSON.js +17 -155
- package/dist/esm/layer/GeoJSON.js.map +1 -1
- package/dist/esm/layer/GeoJSONUtil.js +74 -0
- package/dist/esm/layer/GeoJSONUtil.js.map +1 -0
- package/dist/esm/layer/HeatLayer.js +17 -20
- package/dist/esm/layer/HeatLayer.js.map +1 -1
- package/dist/esm/layer/ImageOverlay.js +22 -29
- package/dist/esm/layer/ImageOverlay.js.map +1 -1
- package/dist/esm/layer/Layer.js +9 -12
- package/dist/esm/layer/Layer.js.map +1 -1
- package/dist/esm/layer/LayerGroup.js +53 -3
- package/dist/esm/layer/LayerGroup.js.map +1 -1
- package/dist/esm/layer/Popup.js +35 -58
- package/dist/esm/layer/Popup.js.map +1 -1
- package/dist/esm/layer/SVGOverlay.js +3 -7
- package/dist/esm/layer/SVGOverlay.js.map +1 -1
- package/dist/esm/layer/Tooltip.js +31 -34
- package/dist/esm/layer/Tooltip.js.map +1 -1
- package/dist/esm/layer/VideoOverlay.js +13 -17
- package/dist/esm/layer/VideoOverlay.js.map +1 -1
- package/dist/esm/layer/marker/DefaultIcon.js +38 -49
- package/dist/esm/layer/marker/DefaultIcon.js.map +1 -1
- package/dist/esm/layer/marker/DivIcon.js +8 -11
- package/dist/esm/layer/marker/DivIcon.js.map +1 -1
- package/dist/esm/layer/marker/Icon.js +9 -12
- package/dist/esm/layer/marker/Icon.js.map +1 -1
- package/dist/esm/layer/marker/Marker.Drag.js +44 -5
- package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
- package/dist/esm/layer/marker/Marker.Move.js +5 -8
- package/dist/esm/layer/marker/Marker.Move.js.map +1 -1
- package/dist/esm/layer/marker/Marker.js +115 -47
- package/dist/esm/layer/marker/Marker.js.map +1 -1
- package/dist/esm/layer/marker/MarkerClusterGroup.js +301 -0
- package/dist/esm/layer/marker/MarkerClusterGroup.js.map +1 -0
- package/dist/esm/layer/marker/SvgIcon.js +7 -10
- package/dist/esm/layer/marker/SvgIcon.js.map +1 -1
- package/dist/esm/layer/tile/GridLayer.js +89 -101
- package/dist/esm/layer/tile/GridLayer.js.map +1 -1
- package/dist/esm/layer/tile/TileLayer.js +36 -44
- package/dist/esm/layer/tile/TileLayer.js.map +1 -1
- package/dist/esm/layer/tile/WMSTileLayer.js +33 -27
- package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
- package/dist/esm/layer/vector/Canvas.js +8 -17
- package/dist/esm/layer/vector/Canvas.js.map +1 -1
- package/dist/esm/layer/vector/Circle.js +6 -5
- package/dist/esm/layer/vector/Circle.js.map +1 -1
- package/dist/esm/layer/vector/CircleMarker.js +19 -10
- package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
- package/dist/esm/layer/vector/Path.DashAnimation.js +3 -5
- package/dist/esm/layer/vector/Path.DashAnimation.js.map +1 -1
- package/dist/esm/layer/vector/Path.ZoomStyles.js +1 -2
- package/dist/esm/layer/vector/Path.js +28 -22
- package/dist/esm/layer/vector/Path.js.map +1 -1
- package/dist/esm/layer/vector/Polygon.js +22 -7
- package/dist/esm/layer/vector/Polygon.js.map +1 -1
- package/dist/esm/layer/vector/Polyline.Decorations.js +3 -4
- package/dist/esm/layer/vector/Polyline.js +25 -10
- package/dist/esm/layer/vector/Polyline.js.map +1 -1
- package/dist/esm/layer/vector/Rectangle.js +1 -2
- package/dist/esm/layer/vector/Renderer.getRenderer.js +17 -17
- package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
- package/dist/esm/layer/vector/Renderer.js +1 -2
- package/dist/esm/layer/vector/SVG.js +12 -9
- package/dist/esm/layer/vector/SVG.js.map +1 -1
- package/dist/esm/map/Hash.js +1 -2
- package/dist/esm/map/Map.Rotation.js +41 -22
- package/dist/esm/map/Map.Rotation.js.map +1 -1
- package/dist/esm/map/Map.js +125 -126
- package/dist/esm/map/Map.js.map +1 -1
- package/dist/esm/map/MapSync.js +1 -2
- package/dist/esm/map/handler/BoxZoomHandler.js +25 -47
- package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/DisplaceHandler.js +7 -10
- package/dist/esm/map/handler/DisplaceHandler.js.map +1 -1
- package/dist/esm/map/handler/DoubleClickZoomHandler.js +1 -2
- package/dist/esm/map/handler/DragHandler.js +20 -21
- package/dist/esm/map/handler/DragHandler.js.map +1 -1
- package/dist/esm/map/handler/KeyboardHandler.js +48 -68
- package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
- package/dist/esm/map/handler/PinchZoomHandler.js +13 -5
- package/dist/esm/map/handler/PinchZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js +4 -6
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/TapDragZoomHandler.js +1 -2
- package/dist/esm/map/handler/TapHoldHandler.js +13 -7
- package/dist/esm/map/handler/TapHoldHandler.js.map +1 -1
- package/dist/esm/package.js +2 -3
- package/dist/maplair-global-src.js +6495 -5981
- 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 +6206 -5673
- package/dist/maplair-src.js.map +1 -1
- package/dist/maplair.css +1 -1213
- 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 +11 -18
- package/src/Maplair.all.js +0 -1
- 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 +196 -86
- 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 +22 -38
- package/src/control/index.js +1 -0
- package/src/core/Class.js +37 -45
- package/src/core/Events.js +22 -3
- package/src/core/Handler.js +25 -13
- package/src/core/Util.js +20 -2
- 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 +17 -85
- package/src/dom/DomUtil.js +22 -78
- package/src/dom/Draggable.js +32 -23
- package/src/dom/PosAnimation.js +3 -25
- package/src/dom/index.js +0 -1
- package/src/geo/LatLng.js +20 -3
- package/src/geo/LatLngBounds.js +8 -15
- package/src/geo/crs/EPSG3395.js +4 -4
- package/src/geo/crs/EPSG3857.js +4 -4
- package/src/geo/crs/EPSG4326.js +3 -3
- package/src/geo/crs/EarthCRS.js +2 -8
- package/src/geo/crs/SimpleCRS.js +3 -3
- package/src/geo/index.js +1 -2
- package/src/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +2 -2
- package/src/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +2 -2
- package/src/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +2 -2
- package/src/geo/projection/index.js +5 -5
- package/src/geometry/Bounds.js +12 -17
- package/src/geometry/LineUtil.js +48 -49
- package/src/geometry/PolyUtil.js +39 -76
- package/src/layer/BlanketOverlay.js +6 -10
- package/src/layer/DivOverlay.js +16 -27
- package/src/layer/FeatureGroup.js +8 -2
- package/src/layer/GeoJSON.js +17 -218
- package/src/layer/GeoJSONUtil.js +85 -0
- package/src/layer/HeatLayer.js +10 -12
- package/src/layer/ImageOverlay.js +21 -32
- package/src/layer/Layer.js +8 -10
- package/src/layer/LayerGroup.js +72 -1
- package/src/layer/Popup.js +37 -62
- package/src/layer/SVGOverlay.js +1 -5
- package/src/layer/Tooltip.js +34 -36
- package/src/layer/VideoOverlay.js +12 -15
- package/src/layer/marker/DefaultIcon.js +40 -58
- package/src/layer/marker/DivIcon.js +9 -11
- package/src/layer/marker/Icon.js +9 -10
- package/src/layer/marker/Marker.Drag.js +54 -6
- package/src/layer/marker/Marker.Move.js +4 -6
- package/src/layer/marker/Marker.js +145 -52
- 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 +108 -135
- package/src/layer/tile/TileLayer.js +44 -49
- package/src/layer/tile/WMSTileLayer.js +31 -26
- package/src/layer/vector/Canvas.js +13 -19
- package/src/layer/vector/Circle.js +9 -3
- package/src/layer/vector/CircleMarker.js +19 -7
- package/src/layer/vector/Path.DashAnimation.js +1 -2
- package/src/layer/vector/Path.js +30 -21
- package/src/layer/vector/Polygon.js +29 -6
- package/src/layer/vector/Polyline.js +26 -7
- package/src/layer/vector/Renderer.getRenderer.js +20 -19
- package/src/layer/vector/SVG.js +17 -7
- package/src/map/Map.Rotation.js +40 -8
- package/src/map/Map.js +158 -153
- package/src/map/handler/BoxZoomHandler.js +30 -50
- package/src/map/handler/DisplaceHandler.js +6 -8
- package/src/map/handler/DragHandler.js +25 -28
- package/src/map/handler/KeyboardHandler.js +65 -90
- 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 +153 -98
- package/dist/esm/core/Browser.js +0 -100
- package/dist/esm/core/Browser.js.map +0 -1
- package/dist/esm/geo/projection/Projection.LonLat.js.map +0 -1
- package/dist/esm/geo/projection/Projection.Mercator.js.map +0 -1
- package/dist/esm/geo/projection/Projection.SphericalMercator.js.map +0 -1
- package/dist/esm/geo/projection/index.js +0 -14
- package/dist/esm/geo/projection/index.js.map +0 -1
- package/dist/esm/layer/marker/Marker.Rotation.js +0 -70
- package/dist/esm/layer/marker/Marker.Rotation.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
- package/src/layer/marker/Marker.Rotation.js +0 -103
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {Handler} from '../../core/Handler.js';
|
|
2
2
|
import * as DomEvent from '../../dom/DomEvent.js';
|
|
3
3
|
import {Point} from '../../geometry/Point.js';
|
|
4
|
-
import Browser from '../../core/Browser.js';
|
|
5
4
|
import * as PointerEvents from '../../dom/DomEvent.PointerEvents.js';
|
|
6
5
|
/** @import {MaplairMap} from '../Map.js' */
|
|
7
6
|
|
|
@@ -11,8 +10,8 @@ const tapHoldDelay = 600;
|
|
|
11
10
|
* Map options of `TapHoldHandler`, touch interaction options.
|
|
12
11
|
* @typedef {object} TapHoldHandlerMapOptions
|
|
13
12
|
* @lends MaplairMapOptions
|
|
14
|
-
* @property {boolean} [tapHold] Enables simulation of `contextmenu` event
|
|
15
|
-
*
|
|
13
|
+
* @property {boolean} [tapHold=true] Enables simulation of `contextmenu` event on touch
|
|
14
|
+
* and hold.
|
|
16
15
|
* @property {number} [tapTolerance=15] The max number of pixels a user can shift his
|
|
17
16
|
* finger during touch for it to be considered a valid tap.
|
|
18
17
|
*/
|
|
@@ -52,6 +51,7 @@ export class TapHoldHandler extends Handler {
|
|
|
52
51
|
DomEvent.off(this._map._container, 'pointerdown', this._onDown, this);
|
|
53
52
|
this._cancel();
|
|
54
53
|
this._cancelClickPrevent();
|
|
54
|
+
this._stopPreventingNative();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
_onDown(e) {
|
|
@@ -68,6 +68,11 @@ export class TapHoldHandler extends Handler {
|
|
|
68
68
|
DomEvent.on(el, 'pointerup', DomEvent.preventDefault);
|
|
69
69
|
DomEvent.on(el, 'pointerup pointercancel', this._cancelClickPrevent, this);
|
|
70
70
|
this._simulateEvent('contextmenu', e);
|
|
71
|
+
|
|
72
|
+
// browsers that fire a native contextmenu on touch may do it later than us (e.g. Android with a longer
|
|
73
|
+
// touch & hold delay, or Windows on release), so swallow it until the next press
|
|
74
|
+
el.addEventListener('contextmenu', DomEvent.stop, true);
|
|
75
|
+
el.addEventListener('pointerdown', this._stopPreventingNative, true);
|
|
71
76
|
}), tapHoldDelay);
|
|
72
77
|
|
|
73
78
|
DomEvent.on(el, 'pointerup pointercancel contextmenu', this._cancel, this);
|
|
@@ -80,6 +85,12 @@ export class TapHoldHandler extends Handler {
|
|
|
80
85
|
DomEvent.off(el, 'pointerup pointercancel', this._cancelClickPrevent, this);
|
|
81
86
|
};
|
|
82
87
|
|
|
88
|
+
_stopPreventingNative = () => {
|
|
89
|
+
const el = this._map._container;
|
|
90
|
+
el.removeEventListener('contextmenu', DomEvent.stop, true);
|
|
91
|
+
el.removeEventListener('pointerdown', this._stopPreventingNative, true);
|
|
92
|
+
};
|
|
93
|
+
|
|
83
94
|
_cancel() {
|
|
84
95
|
clearTimeout(this._holdTimeout);
|
|
85
96
|
const el = this._map._container;
|
|
@@ -121,7 +132,7 @@ export class TapHoldHandler extends Handler {
|
|
|
121
132
|
*/
|
|
122
133
|
static register(MaplairMap) {
|
|
123
134
|
MaplairMap.mergeOptions({
|
|
124
|
-
tapHold:
|
|
135
|
+
tapHold: true,
|
|
125
136
|
tapTolerance: 15
|
|
126
137
|
});
|
|
127
138
|
|
package/src/map/index.js
CHANGED
package/src/maplair.css
CHANGED
|
@@ -49,8 +49,7 @@
|
|
|
49
49
|
--maplair-spacing-100: 16px;
|
|
50
50
|
|
|
51
51
|
/* sizes */
|
|
52
|
-
--maplair-size-control:
|
|
53
|
-
--maplair-size-control-touch: 30px;
|
|
52
|
+
--maplair-size-control: 30px;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
/* required styles */
|
|
@@ -68,7 +67,11 @@
|
|
|
68
67
|
position: absolute;
|
|
69
68
|
left: 0;
|
|
70
69
|
top: 0;
|
|
71
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* gives popups room to grow to their max-width; not set on icons and layers, which are sized by JS or content */
|
|
73
|
+
.maplair-pane {
|
|
74
|
+
width: 100%;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
/* wraps the map pane of a rotated map, see setBearing() */
|
|
@@ -77,39 +80,39 @@
|
|
|
77
80
|
inset: 0;
|
|
78
81
|
}
|
|
79
82
|
|
|
83
|
+
/* without this, a long press on the map selects the nearest page text on iOS, and a drag leaving the map selects
|
|
84
|
+
page text in Firefox; popups and controls stop pointerdown from reaching the map, so their text stays selectable */
|
|
85
|
+
.maplair-container,
|
|
86
|
+
.maplair-dragging,
|
|
87
|
+
.maplair-control-zoom-in,
|
|
88
|
+
.maplair-control-zoom-out {
|
|
89
|
+
-webkit-user-select: none;
|
|
90
|
+
user-select: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.maplair-popup-pane,
|
|
94
|
+
.maplair-control-container {
|
|
95
|
+
-webkit-user-select: text;
|
|
96
|
+
user-select: text;
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
.maplair-tile,
|
|
81
100
|
.maplair-marker-icon,
|
|
82
101
|
.maplair-marker-shadow {
|
|
83
|
-
user-select: none;
|
|
84
102
|
-webkit-user-drag: none;
|
|
85
103
|
-webkit-touch-callout: none;
|
|
86
104
|
}
|
|
87
105
|
|
|
88
|
-
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
|
89
|
-
|
|
90
|
-
.maplair-safari {
|
|
91
|
-
.maplair-tile {
|
|
92
|
-
image-rendering: -webkit-optimize-contrast;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* hack that prevents hw layers "stretching" when loading new tiles */
|
|
96
|
-
.maplair-tile-container {
|
|
97
|
-
width: 1600px;
|
|
98
|
-
height: 1600px;
|
|
99
|
-
-webkit-transform-origin: 0 0;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
106
|
.maplair-marker-icon,
|
|
104
107
|
.maplair-marker-shadow {
|
|
105
108
|
display: block;
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
/*
|
|
109
|
-
/* .maplair-container img: map is broken in FF if you have max-width: 100% on tiles */
|
|
111
|
+
/* !important to survive host-page resets like `img, svg { max-width: 100% }`, which break the map */
|
|
110
112
|
|
|
111
113
|
.maplair-container {
|
|
112
114
|
overflow: hidden;
|
|
115
|
+
isolation: isolate;
|
|
113
116
|
|
|
114
117
|
.maplair-overlay-pane svg {
|
|
115
118
|
max-width: none !important;
|
|
@@ -130,6 +133,10 @@
|
|
|
130
133
|
img.maplair-tile {
|
|
131
134
|
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
|
|
132
135
|
mix-blend-mode: plus-lighter;
|
|
136
|
+
|
|
137
|
+
&.maplair-tile-fading {
|
|
138
|
+
mix-blend-mode: normal;
|
|
139
|
+
}
|
|
133
140
|
}
|
|
134
141
|
|
|
135
142
|
&.maplair-touch-zoom {
|
|
@@ -137,8 +144,6 @@
|
|
|
137
144
|
}
|
|
138
145
|
|
|
139
146
|
&.maplair-touch-drag {
|
|
140
|
-
/* Fallback for FF which doesn't support pinch-zoom */
|
|
141
|
-
touch-action: none;
|
|
142
147
|
touch-action: pinch-zoom;
|
|
143
148
|
|
|
144
149
|
&.maplair-touch-zoom {
|
|
@@ -300,10 +305,6 @@
|
|
|
300
305
|
.maplair-popup {
|
|
301
306
|
opacity: 0;
|
|
302
307
|
transition: opacity 0.2s linear;
|
|
303
|
-
|
|
304
|
-
@media (prefers-reduced-motion: reduce) {
|
|
305
|
-
transition: none;
|
|
306
|
-
}
|
|
307
308
|
}
|
|
308
309
|
|
|
309
310
|
.maplair-map-pane .maplair-popup {
|
|
@@ -321,14 +322,6 @@
|
|
|
321
322
|
.maplair-zoom-anim {
|
|
322
323
|
.maplair-zoom-animated {
|
|
323
324
|
transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
|
|
324
|
-
|
|
325
|
-
@media (prefers-reduced-motion: reduce) {
|
|
326
|
-
transition: none;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.maplair-tile {
|
|
331
|
-
transition: none;
|
|
332
325
|
}
|
|
333
326
|
|
|
334
327
|
.maplair-zoom-hide {
|
|
@@ -336,10 +329,6 @@
|
|
|
336
329
|
}
|
|
337
330
|
}
|
|
338
331
|
|
|
339
|
-
.maplair-pan-anim .maplair-tile {
|
|
340
|
-
transition: none;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
332
|
/* cursors */
|
|
344
333
|
|
|
345
334
|
.maplair-interactive {
|
|
@@ -364,7 +353,7 @@
|
|
|
364
353
|
}
|
|
365
354
|
|
|
366
355
|
.maplair-dragging {
|
|
367
|
-
|
|
356
|
+
&.maplair-grab {
|
|
368
357
|
cursor: grabbing;
|
|
369
358
|
|
|
370
359
|
.maplair-interactive {
|
|
@@ -424,7 +413,6 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
424
413
|
}
|
|
425
414
|
|
|
426
415
|
.maplair-bar {
|
|
427
|
-
box-shadow: var(--maplair-box-shadow-medium);
|
|
428
416
|
border-radius: var(--maplair-border-radius-base);
|
|
429
417
|
|
|
430
418
|
a,
|
|
@@ -446,13 +434,13 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
446
434
|
}
|
|
447
435
|
|
|
448
436
|
&:first-child {
|
|
449
|
-
border-top-left-radius: var(--maplair-border-radius-
|
|
450
|
-
border-top-right-radius: var(--maplair-border-radius-
|
|
437
|
+
border-top-left-radius: var(--maplair-border-radius-small);
|
|
438
|
+
border-top-right-radius: var(--maplair-border-radius-small);
|
|
451
439
|
}
|
|
452
440
|
|
|
453
441
|
&:last-child {
|
|
454
|
-
border-bottom-left-radius: var(--maplair-border-radius-
|
|
455
|
-
border-bottom-right-radius: var(--maplair-border-radius-
|
|
442
|
+
border-bottom-left-radius: var(--maplair-border-radius-small);
|
|
443
|
+
border-bottom-right-radius: var(--maplair-border-radius-small);
|
|
456
444
|
border-bottom: none;
|
|
457
445
|
}
|
|
458
446
|
|
|
@@ -461,22 +449,6 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
461
449
|
background-color: var(--maplair-background-color-disabled-subtle);
|
|
462
450
|
color: var(--maplair-color-disabled);
|
|
463
451
|
}
|
|
464
|
-
|
|
465
|
-
.maplair-touch & {
|
|
466
|
-
width: var(--maplair-size-control-touch);
|
|
467
|
-
height: var(--maplair-size-control-touch);
|
|
468
|
-
line-height: var(--maplair-size-control-touch);
|
|
469
|
-
|
|
470
|
-
&:first-child {
|
|
471
|
-
border-top-left-radius: var(--maplair-border-radius-small);
|
|
472
|
-
border-top-right-radius: var(--maplair-border-radius-small);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
&:last-child {
|
|
476
|
-
border-bottom-left-radius: var(--maplair-border-radius-small);
|
|
477
|
-
border-bottom-right-radius: var(--maplair-border-radius-small);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
452
|
}
|
|
481
453
|
}
|
|
482
454
|
|
|
@@ -498,18 +470,14 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
498
470
|
|
|
499
471
|
.maplair-control-zoom-in,
|
|
500
472
|
.maplair-control-zoom-out {
|
|
501
|
-
font: bold var(--maplair-font-size-large) var(--maplair-font-family-monospace);
|
|
473
|
+
font: bold var(--maplair-font-size-x-large) var(--maplair-font-family-monospace);
|
|
502
474
|
text-indent: 1px;
|
|
503
|
-
.maplair-touch & {
|
|
504
|
-
font-size: var(--maplair-font-size-x-large);
|
|
505
|
-
}
|
|
506
475
|
}
|
|
507
476
|
|
|
508
477
|
|
|
509
478
|
/* layers control */
|
|
510
479
|
|
|
511
480
|
.maplair-control-layers {
|
|
512
|
-
box-shadow: var(--maplair-box-shadow-medium);
|
|
513
481
|
background: var(--maplair-background-color-base);
|
|
514
482
|
border-radius: var(--maplair-border-radius-base);
|
|
515
483
|
|
|
@@ -525,7 +493,7 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
525
493
|
|
|
526
494
|
.maplair-control-layers-toggle {
|
|
527
495
|
display: block;
|
|
528
|
-
background-image: url(
|
|
496
|
+
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26'><path fill='%23b9b9b9' d='m.032 17.056 13-8 13 8-13 8z'/><path fill='%23737373' d='m.032 17.056-.032.93 13 8 13-8 .032-.93-13 8z'/><path fill='%23cdcdcd' d='m0 13.076 13-8 13 8-13 8z'/><path fill='%23737373' d='M0 13.076v.91l13 8 13-8v-.91l-13 8z'/><path fill='%23e9e9e9' fill-opacity='.585' stroke='%23797979' stroke-width='.1' d='m0 8.986 13-8 13 8-13 8-13-8'/><path fill='%23737373' d='M0 8.986v1l13 8 13-8v-1l-13 8z'/></svg>");
|
|
529
497
|
background-position: 50% 50%;
|
|
530
498
|
background-repeat: no-repeat;
|
|
531
499
|
/* reset the user agent styles of buttons */
|
|
@@ -533,12 +501,15 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
533
501
|
padding: 0;
|
|
534
502
|
border: 0;
|
|
535
503
|
cursor: pointer;
|
|
536
|
-
width:
|
|
537
|
-
height:
|
|
504
|
+
width: 44px;
|
|
505
|
+
height: 44px;
|
|
538
506
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
507
|
+
/* custom content (option toggleContent) instead of the icon */
|
|
508
|
+
&:not(:empty) {
|
|
509
|
+
background-image: none;
|
|
510
|
+
color: var(--maplair-color-base);
|
|
511
|
+
font: inherit;
|
|
512
|
+
font-size: var(--maplair-font-size-large);
|
|
542
513
|
}
|
|
543
514
|
}
|
|
544
515
|
|
|
@@ -581,10 +552,45 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
581
552
|
margin: var(--maplair-spacing-25) calc(-1 * var(--maplair-spacing-50));
|
|
582
553
|
}
|
|
583
554
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
555
|
+
.maplair-control-layers-group-name {
|
|
556
|
+
font-size: var(--maplair-font-size-small);
|
|
557
|
+
font-weight: bold;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* inline layers control, laid out like the attribution control */
|
|
561
|
+
|
|
562
|
+
.maplair-control-layers-inline {
|
|
563
|
+
&.maplair-control-layers-expanded {
|
|
564
|
+
padding: 0 var(--maplair-spacing-25);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.maplair-control-layers-list {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-wrap: wrap;
|
|
570
|
+
align-items: center;
|
|
571
|
+
column-gap: var(--maplair-spacing-50);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.maplair-control-layers-base,
|
|
575
|
+
.maplair-control-layers-overlays {
|
|
576
|
+
display: contents;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.maplair-control-layers-separator {
|
|
580
|
+
display: none;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.maplair-control-layers-group {
|
|
584
|
+
display: flex;
|
|
585
|
+
flex-wrap: wrap;
|
|
586
|
+
align-items: center;
|
|
587
|
+
column-gap: var(--maplair-spacing-50);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
label {
|
|
591
|
+
/* keep an entry together with its radio button or checkbox */
|
|
592
|
+
white-space: nowrap;
|
|
593
|
+
}
|
|
588
594
|
}
|
|
589
595
|
|
|
590
596
|
/* text control */
|
|
@@ -655,10 +661,6 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
655
661
|
&:focus {
|
|
656
662
|
outline: none;
|
|
657
663
|
}
|
|
658
|
-
|
|
659
|
-
.maplair-touch & {
|
|
660
|
-
height: var(--maplair-size-control-touch);
|
|
661
|
-
}
|
|
662
664
|
}
|
|
663
665
|
|
|
664
666
|
.maplair-control-search:not(.maplair-control-search-expanded) {
|
|
@@ -717,6 +719,44 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
717
719
|
}
|
|
718
720
|
}
|
|
719
721
|
|
|
722
|
+
/* time control */
|
|
723
|
+
|
|
724
|
+
.maplair-bar.maplair-control-time {
|
|
725
|
+
display: flex;
|
|
726
|
+
align-items: center;
|
|
727
|
+
background-color: var(--maplair-background-color-base);
|
|
728
|
+
font-size: var(--maplair-font-size-small);
|
|
729
|
+
|
|
730
|
+
/* the buttons in a row */
|
|
731
|
+
button {
|
|
732
|
+
flex: none;
|
|
733
|
+
border-bottom: none;
|
|
734
|
+
border-right: var(--maplair-border-width-base) solid var(--maplair-border-color-subtle);
|
|
735
|
+
border-radius: 0;
|
|
736
|
+
|
|
737
|
+
&:first-child {
|
|
738
|
+
border-radius: var(--maplair-border-radius-base) 0 0 var(--maplair-border-radius-base);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
svg {
|
|
743
|
+
vertical-align: middle;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.maplair-control-time-slider {
|
|
748
|
+
width: 160px;
|
|
749
|
+
max-width: calc(100vw - 260px);
|
|
750
|
+
margin: 0 var(--maplair-spacing-50);
|
|
751
|
+
accent-color: var(--maplair-color-progressive);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.maplair-control-time-label {
|
|
755
|
+
padding-right: var(--maplair-spacing-50);
|
|
756
|
+
white-space: nowrap;
|
|
757
|
+
font-variant-numeric: tabular-nums;
|
|
758
|
+
}
|
|
759
|
+
|
|
720
760
|
/* legend control */
|
|
721
761
|
|
|
722
762
|
.maplair-control-legend {
|
|
@@ -841,18 +881,10 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
841
881
|
}
|
|
842
882
|
}
|
|
843
883
|
|
|
844
|
-
.maplair-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
box-shadow: none;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
.maplair-control-layers,
|
|
852
|
-
.maplair-bar {
|
|
853
|
-
border: var(--maplair-border-width-thick) solid var(--maplair-border-color-muted);
|
|
854
|
-
background-clip: padding-box;
|
|
855
|
-
}
|
|
884
|
+
.maplair-control-layers,
|
|
885
|
+
.maplair-bar {
|
|
886
|
+
border: var(--maplair-border-width-thick) solid var(--maplair-border-color-muted);
|
|
887
|
+
background-clip: padding-box;
|
|
856
888
|
}
|
|
857
889
|
|
|
858
890
|
/* overview map */
|
|
@@ -865,8 +897,8 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
865
897
|
box-shadow: var(--maplair-box-shadow-medium);
|
|
866
898
|
|
|
867
899
|
&.maplair-control-minimap-collapsed {
|
|
868
|
-
width: var(--maplair-size-control
|
|
869
|
-
height: var(--maplair-size-control
|
|
900
|
+
width: var(--maplair-size-control) !important;
|
|
901
|
+
height: var(--maplair-size-control) !important;
|
|
870
902
|
|
|
871
903
|
.maplair-control-minimap-map {
|
|
872
904
|
display: none;
|
|
@@ -889,14 +921,14 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
889
921
|
right: 0;
|
|
890
922
|
bottom: 0;
|
|
891
923
|
z-index: 1000;
|
|
892
|
-
width: var(--maplair-size-control
|
|
893
|
-
height: var(--maplair-size-control
|
|
924
|
+
width: var(--maplair-size-control);
|
|
925
|
+
height: var(--maplair-size-control);
|
|
894
926
|
padding: 0;
|
|
895
927
|
border: 0;
|
|
896
928
|
border-radius: var(--maplair-border-radius-small);
|
|
897
929
|
background: var(--maplair-background-color-base);
|
|
898
930
|
color: var(--maplair-color-base);
|
|
899
|
-
font: bold var(--maplair-font-size-medium)/var(--maplair-size-control
|
|
931
|
+
font: bold var(--maplair-font-size-medium)/var(--maplair-size-control) var(--maplair-font-family-base);
|
|
900
932
|
cursor: pointer;
|
|
901
933
|
transform: rotate(180deg);
|
|
902
934
|
|
|
@@ -1111,6 +1143,30 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
1111
1143
|
border: var(--maplair-border-width-base) solid var(--maplair-border-color-base);
|
|
1112
1144
|
}
|
|
1113
1145
|
|
|
1146
|
+
/* MarkerClusterGroup */
|
|
1147
|
+
|
|
1148
|
+
.maplair-cluster {
|
|
1149
|
+
--maplair-cluster-color: #6ecc39;
|
|
1150
|
+
display: flex;
|
|
1151
|
+
align-items: center;
|
|
1152
|
+
justify-content: center;
|
|
1153
|
+
border-radius: 50%;
|
|
1154
|
+
background: var(--maplair-cluster-color);
|
|
1155
|
+
box-shadow: 0 0 0 5px color-mix(in srgb, var(--maplair-cluster-color) 40%, transparent);
|
|
1156
|
+
color: #000;
|
|
1157
|
+
font: bold var(--maplair-font-size-x-small) / 1 var(--maplair-font-family-base);
|
|
1158
|
+
}
|
|
1159
|
+
.maplair-cluster-medium {
|
|
1160
|
+
--maplair-cluster-color: #f0c20c;
|
|
1161
|
+
}
|
|
1162
|
+
.maplair-cluster-large {
|
|
1163
|
+
--maplair-cluster-color: #f18017;
|
|
1164
|
+
}
|
|
1165
|
+
.maplair-cluster-leg {
|
|
1166
|
+
stroke: var(--maplair-color-base);
|
|
1167
|
+
stroke-opacity: 0.5;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1114
1170
|
/* Tooltip */
|
|
1115
1171
|
/* Base styles for the element that has a tooltip */
|
|
1116
1172
|
.maplair-tooltip {
|
|
@@ -1121,7 +1177,6 @@ path.maplair-interactive:focus:not(:focus-visible) {
|
|
|
1121
1177
|
border-radius: var(--maplair-border-radius-base);
|
|
1122
1178
|
color: var(--maplair-color-base);
|
|
1123
1179
|
white-space: nowrap;
|
|
1124
|
-
user-select: none;
|
|
1125
1180
|
pointer-events: none;
|
|
1126
1181
|
box-shadow: var(--maplair-box-shadow-medium);
|
|
1127
1182
|
|
package/dist/esm/core/Browser.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
//#region src/core/Browser.js
|
|
2
|
-
const chrome = userAgentContains("chrome");
|
|
3
|
-
const safari = !chrome && userAgentContains("safari");
|
|
4
|
-
const mobile = typeof orientation !== "undefined";
|
|
5
|
-
const reducedMotion = navigator.preferences?.reducedMotion?.value ? navigator.preferences.reducedMotion.value === "reduce" : typeof window === "undefined" ? true : window?.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6
|
-
const pointer = typeof window === "undefined" ? false : !!window.PointerEvent;
|
|
7
|
-
const touchNative = typeof window === "undefined" ? false : "ontouchstart" in window || !!window.TouchEvent;
|
|
8
|
-
const touch = touchNative || pointer;
|
|
9
|
-
function isRetina() {
|
|
10
|
-
return typeof window === "undefined" || typeof window.devicePixelRatio === "undefined" ? false : window.devicePixelRatio > 1;
|
|
11
|
-
}
|
|
12
|
-
const mac = typeof navigator === "undefined" || typeof navigator.platform === "undefined" ? false : navigator.platform.startsWith("Mac");
|
|
13
|
-
const linux = typeof navigator === "undefined" || typeof navigator.platform === "undefined" ? false : navigator.platform.startsWith("Linux");
|
|
14
|
-
function userAgentContains(str) {
|
|
15
|
-
if (typeof navigator === "undefined" || typeof navigator.userAgent === "undefined") return false;
|
|
16
|
-
return navigator.userAgent.toLowerCase().includes(str);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A namespace with static properties for browser/feature detection used by Maplair
|
|
20
|
-
* internally.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```js
|
|
24
|
-
* if (Browser.chrome) {
|
|
25
|
-
* alert('You are running Chrome!');
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
* @type {Readonly<Record<string, boolean>>}
|
|
29
|
-
*/
|
|
30
|
-
var Browser_default = {
|
|
31
|
-
/**
|
|
32
|
-
* `true` for the Chrome browser.
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
*/
|
|
35
|
-
chrome,
|
|
36
|
-
/**
|
|
37
|
-
* `true` for the Safari browser.
|
|
38
|
-
* @type {boolean}
|
|
39
|
-
*/
|
|
40
|
-
safari,
|
|
41
|
-
/**
|
|
42
|
-
* `true` for all browsers running in a mobile device.
|
|
43
|
-
* @type {boolean}
|
|
44
|
-
*/
|
|
45
|
-
mobile,
|
|
46
|
-
/**
|
|
47
|
-
* `true` if the user has
|
|
48
|
-
* [configured their environment for reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion#user_preferences).
|
|
49
|
-
* Determines whether animations should play or not.
|
|
50
|
-
* @type {boolean}
|
|
51
|
-
*/
|
|
52
|
-
reducedMotion,
|
|
53
|
-
/**
|
|
54
|
-
* `true` for all browsers supporting
|
|
55
|
-
* [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
|
56
|
-
* @type {boolean}
|
|
57
|
-
*/
|
|
58
|
-
pointer,
|
|
59
|
-
/**
|
|
60
|
-
* `true` for all browsers supporting either [touch](#browser-touch) or
|
|
61
|
-
* [pointer](#browser-pointer) events.
|
|
62
|
-
* Note: pointer events will be preferred (if available), and processed for all
|
|
63
|
-
* `touch*` listeners.
|
|
64
|
-
* @type {boolean}
|
|
65
|
-
*/
|
|
66
|
-
touch,
|
|
67
|
-
/**
|
|
68
|
-
* `true` for all browsers supporting
|
|
69
|
-
* [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
|
70
|
-
* **This does not necessarily mean** that the browser is running in a computer with
|
|
71
|
-
* a touchscreen, it only means that the browser is capable of understanding
|
|
72
|
-
* touch events.
|
|
73
|
-
* @type {boolean}
|
|
74
|
-
*/
|
|
75
|
-
touchNative,
|
|
76
|
-
/**
|
|
77
|
-
* `true` for browsers on a high-resolution "retina" screen or on any screen when
|
|
78
|
-
* browser's display zoom is more than 100%. Follows changes of the
|
|
79
|
-
* `devicePixelRatio`, e.g. when moving the window to another screen (see the map's
|
|
80
|
-
* `pixelratiochange` event).
|
|
81
|
-
* @type {boolean}
|
|
82
|
-
*/
|
|
83
|
-
get retina() {
|
|
84
|
-
return isRetina();
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* `true` when the browser is running in a Mac platform.
|
|
88
|
-
* @type {boolean}
|
|
89
|
-
*/
|
|
90
|
-
mac,
|
|
91
|
-
/**
|
|
92
|
-
* `true` when the browser is running in a Linux platform.
|
|
93
|
-
* @type {boolean}
|
|
94
|
-
*/
|
|
95
|
-
linux
|
|
96
|
-
};
|
|
97
|
-
//#endregion
|
|
98
|
-
export { Browser_default as default };
|
|
99
|
-
|
|
100
|
-
//# sourceMappingURL=Browser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.js","names":[],"sources":["../../../src/core/Browser.js"],"sourcesContent":["const chrome = userAgentContains('chrome');\n\nconst safari = !chrome && userAgentContains('safari');\n\nconst mobile = typeof orientation !== 'undefined';\n\nconst reducedMotion = navigator.preferences?.reducedMotion?.value ?\n\tnavigator.preferences.reducedMotion.value === 'reduce' :\n\ttypeof window === 'undefined' ? true : window?.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\nconst pointer = typeof window === 'undefined' ? false : !!window.PointerEvent;\n\nconst touchNative = typeof window === 'undefined' ? false : 'ontouchstart' in window || !!(window.TouchEvent);\n\nconst touch = touchNative || pointer;\n\nfunction isRetina() {\n\treturn typeof window === 'undefined' || typeof window.devicePixelRatio === 'undefined' ? false : window.devicePixelRatio > 1;\n}\n\nconst mac = typeof navigator === 'undefined' || typeof navigator.platform === 'undefined' ? false : navigator.platform.startsWith('Mac');\n\nconst linux = typeof navigator === 'undefined' || typeof navigator.platform === 'undefined' ? false : navigator.platform.startsWith('Linux');\n\nfunction userAgentContains(str) {\n\tif (typeof navigator === 'undefined' || typeof navigator.userAgent === 'undefined') {\n\t\treturn false;\n\t}\n\treturn navigator.userAgent.toLowerCase().includes(str);\n}\n\n/**\n * A namespace with static properties for browser/feature detection used by Maplair\n * internally.\n *\n * @example\n * ```js\n * if (Browser.chrome) {\n * alert('You are running Chrome!');\n * }\n * ```\n * @type {Readonly<Record<string, boolean>>}\n */\nexport default {\n\t/**\n\t * `true` for the Chrome browser.\n\t * @type {boolean}\n\t */\n\tchrome,\n\t/**\n\t * `true` for the Safari browser.\n\t * @type {boolean}\n\t */\n\tsafari,\n\t/**\n\t * `true` for all browsers running in a mobile device.\n\t * @type {boolean}\n\t */\n\tmobile,\n\t/**\n\t * `true` if the user has\n\t * [configured their environment for reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion#user_preferences).\n\t * Determines whether animations should play or not.\n\t * @type {boolean}\n\t */\n\treducedMotion,\n\t/**\n\t * `true` for all browsers supporting\n\t * [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\n\t * @type {boolean}\n\t */\n\tpointer,\n\t/**\n\t * `true` for all browsers supporting either [touch](#browser-touch) or\n\t * [pointer](#browser-pointer) events.\n\t * Note: pointer events will be preferred (if available), and processed for all\n\t * `touch*` listeners.\n\t * @type {boolean}\n\t */\n\ttouch,\n\t/**\n\t * `true` for all browsers supporting\n\t * [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\n\t * **This does not necessarily mean** that the browser is running in a computer with\n\t * a touchscreen, it only means that the browser is capable of understanding\n\t * touch events.\n\t * @type {boolean}\n\t */\n\ttouchNative,\n\t/**\n\t * `true` for browsers on a high-resolution \"retina\" screen or on any screen when\n\t * browser's display zoom is more than 100%. Follows changes of the\n\t * `devicePixelRatio`, e.g. when moving the window to another screen (see the map's\n\t * `pixelratiochange` event).\n\t * @type {boolean}\n\t */\n\tget retina() {\n\t\treturn isRetina();\n\t},\n\t/**\n\t * `true` when the browser is running in a Mac platform.\n\t * @type {boolean}\n\t */\n\tmac,\n\t/**\n\t * `true` when the browser is running in a Linux platform.\n\t * @type {boolean}\n\t */\n\tlinux\n};\n"],"mappings":";AAAA,MAAM,SAAS,kBAAkB,QAAQ;AAEzC,MAAM,SAAS,CAAC,UAAU,kBAAkB,QAAQ;AAEpD,MAAM,SAAS,OAAO,gBAAgB;AAEtC,MAAM,gBAAgB,UAAU,aAAa,eAAe,QAC3D,UAAU,YAAY,cAAc,UAAU,WAC9C,OAAO,WAAW,cAAc,OAAO,QAAQ,WAAW,kCAAkC,CAAC,CAAC;AAE/F,MAAM,UAAU,OAAO,WAAW,cAAc,QAAQ,CAAC,CAAC,OAAO;AAEjE,MAAM,cAAc,OAAO,WAAW,cAAc,QAAQ,kBAAkB,UAAU,CAAC,CAAE,OAAO;AAElG,MAAM,QAAQ,eAAe;AAE7B,SAAS,WAAW;CACnB,OAAO,OAAO,WAAW,eAAe,OAAO,OAAO,qBAAqB,cAAc,QAAQ,OAAO,mBAAmB;AAC5H;AAEA,MAAM,MAAM,OAAO,cAAc,eAAe,OAAO,UAAU,aAAa,cAAc,QAAQ,UAAU,SAAS,WAAW,KAAK;AAEvI,MAAM,QAAQ,OAAO,cAAc,eAAe,OAAO,UAAU,aAAa,cAAc,QAAQ,UAAU,SAAS,WAAW,OAAO;AAE3I,SAAS,kBAAkB,KAAK;CAC/B,IAAI,OAAO,cAAc,eAAe,OAAO,UAAU,cAAc,aACtE,OAAO;CAER,OAAO,UAAU,UAAU,YAAY,CAAC,CAAC,SAAS,GAAG;AACtD;;;;;;;;;;;;;AAcA,IAAA,kBAAe;;;;;CAKd;;;;;CAKA;;;;;CAKA;;;;;;;CAOA;;;;;;CAMA;;;;;;;;CAQA;;;;;;;;;CASA;;;;;;;;CAQA,IAAI,SAAS;EACZ,OAAO,SAAS;CACjB;;;;;CAKA;;;;;CAKA;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.LonLat.js","names":[],"sources":["../../../../src/geo/projection/Projection.LonLat.js"],"sourcesContent":["import {LatLng} from '../LatLng.js';\nimport {Bounds} from '../../geometry/Bounds.js';\nimport {Point} from '../../geometry/Point.js';\n\n/** @import {Projection} from './index.js' */\n\n/**\n * Equirectangular, or Plate Carree projection — the most simple projection,\n * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as\n * latitude. Also suitable for flat worlds, e.g. game maps. Used by the\n * `EPSG4326` and `SimpleCRS` CRS.\n * @type {Projection}\n */\nexport const LonLat = {\n\tproject(latlng) {\n\t\tlatlng = LatLng.from(latlng);\n\t\treturn new Point(latlng.lng, latlng.lat);\n\t},\n\n\tunproject(point) {\n\t\tpoint = Point.from(point);\n\t\treturn new LatLng(point.y, point.x);\n\t},\n\n\tbounds: new Bounds([-180, -90], [180, 90])\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,SAAS;CACrB,QAAQ,QAAQ;EACf,SAAS,OAAO,KAAK,MAAM;EAC3B,OAAO,IAAI,MAAM,OAAO,KAAK,OAAO,GAAG;CACxC;CAEA,UAAU,OAAO;EAChB,QAAQ,MAAM,KAAK,KAAK;EACxB,OAAO,IAAI,OAAO,MAAM,GAAG,MAAM,CAAC;CACnC;CAEA,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;AAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.Mercator.js","names":[],"sources":["../../../../src/geo/projection/Projection.Mercator.js"],"sourcesContent":["import {LatLng} from '../LatLng.js';\nimport {Bounds} from '../../geometry/Bounds.js';\nimport {Point} from '../../geometry/Point.js';\n\n/** @import {Projection} from './index.js' */\n\nconst earthRadius = 6378137;\n\n/**\n * Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that\n * Earth is an ellipsoid. Used by the EPSG:3395 CRS.\n * @type {Projection & {R: number, R_MINOR: number}}\n */\nexport const Mercator = {\n\tR: earthRadius,\n\tR_MINOR: 6356752.314245179,\n\n\tbounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),\n\n\tproject(latlng) {\n\t\tlatlng = LatLng.from(latlng);\n\t\tconst d = Math.PI / 180,\n\t\tr = this.R,\n\t\ttmp = this.R_MINOR / r,\n\t\te = Math.sqrt(1 - tmp * tmp);\n\t\tlet y = latlng.lat * d;\n\t\tconst con = e * Math.sin(y);\n\n\t\tconst ts = Math.tan(Math.PI / 4 - y / 2) / ((1 - con) / (1 + con)) ** (e / 2);\n\t\ty = -r * Math.log(Math.max(ts, 1E-10));\n\n\t\treturn new Point(latlng.lng * d * r, y);\n\t},\n\n\tunproject(point) {\n\t\tpoint = Point.from(point);\n\t\tconst d = 180 / Math.PI,\n\t\tr = this.R,\n\t\ttmp = this.R_MINOR / r,\n\t\te = Math.sqrt(1 - tmp * tmp),\n\t\tts = Math.exp(-point.y / r);\n\t\tlet phi = Math.PI / 2 - 2 * Math.atan(ts);\n\n\t\tfor (let i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\n\t\t\tcon = e * Math.sin(phi);\n\t\t\tcon = ((1 - con) / (1 + con)) ** (e / 2);\n\t\t\tdphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\n\t\t\tphi += dphi;\n\t\t}\n\n\t\treturn new LatLng(phi * d, point.x * d / r);\n\t}\n};\n"],"mappings":";;;;;;;;AAaA,MAAa,WAAW;CACvB,GAAG;CACH,SAAS;CAET,QAAQ,IAAI,OAAO,CAAC,iBAAiB,eAAe,GAAG,CAAC,gBAAgB,cAAc,CAAC;CAEvF,QAAQ,QAAQ;EACf,SAAS,OAAO,KAAK,MAAM;EAC3B,MAAM,IAAI,KAAK,KAAK,KACpB,IAAI,KAAK,GACT,MAAM,KAAK,UAAU,GACrB,IAAI,KAAK,KAAK,IAAI,MAAM,GAAG;EAC3B,IAAI,IAAI,OAAO,MAAM;EACrB,MAAM,MAAM,IAAI,KAAK,IAAI,CAAC;EAE1B,MAAM,KAAK,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,IAAI,UAAU,IAAI;EAC3E,IAAI,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC;EAErC,OAAO,IAAI,MAAM,OAAO,MAAM,IAAI,GAAG,CAAC;CACvC;CAEA,UAAU,OAAO;EAChB,QAAQ,MAAM,KAAK,KAAK;EACxB,MAAM,IAAI,MAAM,KAAK,IACrB,IAAI,KAAK,GACT,MAAM,KAAK,UAAU,GACrB,IAAI,KAAK,KAAK,IAAI,MAAM,GAAG,GAC3B,KAAK,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC;EAC1B,IAAI,MAAM,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;EAExC,KAAK,IAAI,IAAI,GAAG,OAAO,IAAK,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,MAAM,KAAK;GACtE,MAAM,IAAI,KAAK,IAAI,GAAG;GACtB,QAAQ,IAAI,QAAQ,IAAI,UAAU,IAAI;GACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,GAAG,IAAI;GAC/C,OAAO;EACR;EAEA,OAAO,IAAI,OAAO,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;CAC3C;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.SphericalMercator.js","names":[],"sources":["../../../../src/geo/projection/Projection.SphericalMercator.js"],"sourcesContent":["import {LatLng} from '../LatLng.js';\nimport {Bounds} from '../../geometry/Bounds.js';\nimport {Point} from '../../geometry/Point.js';\n\n/** @import {Projection} from './index.js' */\n\nconst earthRadius = 6378137;\n\n/**\n * Spherical Mercator projection — the most common projection for online maps,\n * used by almost all free and commercial tile providers. Assumes that Earth is\n * a sphere. Used by the `EPSG:3857` CRS.\n * @type {Projection & {R: number, MAX_LATITUDE: number}}\n */\nexport const SphericalMercator = {\n\n\tR: earthRadius,\n\tMAX_LATITUDE: 85.0511287798,\n\n\tproject(latlng) {\n\t\tlatlng = LatLng.from(latlng);\n\t\tconst d = Math.PI / 180,\n\t\tmax = this.MAX_LATITUDE,\n\t\tlat = Math.max(Math.min(max, latlng.lat), -max),\n\t\tsin = Math.sin(lat * d);\n\n\t\treturn new Point(\n\t\t\tthis.R * latlng.lng * d,\n\t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\n\t},\n\n\tunproject(point) {\n\t\tpoint = Point.from(point);\n\t\tconst d = 180 / Math.PI;\n\n\t\treturn new LatLng(\n\t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\n\t\t\tpoint.x * d / this.R);\n\t},\n\n\tbounds: (() => {\n\t\tconst d = earthRadius * Math.PI;\n\t\treturn new Bounds([-d, -d], [d, d]);\n\t})()\n};\n"],"mappings":";;;;;AAMA,MAAM,cAAc;;;;;;;AAQpB,MAAa,oBAAoB;CAEhC,GAAG;CACH,cAAc;CAEd,QAAQ,QAAQ;EACf,SAAS,OAAO,KAAK,MAAM;EAC3B,MAAM,IAAI,KAAK,KAAK,KACpB,MAAM,KAAK,cACX,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,OAAO,GAAG,GAAG,CAAC,GAAG,GAC9C,MAAM,KAAK,IAAI,MAAM,CAAC;EAEtB,OAAO,IAAI,MACV,KAAK,IAAI,OAAO,MAAM,GACtB,KAAK,IAAI,KAAK,KAAK,IAAI,QAAQ,IAAI,IAAI,IAAI,CAAC;CAC9C;CAEA,UAAU,OAAO;EAChB,QAAQ,MAAM,KAAK,KAAK;EACxB,MAAM,IAAI,MAAM,KAAK;EAErB,OAAO,IAAI,QACT,IAAI,KAAK,KAAK,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,IAAK,KAAK,KAAK,KAAM,GAC9D,MAAM,IAAI,IAAI,KAAK,CAAC;CACtB;CAEA,eAAe;EACd,MAAM,IAAI,cAAc,KAAK;EAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACnC,EAAA,CAAG;AACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { SphericalMercator } from "./Projection.SphericalMercator.js";
|
|
3
|
-
import { LonLat } from "./Projection.LonLat.js";
|
|
4
|
-
import { Mercator } from "./Projection.Mercator.js";
|
|
5
|
-
//#region src/geo/projection/index.js
|
|
6
|
-
var projection_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
-
LonLat: () => LonLat,
|
|
8
|
-
Mercator: () => Mercator,
|
|
9
|
-
SphericalMercator: () => SphericalMercator
|
|
10
|
-
});
|
|
11
|
-
//#endregion
|
|
12
|
-
export { LonLat, Mercator, SphericalMercator, projection_exports };
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/geo/projection/index.js"],"sourcesContent":["/** @import {Bounds} from '../../geometry/Bounds.js' */\n/** @import {Point} from '../../geometry/Point.js' */\n/** @import {LatLng} from '../LatLng.js' */\n\n/**\n * An object with methods for projecting geographical coordinates of the world onto\n * a flat surface (and back). See [Map projection](https://en.wikipedia.org/wiki/Map_projection).\n *\n * Maplair comes with a set of already defined projections out of the box: `LonLat`,\n * `Mercator` and `SphericalMercator` (in the `Projection` namespace).\n *\n * Note that the projection instances do not inherit from Maplair's `Class` object,\n * and can't be instantiated. Also, new classes can't inherit from them,\n * and methods can't be added to them with the `include` function.\n *\n * @typedef {object} Projection\n * @property {Bounds} bounds The bounds (specified in CRS units) where the projection is\n * valid.\n * @property {(latlng: LatLng) => Point} project Projects geographical coordinates into\n * a 2D point. Only accepts actual `LatLng` instances, not arrays.\n * @property {(point: Point) => LatLng} unproject The inverse of `project`. Projects a\n * 2D point into a geographical location. Only accepts actual `Point` instances, not\n * arrays.\n */\n\nexport {LonLat} from './Projection.LonLat.js';\nexport {Mercator} from './Projection.Mercator.js';\nexport {SphericalMercator} from './Projection.SphericalMercator.js';\n"],"mappings":""}
|