react-native-maplibre-lite 0.1.1 → 0.1.3
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/lib/module/components/MapPlaceholder.js +2 -3
- package/lib/module/components/MapPlaceholder.js.map +1 -1
- package/lib/module/components/MapView.js +117 -41
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/Marker.js +2 -2
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Polygon.js +2 -2
- package/lib/module/components/Polygon.js.map +1 -1
- package/lib/module/components/Polyline.js +2 -2
- package/lib/module/components/Polyline.js.map +1 -1
- package/lib/module/components/utils.js +29 -0
- package/lib/module/components/utils.js.map +1 -0
- package/lib/module/{webContent.js → components/webContent.js} +18 -32
- package/lib/module/components/webContent.js.map +1 -0
- package/lib/module/components/webFunctions/addMarkerWeb.js +36 -10
- package/lib/module/components/webFunctions/addMarkerWeb.js.map +1 -1
- package/lib/module/components/webFunctions/addPolylineWeb.js +2 -2
- package/lib/module/components/webFunctions/fitBoundsWeb.js +6 -2
- package/lib/module/components/webFunctions/fitBoundsWeb.js.map +1 -1
- package/lib/module/components/webFunctions/flyToWeb.js +14 -0
- package/lib/module/components/webFunctions/flyToWeb.js.map +1 -0
- package/lib/module/components/webFunctions/initWeb.js +52 -20
- package/lib/module/components/webFunctions/initWeb.js.map +1 -1
- package/lib/module/components/webFunctions/updateWeb.js +78 -0
- package/lib/module/components/webFunctions/updateWeb.js.map +1 -0
- package/lib/typescript/src/components/MapPlaceholder.d.ts.map +1 -1
- package/lib/typescript/src/components/MapView.d.ts +8 -1
- package/lib/typescript/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.d.ts +1 -1
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Polygon.d.ts +1 -1
- package/lib/typescript/src/components/Polygon.d.ts.map +1 -1
- package/lib/typescript/src/components/types.d.ts +4 -0
- package/lib/typescript/src/components/types.d.ts.map +1 -1
- package/lib/typescript/src/components/utils.d.ts +2 -0
- package/lib/typescript/src/components/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/webContent.d.ts +3 -0
- package/lib/typescript/src/components/webContent.d.ts.map +1 -0
- package/lib/typescript/src/components/webFunctions/addMarkerWeb.d.ts +1 -1
- package/lib/typescript/src/components/webFunctions/addMarkerWeb.d.ts.map +1 -1
- package/lib/typescript/src/components/webFunctions/addPolylineWeb.d.ts +1 -1
- package/lib/typescript/src/components/webFunctions/fitBoundsWeb.d.ts +1 -1
- package/lib/typescript/src/components/webFunctions/fitBoundsWeb.d.ts.map +1 -1
- package/lib/typescript/src/components/webFunctions/flyToWeb.d.ts +2 -0
- package/lib/typescript/src/components/webFunctions/flyToWeb.d.ts.map +1 -0
- package/lib/typescript/src/components/webFunctions/initWeb.d.ts +1 -1
- package/lib/typescript/src/components/webFunctions/initWeb.d.ts.map +1 -1
- package/lib/typescript/src/components/webFunctions/updateWeb.d.ts +3 -0
- package/lib/typescript/src/components/webFunctions/updateWeb.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/MapPlaceholder.tsx +9 -5
- package/src/components/MapView.tsx +163 -57
- package/src/components/Marker.tsx +3 -3
- package/src/components/Polygon.tsx +3 -3
- package/src/components/Polyline.tsx +2 -2
- package/src/components/types.ts +4 -0
- package/src/components/utils.ts +31 -0
- package/src/{webContent.ts → components/webContent.ts} +20 -39
- package/src/components/webFunctions/addMarkerWeb.ts +36 -10
- package/src/components/webFunctions/addPolylineWeb.ts +2 -2
- package/src/components/webFunctions/fitBoundsWeb.ts +6 -2
- package/src/components/webFunctions/flyToWeb.ts +11 -0
- package/src/components/webFunctions/initWeb.ts +52 -20
- package/src/components/webFunctions/updateWeb.ts +75 -0
- package/src/index.tsx +1 -1
- package/lib/module/webContent.js.map +0 -1
- package/lib/typescript/src/webContent.d.ts +0 -3
- package/lib/typescript/src/webContent.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/addMarkerWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/addMarkerWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa","ignoreList":[]}
|
|
@@ -38,8 +38,8 @@ if(functionName === 'addPolyline') {
|
|
|
38
38
|
'line-cap': 'round'
|
|
39
39
|
},
|
|
40
40
|
'paint': {
|
|
41
|
-
'line-color': params.color
|
|
42
|
-
'line-width': params.width
|
|
41
|
+
'line-color': (params.color != null) ? params.color : '#000000',
|
|
42
|
+
'line-width': (params.width != null) ? params.width : 4
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
export default /*js*/`
|
|
4
4
|
if(functionName === 'fitBounds') {
|
|
5
|
+
|
|
6
|
+
var padding = (params && params.padding) ? params.padding : 40;
|
|
7
|
+
var duration = (params && params.duration) ? params.duration : 500;
|
|
8
|
+
|
|
5
9
|
map.fitBounds(params.bounds, {
|
|
6
|
-
padding:
|
|
7
|
-
duration:
|
|
10
|
+
padding: padding,
|
|
11
|
+
duration: duration
|
|
8
12
|
});
|
|
9
13
|
}
|
|
10
14
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/fitBoundsWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/fitBoundsWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const flyToWeb = /*js*/`
|
|
4
|
+
if(functionName === 'flyTo') {
|
|
5
|
+
|
|
6
|
+
var duration = (params && params.duration) ? params.duration : 500;
|
|
7
|
+
map.flyTo({
|
|
8
|
+
center: params.center,
|
|
9
|
+
zoom: params.zoom,
|
|
10
|
+
duration: duration
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=flyToWeb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["flyToWeb"],"sourceRoot":"../../../../src","sources":["components/webFunctions/flyToWeb.ts"],"mappings":";;AAAA,OAAO,MAAMA,QAAQ,GAAG,MAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -14,10 +14,40 @@ export default /*js*/`
|
|
|
14
14
|
var layerType = layer.type;
|
|
15
15
|
var shouldHide = false;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// Keep labels (streets / addresses) visible — hide only expensive visual layers by default.
|
|
18
|
+
if(layerType === 'fill-extrusion' || layerType === 'hillshade'){
|
|
18
19
|
shouldHide = true;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
if(layerType === 'symbol' && aggressive){
|
|
23
|
+
var idLower = String(layerId || '').toLowerCase();
|
|
24
|
+
var sourceLayerLower = String(layer['source-layer'] || '').toLowerCase();
|
|
25
|
+
|
|
26
|
+
// Keep road + address/house number labels.
|
|
27
|
+
var keepLabel =
|
|
28
|
+
idLower.indexOf('road') !== -1 ||
|
|
29
|
+
idLower.indexOf('street') !== -1 ||
|
|
30
|
+
idLower.indexOf('housenumber') !== -1 ||
|
|
31
|
+
idLower.indexOf('house_number') !== -1 ||
|
|
32
|
+
idLower.indexOf('house-number') !== -1 ||
|
|
33
|
+
idLower.indexOf('address') !== -1 ||
|
|
34
|
+
sourceLayerLower.indexOf('housenumber') !== -1 ||
|
|
35
|
+
sourceLayerLower.indexOf('house') !== -1 ||
|
|
36
|
+
sourceLayerLower.indexOf('address') !== -1;
|
|
37
|
+
|
|
38
|
+
// Hide most POI/other symbols in aggressive mode.
|
|
39
|
+
var hideSymbol =
|
|
40
|
+
idLower.indexOf('poi') !== -1 ||
|
|
41
|
+
idLower.indexOf('transit') !== -1 ||
|
|
42
|
+
idLower.indexOf('airport') !== -1 ||
|
|
43
|
+
idLower.indexOf('rail') !== -1 ||
|
|
44
|
+
idLower.indexOf('ferry') !== -1;
|
|
45
|
+
|
|
46
|
+
if(!keepLabel && hideSymbol){
|
|
47
|
+
shouldHide = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
21
51
|
if(aggressive && (layerType === 'line' || layerType === 'circle')){
|
|
22
52
|
var layerIdLower = String(layerId || '').toLowerCase();
|
|
23
53
|
if(
|
|
@@ -60,23 +90,19 @@ export default /*js*/`
|
|
|
60
90
|
}
|
|
61
91
|
|
|
62
92
|
|
|
63
|
-
map = new maplibregl.Map({
|
|
64
|
-
container: 'map',
|
|
65
|
-
style: params.style,
|
|
66
|
-
//Moscow coordinates
|
|
67
|
-
center: params.center, // starting position [lng, lat]
|
|
68
|
-
zoom: params.zoom, // starting zoom
|
|
69
93
|
|
|
70
94
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
95
|
+
map = new maplibregl.Map({
|
|
96
|
+
container: 'map',
|
|
97
|
+
style: params.mapStyle,
|
|
98
|
+
center: params.center,
|
|
99
|
+
zoom: params.zoom,
|
|
100
|
+
scrollZoom: params.scrollEnabled,
|
|
75
101
|
doubleClickZoom: params.zoomEnabled,
|
|
76
102
|
touchZoomRotate: params.zoomEnabled,
|
|
77
103
|
minZoom: params.minZoom,
|
|
78
|
-
|
|
79
|
-
|
|
104
|
+
maxZoom: params.maxZoom,
|
|
105
|
+
dragPan: params.scrollEnabled,
|
|
80
106
|
dragRotate: params.zoomEnabled,
|
|
81
107
|
antialias: params.antialias ?? false,
|
|
82
108
|
crossSourceCollisions: params.crossSourceCollisions ?? true,
|
|
@@ -106,34 +132,40 @@ export default /*js*/`
|
|
|
106
132
|
|
|
107
133
|
|
|
108
134
|
return {
|
|
109
|
-
center,
|
|
110
|
-
zoom
|
|
135
|
+
center: center,
|
|
136
|
+
zoom: zoom
|
|
111
137
|
}
|
|
112
138
|
}
|
|
139
|
+
|
|
140
|
+
map.on('error', function(event){
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'error', params: event }));
|
|
144
|
+
})
|
|
113
145
|
|
|
114
146
|
//movestart moveend
|
|
115
|
-
map.on("movestart",(event)
|
|
147
|
+
map.on("movestart", function(event){
|
|
116
148
|
if(params.turboWhileMoving){
|
|
117
149
|
setOverlayLayersVisibility(map, 'none');
|
|
118
150
|
}
|
|
119
151
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'movestart', params: getEventParams() }));
|
|
120
152
|
})
|
|
121
|
-
map.on("moveend",(event)
|
|
153
|
+
map.on("moveend", function(event){
|
|
122
154
|
if(params.turboWhileMoving){
|
|
123
155
|
setOverlayLayersVisibility(map, 'visible');
|
|
124
156
|
}
|
|
125
157
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'moveend', params: getEventParams() }));
|
|
126
158
|
})
|
|
127
159
|
/*zoomstart zoomend*/
|
|
128
|
-
map.on("zoomstart",(event)
|
|
160
|
+
map.on("zoomstart", function(event){
|
|
129
161
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomstart', params: getEventParams() }));
|
|
130
162
|
})
|
|
131
|
-
map.on("zoomend",(event)
|
|
163
|
+
map.on("zoomend", function(event){
|
|
132
164
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomend', params: getEventParams() }));
|
|
133
165
|
})
|
|
134
166
|
|
|
135
167
|
|
|
136
|
-
map.on("idle",(event)
|
|
168
|
+
map.on("idle", function(event){
|
|
137
169
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'idle', params: getEventParams() }));
|
|
138
170
|
})
|
|
139
171
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/initWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/initWeb.ts"],"mappings":";;AAAA,eAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export default /*js*/`
|
|
4
|
+
|
|
5
|
+
function centersAreEqual(a, b, epsilon = 1e-6) {
|
|
6
|
+
return (
|
|
7
|
+
Math.abs(a.lng - b[0]) < epsilon &&
|
|
8
|
+
Math.abs(a.lat - b[1]) < epsilon
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if(functionName === 'update') {
|
|
13
|
+
|
|
14
|
+
/* if(params && params.center) {
|
|
15
|
+
var newCenter = params.center;
|
|
16
|
+
var currentCenter = map.getCenter();
|
|
17
|
+
|
|
18
|
+
if (!centersAreEqual(currentCenter, newCenter)) {
|
|
19
|
+
map.setCenter(newCenter);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if(params && params.zoom != null) {
|
|
24
|
+
var newZoom = params.zoom;
|
|
25
|
+
var currentZoom = map.getZoom();
|
|
26
|
+
|
|
27
|
+
if(currentZoom !== newZoom) {
|
|
28
|
+
map.setZoom(newZoom);
|
|
29
|
+
}
|
|
30
|
+
}*/
|
|
31
|
+
|
|
32
|
+
if(params && params.minZoom != null) {
|
|
33
|
+
var newMinZoom = params.minZoom;
|
|
34
|
+
var currentMinZoom = map.getMinZoom();
|
|
35
|
+
|
|
36
|
+
if(currentMinZoom !== newMinZoom) {
|
|
37
|
+
map.setMinZoom(newMinZoom);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if(params && params.maxZoom != null) {
|
|
42
|
+
var newMaxZoom = params.maxZoom;
|
|
43
|
+
var currentMaxZoom = map.getMaxZoom();
|
|
44
|
+
|
|
45
|
+
if(currentMaxZoom !== newMaxZoom) {
|
|
46
|
+
map.setMaxZoom(newMaxZoom);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if(params && params.zoomEnabled != null) {
|
|
51
|
+
if(params.zoomEnabled) {
|
|
52
|
+
map.doubleClickZoom.enable();
|
|
53
|
+
map.touchZoomRotate.enable();
|
|
54
|
+
map.dragRotate.enable();
|
|
55
|
+
} else {
|
|
56
|
+
map.doubleClickZoom.disable();
|
|
57
|
+
map.touchZoomRotate.disable();
|
|
58
|
+
map.dragRotate.disable();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if(params && params.scrollEnabled != null) {
|
|
63
|
+
if(params.scrollEnabled) {
|
|
64
|
+
map.scrollZoom.enable();
|
|
65
|
+
map.dragPan.enable();
|
|
66
|
+
} else {
|
|
67
|
+
map.scrollZoom.disable();
|
|
68
|
+
map.dragPan.disable();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if(params && params.mapStyle) {
|
|
73
|
+
map.setStyle(params.mapStyle);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
//# sourceMappingURL=updateWeb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/webFunctions/updateWeb.ts"],"mappings":";;AAAA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapPlaceholder.d.ts","sourceRoot":"","sources":["../../../../src/components/MapPlaceholder.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapPlaceholder.d.ts","sourceRoot":"","sources":["../../../../src/components/MapPlaceholder.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,cAAc,GAAI,OAAO;IAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,4CAoCzD,CAAA;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -2,15 +2,21 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
2
2
|
import { type EventParams, type MarkerProps, type PolygonProps, type PolylineProps, type SourcesProps } from './types';
|
|
3
3
|
interface MapViewProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
|
|
5
|
+
placeholderTheme?: 'light' | 'dark';
|
|
6
6
|
center: [number, number];
|
|
7
7
|
zoom: number;
|
|
8
|
+
debugMode?: boolean;
|
|
9
|
+
autoFitBounds?: boolean;
|
|
10
|
+
fitBoundsPadding?: number;
|
|
11
|
+
fitBoundsDuration?: number;
|
|
12
|
+
flyToDuration?: number;
|
|
8
13
|
mapStyle: string;
|
|
9
14
|
style: StyleProp<ViewStyle>;
|
|
10
15
|
minZoom?: number;
|
|
11
16
|
maxZoom?: number;
|
|
12
17
|
zoomEnabled?: boolean;
|
|
13
18
|
scrollEnabled?: boolean;
|
|
19
|
+
onReady?: () => void;
|
|
14
20
|
onMoveStart?: (eventParams: EventParams) => void;
|
|
15
21
|
onMoveEnd?: (eventParams: EventParams) => void;
|
|
16
22
|
onZoomStart?: (eventParams: EventParams) => void;
|
|
@@ -26,6 +32,7 @@ interface MapViewProps {
|
|
|
26
32
|
}
|
|
27
33
|
export type MapViewRef = {
|
|
28
34
|
fitBounds: () => void;
|
|
35
|
+
flyTo: (center: [number, number], zoom: number) => void;
|
|
29
36
|
};
|
|
30
37
|
type MapViewRegistry = {
|
|
31
38
|
addMarker: (propsMarker: MarkerProps) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/components/MapView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/components/MapView.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,SAAS,EAGd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAKtB,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACpB,MAAM,SAAS,CAAC;AAwBjB,UAAU,YAAY;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAG3B,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,OAAO,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACvD,UAAU,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACvD,CAAC;AAIF,eAAO,MAAM,iBAAiB,uBAI7B,CAAC;AAwCF,eAAO,MAAM,OAAO,qGAoSlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,SAsBxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/components/Polygon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/components/Polygon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,SAsB1C,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type MarkerProps = {
|
|
2
|
+
ignoreFitBounds?: boolean;
|
|
2
3
|
uniqueId: string;
|
|
3
4
|
onPress?: () => void;
|
|
4
5
|
latitude: number;
|
|
@@ -7,6 +8,7 @@ export type MarkerProps = {
|
|
|
7
8
|
iconUrl?: string;
|
|
8
9
|
iconWidth?: number;
|
|
9
10
|
iconHeight?: number;
|
|
11
|
+
html?: string;
|
|
10
12
|
};
|
|
11
13
|
export type SourcesProps = {
|
|
12
14
|
maplibreJS: string;
|
|
@@ -14,6 +16,7 @@ export type SourcesProps = {
|
|
|
14
16
|
pmtilesJS: string;
|
|
15
17
|
};
|
|
16
18
|
export type PolygonProps = {
|
|
19
|
+
ignoreFitBounds?: boolean;
|
|
17
20
|
uniqueId: string;
|
|
18
21
|
coordinates: [number, number][];
|
|
19
22
|
fillColor?: string;
|
|
@@ -23,6 +26,7 @@ export type PolygonProps = {
|
|
|
23
26
|
strokeWidth?: number;
|
|
24
27
|
};
|
|
25
28
|
export type PolylineProps = {
|
|
29
|
+
ignoreFitBounds?: boolean;
|
|
26
30
|
uniqueId: string;
|
|
27
31
|
color?: string;
|
|
28
32
|
width?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CAEjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CAExB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAEnC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,MAAM,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAA;KACd,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,GAAU,KAAK,MAAM,oBA0B9C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webContent.d.ts","sourceRoot":"","sources":["../../../../src/components/webContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAG1C,eAAO,MAAM,eAAe,GAAU,cAAc,MAAM,EAAE,SAAS,YAAY,EAAE,WAAW,OAAO,oBA+JpG,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\n\n if(functionName === 'addMarker') {\n\n
|
|
1
|
+
declare const _default: "\n\n if(functionName === 'addMarker') {\n\n\n if(markers[params.uniqueId]){\n markers[params.uniqueId].remove();\n delete markers[params.uniqueId];\n }\n\n\n if(params && params.html){\n\n var el = document.createElement('div');\n el.className = 'marker';\n el.innerHTML = params.html;\n\n el.addEventListener('click', function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'markerClick',\n uniqueId: params.uniqueId\n }));\n });\n\n\n markers[params.uniqueId] = new maplibregl.Marker({element: el})\n .setLngLat([params.longitude, params.latitude])\n .addTo(map);\n\n return;\n\n }\n\n\n if(!params || !params.iconUrl){\n\n\n markers[params.uniqueId] = new maplibregl.Marker({\n color: (params.color != null) ? params.color : undefined,\n }).setLngLat([params.longitude, params.latitude])\n .addTo(map);\n markers[params.uniqueId].getElement().addEventListener('click', function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'markerClick',\n uniqueId: params.uniqueId\n }));\n });\n\n return;\n\n }else{\n\n\n var el2 = document.createElement('div');\n el2.className = 'marker';\n el2.style.backgroundImage = 'url(' + params.iconUrl + ')';\n el2.style.backgroundSize = 'cover';\n el2.style.backgroundPosition = 'center';\n el2.style.backgroundRepeat = 'no-repeat';\n el2.style.width = params.iconWidth + 'px';\n el2.style.height = params.iconHeight + 'px';\n\n el2.addEventListener('click', function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'markerClick',\n uniqueId: params.uniqueId\n }));\n });\n\n \n markers[params.uniqueId] = new maplibregl.Marker({element: el2})\n .setLngLat([params.longitude, params.latitude])\n .addTo(map);\n\n return;\n\n }\n }\n\n ";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=addMarkerWeb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addMarkerWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/addMarkerWeb.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"addMarkerWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/addMarkerWeb.ts"],"names":[],"mappings":";AAAA,wBA+Ec"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\n\nif(functionName === 'addPolyline') {\n\n \n\n var sourceId = params.uniqueId + '-polylines-source';\n var layerId = params.uniqueId + '-polylines-layout';\n\n if(map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n\n map.addSource(sourceId, {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': params.coordinates\n }\n }\n });\n\n map.addLayer({\n 'id': layerId,\n 'type': 'line',\n 'source': sourceId,\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': params.color
|
|
1
|
+
declare const _default: "\n\nif(functionName === 'addPolyline') {\n\n \n\n var sourceId = params.uniqueId + '-polylines-source';\n var layerId = params.uniqueId + '-polylines-layout';\n\n if(map.getLayer(layerId)) {\n map.removeLayer(layerId);\n }\n\n if(map.getSource(sourceId)) {\n map.removeSource(sourceId);\n }\n\n map.addSource(sourceId, {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': params.coordinates\n }\n }\n });\n\n map.addLayer({\n 'id': layerId,\n 'type': 'line',\n 'source': sourceId,\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': (params.color != null) ? params.color : '#000000',\n 'line-width': (params.width != null) ? params.width : 4\n }\n });\n\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=addPolylineWeb.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\n if(functionName === 'fitBounds') {\n map.fitBounds(params.bounds, {\n padding:
|
|
1
|
+
declare const _default: "\n if(functionName === 'fitBounds') {\n\n var padding = (params && params.padding) ? params.padding : 40;\n var duration = (params && params.duration) ? params.duration : 500;\n\n map.fitBounds(params.bounds, {\n padding: padding,\n duration: duration\n });\n }\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=fitBoundsWeb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fitBoundsWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/fitBoundsWeb.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"fitBoundsWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/fitBoundsWeb.ts"],"names":[],"mappings":";AAAA,wBAWE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flyToWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/flyToWeb.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,uQAUpB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\n\n if(functionName === 'init') {\n\n function simplifyStyle(mapInstance, aggressive){\n if(!mapInstance) return;\n var style = mapInstance.getStyle();\n var layers = style && style.layers ? style.layers : [];\n for(var i = 0; i < layers.length; i++){\n var layer = layers[i];\n var layerId = layer.id;\n var layerType = layer.type;\n var shouldHide = false;\n\n if(layerType === '
|
|
1
|
+
declare const _default: "\n\n if(functionName === 'init') {\n\n function simplifyStyle(mapInstance, aggressive){\n if(!mapInstance) return;\n var style = mapInstance.getStyle();\n var layers = style && style.layers ? style.layers : [];\n for(var i = 0; i < layers.length; i++){\n var layer = layers[i];\n var layerId = layer.id;\n var layerType = layer.type;\n var shouldHide = false;\n\n // Keep labels (streets / addresses) visible \u2014 hide only expensive visual layers by default.\n if(layerType === 'fill-extrusion' || layerType === 'hillshade'){\n shouldHide = true;\n }\n\n if(layerType === 'symbol' && aggressive){\n var idLower = String(layerId || '').toLowerCase();\n var sourceLayerLower = String(layer['source-layer'] || '').toLowerCase();\n\n // Keep road + address/house number labels.\n var keepLabel =\n idLower.indexOf('road') !== -1 ||\n idLower.indexOf('street') !== -1 ||\n idLower.indexOf('housenumber') !== -1 ||\n idLower.indexOf('house_number') !== -1 ||\n idLower.indexOf('house-number') !== -1 ||\n idLower.indexOf('address') !== -1 ||\n sourceLayerLower.indexOf('housenumber') !== -1 ||\n sourceLayerLower.indexOf('house') !== -1 ||\n sourceLayerLower.indexOf('address') !== -1;\n\n // Hide most POI/other symbols in aggressive mode.\n var hideSymbol =\n idLower.indexOf('poi') !== -1 ||\n idLower.indexOf('transit') !== -1 ||\n idLower.indexOf('airport') !== -1 ||\n idLower.indexOf('rail') !== -1 ||\n idLower.indexOf('ferry') !== -1;\n\n if(!keepLabel && hideSymbol){\n shouldHide = true;\n }\n }\n\n if(aggressive && (layerType === 'line' || layerType === 'circle')){\n var layerIdLower = String(layerId || '').toLowerCase();\n if(\n layerIdLower.indexOf('road-label') !== -1 ||\n layerIdLower.indexOf('poi') !== -1 ||\n layerIdLower.indexOf('label') !== -1 ||\n layerIdLower.indexOf('boundary') !== -1 ||\n layerIdLower.indexOf('admin') !== -1\n ){\n shouldHide = true;\n }\n }\n\n if(shouldHide){\n try{\n mapInstance.setLayoutProperty(layerId, 'visibility', 'none');\n } catch (_) {}\n }\n }\n }\n\n function setOverlayLayersVisibility(mapInstance, visibility){\n if(!mapInstance) return;\n var style = mapInstance.getStyle();\n var layers = style && style.layers ? style.layers : [];\n for(var i = 0; i < layers.length; i++){\n var layer = layers[i];\n var layerId = String(layer.id || '');\n var isCustomOverlay =\n layerId.indexOf('-polylines-layout') !== -1 ||\n layerId.indexOf('-polygons-fill') !== -1 ||\n layerId.indexOf('-polygons-stroke') !== -1;\n\n if(isCustomOverlay){\n try{\n mapInstance.setLayoutProperty(layerId, 'visibility', visibility);\n } catch (_) {}\n }\n }\n }\n\n\n\n\n map = new maplibregl.Map({\n container: 'map',\n style: params.mapStyle,\n center: params.center,\n zoom: params.zoom,\n scrollZoom: params.scrollEnabled,\n doubleClickZoom: params.zoomEnabled,\n touchZoomRotate: params.zoomEnabled,\n minZoom: params.minZoom,\n maxZoom: params.maxZoom,\n dragPan: params.scrollEnabled,\n dragRotate: params.zoomEnabled,\n antialias: params.antialias ?? false,\n crossSourceCollisions: params.crossSourceCollisions ?? true,\n fadeDuration: params.fadeDuration ?? 120,\n pixelRatio: params.pixelRatio,\n renderWorldCopies: params.renderWorldCopies ?? true\n });\n\n if (typeof params.maxPitch === 'number') {\n map.setMaxPitch(params.maxPitch);\n }\n\n if (params.maxPitch === 0) {\n map.dragRotate.disable();\n map.touchZoomRotate.disableRotation();\n }\n\n\n\n function getEventParams(){\n if(!map) return {\n center: null,\n zoom: null\n }\n var center = map.getCenter(); \n var zoom = map.getZoom();\n\n\n return {\n center: center,\n zoom: zoom\n }\n }\n\n map.on('error', function(event){\n\n \n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'error', params: event }));\n })\n \n //movestart moveend\n map.on(\"movestart\", function(event){\n if(params.turboWhileMoving){\n setOverlayLayersVisibility(map, 'none');\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'movestart', params: getEventParams() }));\n })\n map.on(\"moveend\", function(event){\n if(params.turboWhileMoving){\n setOverlayLayersVisibility(map, 'visible');\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'moveend', params: getEventParams() }));\n })\n /*zoomstart zoomend*/\n map.on(\"zoomstart\", function(event){\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomstart', params: getEventParams() }));\n })\n map.on(\"zoomend\", function(event){\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'zoomend', params: getEventParams() }));\n })\n \n\n map.on(\"idle\", function(event){\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'event', event: 'idle', params: getEventParams() }));\n })\n \n \n \n\n\n map.on('load', function () {\n if(params.simplifyStyle){\n simplifyStyle(map, Boolean(params.aggressiveSimplifyStyle));\n }\n \n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'inited' }));\n });\n\n\n \n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=initWeb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/initWeb.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"initWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/initWeb.ts"],"names":[],"mappings":";AAAA,wBAwLC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: "\n\n function centersAreEqual(a, b, epsilon = 1e-6) {\n return (\n Math.abs(a.lng - b[0]) < epsilon &&\n Math.abs(a.lat - b[1]) < epsilon\n );\n }\n\n if(functionName === 'update') {\n\n /* if(params && params.center) {\n var newCenter = params.center;\n var currentCenter = map.getCenter();\n\n if (!centersAreEqual(currentCenter, newCenter)) {\n map.setCenter(newCenter);\n }\n }\n\n if(params && params.zoom != null) {\n var newZoom = params.zoom;\n var currentZoom = map.getZoom();\n\n if(currentZoom !== newZoom) {\n map.setZoom(newZoom);\n }\n }*/\n\n if(params && params.minZoom != null) {\n var newMinZoom = params.minZoom;\n var currentMinZoom = map.getMinZoom();\n\n if(currentMinZoom !== newMinZoom) {\n map.setMinZoom(newMinZoom);\n }\n }\n\n if(params && params.maxZoom != null) {\n var newMaxZoom = params.maxZoom;\n var currentMaxZoom = map.getMaxZoom();\n\n if(currentMaxZoom !== newMaxZoom) {\n map.setMaxZoom(newMaxZoom);\n }\n }\n\n if(params && params.zoomEnabled != null) {\n if(params.zoomEnabled) {\n map.doubleClickZoom.enable();\n map.touchZoomRotate.enable();\n map.dragRotate.enable();\n } else {\n map.doubleClickZoom.disable();\n map.touchZoomRotate.disable();\n map.dragRotate.disable();\n }\n }\n\n if(params && params.scrollEnabled != null) {\n if(params.scrollEnabled) {\n map.scrollZoom.enable();\n map.dragPan.enable();\n } else {\n map.scrollZoom.disable();\n map.dragPan.disable();\n }\n }\n\n if(params && params.mapStyle) {\n map.setStyle(params.mapStyle);\n }\n\n }\n";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=updateWeb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateWeb.d.ts","sourceRoot":"","sources":["../../../../../src/components/webFunctions/updateWeb.ts"],"names":[],"mappings":";AAAA,wBA0EE"}
|
|
@@ -5,5 +5,5 @@ import { Polyline } from './components/Polyline';
|
|
|
5
5
|
export { MapView, Marker, Polygon, Polyline };
|
|
6
6
|
export default MapView;
|
|
7
7
|
export type { MapViewRef } from './components/MapView';
|
|
8
|
-
export type { MarkerProps, PolygonProps, PolylineProps, EventParams } from './components/types';
|
|
8
|
+
export type { MarkerProps, PolygonProps, PolylineProps, EventParams, SourcesProps } from './components/types';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC9C,eAAe,OAAO,CAAC;AAEvB,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC9C,eAAe,OAAO,CAAC;AAEvB,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
useEffect,
|
|
3
|
+
useRef,
|
|
4
|
+
} from 'react';
|
|
5
|
+
|
|
6
|
+
import { Animated } from 'react-native';
|
|
3
7
|
|
|
4
8
|
import { MAP_ASSETS } from '../assets/MAP_ASSETS';
|
|
5
9
|
|
|
@@ -10,12 +14,12 @@ const MapPlaceholder = (props: { theme: 'dark' | 'light' }) => {
|
|
|
10
14
|
const animate = () => {
|
|
11
15
|
Animated.sequence([
|
|
12
16
|
Animated.timing(opacityAnim, {
|
|
13
|
-
toValue:
|
|
17
|
+
toValue: 0.6,
|
|
14
18
|
duration: 1000,
|
|
15
19
|
useNativeDriver: true,
|
|
16
20
|
}),
|
|
17
21
|
Animated.timing(opacityAnim, {
|
|
18
|
-
toValue: 0.
|
|
22
|
+
toValue: 0.1,
|
|
19
23
|
duration: 1000,
|
|
20
24
|
useNativeDriver: true,
|
|
21
25
|
}),
|
|
@@ -34,7 +38,7 @@ const MapPlaceholder = (props: { theme: 'dark' | 'light' }) => {
|
|
|
34
38
|
left: 0,
|
|
35
39
|
width: '100%',
|
|
36
40
|
height: '100%',
|
|
37
|
-
|
|
41
|
+
|
|
38
42
|
opacity: opacityAnim,
|
|
39
43
|
}}
|
|
40
44
|
/>
|