@lugg/maps 1.0.0-beta.8 → 1.0.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/README.md +15 -100
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +5 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +41 -0
- package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +14 -0
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +27 -2
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +7 -2
- package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +3 -23
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +307 -41
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +1 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +65 -11
- package/ios/LuggMapView.mm +170 -2
- package/ios/LuggMapWrapperView.h +5 -0
- package/ios/LuggMapWrapperView.mm +18 -0
- package/ios/LuggMarkerView.mm +2 -0
- package/ios/core/AppleMapProvider.h +8 -0
- package/ios/core/AppleMapProvider.mm +48 -31
- package/ios/core/AppleStaticMapProvider.h +14 -0
- package/ios/core/AppleStaticMapProvider.mm +159 -0
- package/ios/core/GMSPolylineAnimator.m +46 -18
- package/ios/core/GoogleMapProvider.h +10 -0
- package/ios/core/GoogleMapProvider.mm +56 -44
- package/ios/core/GoogleStaticMapProvider.h +21 -0
- package/ios/core/GoogleStaticMapProvider.mm +213 -0
- package/ios/core/MKPolylineAnimator.m +67 -43
- package/ios/core/MapProviderDelegate.h +7 -0
- package/ios/core/StaticMapProviderBase.h +75 -0
- package/ios/core/StaticMapProviderBase.mm +845 -0
- package/ios/events/CameraIdleEvent.h +4 -2
- package/ios/events/CameraMoveEvent.h +4 -2
- package/ios/events/CirclePressEvent.h +4 -2
- package/ios/events/GroundOverlayPressEvent.h +4 -2
- package/ios/events/LongPressEvent.h +4 -2
- package/ios/events/MarkerDragEvent.h +12 -6
- package/ios/events/MarkerPressEvent.h +4 -2
- package/ios/events/PolygonPressEvent.h +4 -2
- package/ios/events/PressEvent.h +4 -2
- package/ios/events/ReadyEvent.h +4 -2
- package/ios/events/TileOverlayPressEvent.h +4 -2
- package/ios/extensions/MKMapView+Zoom.h +20 -0
- package/ios/extensions/MKMapView+Zoom.m +28 -18
- package/ios/extensions/UIView+Snapshot.h +16 -0
- package/ios/extensions/UIView+Snapshot.m +27 -0
- package/lib/module/MapView.js +7 -0
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +9 -4
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/fabric/LuggMapViewNativeComponent.ts +7 -4
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +24 -0
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +7 -4
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
- package/package.json +19 -12
- package/src/MapView.tsx +7 -0
- package/src/MapView.types.ts +24 -0
- package/src/MapView.web.tsx +15 -9
- package/src/fabric/LuggMapViewNativeComponent.ts +7 -4
- package/plugin/build/withMapsAndroid.d.ts +0 -5
- package/plugin/build/withMapsAndroid.js +0 -15
- package/plugin/build/withMapsIOS.d.ts +0 -5
- package/plugin/build/withMapsIOS.js +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,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AC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,M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M,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"bare": "yarn workspace @lugg/bare-example",
|
|
44
44
|
"expo": "yarn workspace @lugg/expo-example",
|
|
45
|
+
"docs": "yarn workspace @lugg/docs",
|
|
45
46
|
"test": "jest",
|
|
46
47
|
"typecheck": "tsc",
|
|
47
48
|
"lint": "eslint --fix \"**/*.{ts,tsx}\"",
|
|
@@ -50,7 +51,8 @@
|
|
|
50
51
|
"clean": "scripts/clean.sh",
|
|
51
52
|
"prepare": "bob build && yarn build:plugin",
|
|
52
53
|
"build:plugin": "tsc --project plugin",
|
|
53
|
-
"release": "release-it
|
|
54
|
+
"release": "release-it",
|
|
55
|
+
"release:beta": "yarn release --preRelease=beta --no-github.release"
|
|
54
56
|
},
|
|
55
57
|
"keywords": [
|
|
56
58
|
"react-native",
|
|
@@ -75,8 +77,10 @@
|
|
|
75
77
|
"@eslint/compat": "^1.3.2",
|
|
76
78
|
"@eslint/eslintrc": "^3.3.1",
|
|
77
79
|
"@eslint/js": "^9.35.0",
|
|
78
|
-
"@
|
|
79
|
-
"@react-native/
|
|
80
|
+
"@expo/config-plugins": "^56.0.8",
|
|
81
|
+
"@react-native/babel-preset": "0.85.3",
|
|
82
|
+
"@react-native/eslint-config": "0.85.3",
|
|
83
|
+
"@react-native/jest-preset": "0.85.3",
|
|
80
84
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
81
85
|
"@types/jest": "^29.5.14",
|
|
82
86
|
"@types/react": "^19.2.0",
|
|
@@ -89,33 +93,35 @@
|
|
|
89
93
|
"jest": "^29.7.0",
|
|
90
94
|
"lefthook": "^2.0.3",
|
|
91
95
|
"prettier": "^2.8.8",
|
|
92
|
-
"react": "19.2.
|
|
93
|
-
"react-native": "0.
|
|
96
|
+
"react": "19.2.3",
|
|
97
|
+
"react-native": "0.85.3",
|
|
94
98
|
"react-native-builder-bob": "^0.40.13",
|
|
95
99
|
"release-it": "^19.0.4",
|
|
96
100
|
"turbo": "^2.5.6",
|
|
97
101
|
"typescript": "^5.9.2"
|
|
98
102
|
},
|
|
99
103
|
"resolutions": {
|
|
100
|
-
"@lodev09/react-native-true-sheet": "3.
|
|
104
|
+
"@lodev09/react-native-true-sheet": "3.11.0-beta.10"
|
|
101
105
|
},
|
|
102
106
|
"peerDependencies": {
|
|
103
107
|
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
108
|
+
"expo": "*",
|
|
104
109
|
"react": "*",
|
|
105
110
|
"react-native": "*"
|
|
106
111
|
},
|
|
107
112
|
"peerDependenciesMeta": {
|
|
108
113
|
"@vis.gl/react-google-maps": {
|
|
109
114
|
"optional": true
|
|
115
|
+
},
|
|
116
|
+
"expo": {
|
|
117
|
+
"optional": true
|
|
110
118
|
}
|
|
111
119
|
},
|
|
112
|
-
"dependencies": {
|
|
113
|
-
"@expo/config-plugins": "^9.0.0"
|
|
114
|
-
},
|
|
115
120
|
"workspaces": [
|
|
116
121
|
"example/bare",
|
|
117
122
|
"example/expo",
|
|
118
|
-
"example/shared"
|
|
123
|
+
"example/shared",
|
|
124
|
+
"docs"
|
|
119
125
|
],
|
|
120
126
|
"packageManager": "yarn@4.11.0",
|
|
121
127
|
"react-native-builder-bob": {
|
|
@@ -158,9 +164,10 @@
|
|
|
158
164
|
}
|
|
159
165
|
},
|
|
160
166
|
"jest": {
|
|
161
|
-
"preset": "react-native",
|
|
167
|
+
"preset": "@react-native/jest-preset",
|
|
162
168
|
"modulePathIgnorePatterns": [
|
|
163
169
|
"<rootDir>/example/bare/node_modules",
|
|
170
|
+
"<rootDir>/docs/",
|
|
164
171
|
"<rootDir>/lib/"
|
|
165
172
|
]
|
|
166
173
|
},
|
package/src/MapView.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export class MapView
|
|
|
25
25
|
scrollEnabled: true,
|
|
26
26
|
rotateEnabled: true,
|
|
27
27
|
pitchEnabled: true,
|
|
28
|
+
compassEnabled: true,
|
|
28
29
|
poiEnabled: true,
|
|
29
30
|
theme: 'system',
|
|
30
31
|
};
|
|
@@ -92,6 +93,9 @@ export class MapView
|
|
|
92
93
|
scrollEnabled,
|
|
93
94
|
rotateEnabled,
|
|
94
95
|
pitchEnabled,
|
|
96
|
+
compassEnabled,
|
|
97
|
+
staticMode,
|
|
98
|
+
staticKey,
|
|
95
99
|
edgeInsets,
|
|
96
100
|
userLocationEnabled,
|
|
97
101
|
userLocationButtonEnabled,
|
|
@@ -123,6 +127,9 @@ export class MapView
|
|
|
123
127
|
scrollEnabled={scrollEnabled}
|
|
124
128
|
rotateEnabled={rotateEnabled}
|
|
125
129
|
pitchEnabled={pitchEnabled}
|
|
130
|
+
compassEnabled={compassEnabled}
|
|
131
|
+
staticMode={staticMode}
|
|
132
|
+
staticKey={staticKey}
|
|
126
133
|
edgeInsets={edgeInsets}
|
|
127
134
|
userLocationEnabled={userLocationEnabled}
|
|
128
135
|
userLocationButtonEnabled={userLocationButtonEnabled}
|
package/src/MapView.types.ts
CHANGED
|
@@ -204,6 +204,30 @@ export interface MapViewProps extends ViewProps {
|
|
|
204
204
|
* @default true
|
|
205
205
|
*/
|
|
206
206
|
pitchEnabled?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Show compass on the map.
|
|
209
|
+
* On web (Google Maps) this toggles the rotate/compass control.
|
|
210
|
+
* @default true
|
|
211
|
+
*/
|
|
212
|
+
compassEnabled?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Render the map as a non-interactive, static map.
|
|
215
|
+
* Uses Google Maps lite mode on Android. On iOS, the map is replaced
|
|
216
|
+
* with a rendered snapshot once tiles finish loading, releasing the
|
|
217
|
+
* live map resources. Ideal for maps inside list views.
|
|
218
|
+
* Cannot be changed after the map is created.
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
staticMode?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Stable identity for the static snapshot cache (iOS). When set, a map
|
|
224
|
+
* remounted with the same key (and same size, provider, and map settings)
|
|
225
|
+
* reuses its cached snapshot instead of rendering a live map again -
|
|
226
|
+
* e.g. set it to your list item's id. The key must uniquely identify the
|
|
227
|
+
* map's content, including markers and other children.
|
|
228
|
+
* Only used with staticMode.
|
|
229
|
+
*/
|
|
230
|
+
staticKey?: string;
|
|
207
231
|
/**
|
|
208
232
|
* Map content edge insets
|
|
209
233
|
*/
|
package/src/MapView.web.tsx
CHANGED
|
@@ -110,6 +110,8 @@ export const MapView = memo(
|
|
|
110
110
|
zoomEnabled = true,
|
|
111
111
|
scrollEnabled = true,
|
|
112
112
|
pitchEnabled = true,
|
|
113
|
+
compassEnabled = true,
|
|
114
|
+
staticMode = false,
|
|
113
115
|
edgeInsets,
|
|
114
116
|
userLocationEnabled,
|
|
115
117
|
theme = 'system',
|
|
@@ -367,7 +369,7 @@ export const MapView = memo(
|
|
|
367
369
|
}, []);
|
|
368
370
|
|
|
369
371
|
useEffect(() => {
|
|
370
|
-
if (!map || !onLongPress) return;
|
|
372
|
+
if (!map || !onLongPress || staticMode) return;
|
|
371
373
|
const listeners = [
|
|
372
374
|
map.addListener('mousedown', handleMouseDown),
|
|
373
375
|
map.addListener('mouseup', handleMouseUp),
|
|
@@ -376,7 +378,7 @@ export const MapView = memo(
|
|
|
376
378
|
listeners.forEach((l) => google.maps.event.removeListener(l));
|
|
377
379
|
handleMouseUp();
|
|
378
380
|
};
|
|
379
|
-
}, [map, onLongPress, handleMouseDown, handleMouseUp]);
|
|
381
|
+
}, [map, onLongPress, staticMode, handleMouseDown, handleMouseUp]);
|
|
380
382
|
|
|
381
383
|
const handleDragStart = useCallback(() => {
|
|
382
384
|
handleMouseUp();
|
|
@@ -445,12 +447,13 @@ export const MapView = memo(
|
|
|
445
447
|
? 'hybrid'
|
|
446
448
|
: 'roadmap';
|
|
447
449
|
|
|
448
|
-
const gestureHandling =
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
450
|
+
const gestureHandling = staticMode
|
|
451
|
+
? 'none'
|
|
452
|
+
: scrollEnabled === false && zoomEnabled === false
|
|
453
|
+
? 'none'
|
|
454
|
+
: scrollEnabled === false
|
|
455
|
+
? 'cooperative'
|
|
456
|
+
: 'auto';
|
|
454
457
|
|
|
455
458
|
const colorScheme =
|
|
456
459
|
theme === 'dark'
|
|
@@ -488,9 +491,12 @@ export const MapView = memo(
|
|
|
488
491
|
gestureHandling={gestureHandling}
|
|
489
492
|
colorScheme={colorScheme}
|
|
490
493
|
disableDefaultUI
|
|
494
|
+
rotateControl={staticMode ? false : compassEnabled}
|
|
495
|
+
clickableIcons={!staticMode}
|
|
496
|
+
keyboardShortcuts={!staticMode}
|
|
491
497
|
isFractionalZoomEnabled
|
|
492
498
|
tilt={pitchEnabled === false ? 0 : undefined}
|
|
493
|
-
onClick={handleClick}
|
|
499
|
+
onClick={staticMode ? undefined : handleClick}
|
|
494
500
|
onDragstart={handleDragStart}
|
|
495
501
|
onDragend={handleDragEnd}
|
|
496
502
|
onCameraChanged={handleCameraChanged}
|
|
@@ -71,10 +71,13 @@ export interface NativeProps extends ViewProps {
|
|
|
71
71
|
initialZoom?: Double;
|
|
72
72
|
minZoom?: Double;
|
|
73
73
|
maxZoom?: Double;
|
|
74
|
-
zoomEnabled?: boolean
|
|
75
|
-
scrollEnabled?: boolean
|
|
76
|
-
rotateEnabled?: boolean
|
|
77
|
-
pitchEnabled?: boolean
|
|
74
|
+
zoomEnabled?: WithDefault<boolean, true>;
|
|
75
|
+
scrollEnabled?: WithDefault<boolean, true>;
|
|
76
|
+
rotateEnabled?: WithDefault<boolean, true>;
|
|
77
|
+
pitchEnabled?: WithDefault<boolean, true>;
|
|
78
|
+
compassEnabled?: WithDefault<boolean, true>;
|
|
79
|
+
staticMode?: boolean;
|
|
80
|
+
staticKey?: string;
|
|
78
81
|
edgeInsets?: EdgeInsets;
|
|
79
82
|
userLocationEnabled?: boolean;
|
|
80
83
|
userLocationButtonEnabled?: boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withLuggMapsAndroid = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const withLuggMapsAndroid = (config, { apiKey }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return config;
|
|
8
|
-
}
|
|
9
|
-
return (0, config_plugins_1.withAndroidManifest)(config, (c) => {
|
|
10
|
-
const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(c.modResults);
|
|
11
|
-
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'com.google.android.geo.API_KEY', apiKey);
|
|
12
|
-
return c;
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
exports.withLuggMapsAndroid = withLuggMapsAndroid;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withLuggMapsIOS = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
-
const withLuggMapsIOS = (config, { apiKey }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return config;
|
|
8
|
-
}
|
|
9
|
-
config = (0, config_plugins_1.withInfoPlist)(config, (c) => {
|
|
10
|
-
c.modResults.GMSApiKey = apiKey;
|
|
11
|
-
return c;
|
|
12
|
-
});
|
|
13
|
-
config = (0, config_plugins_1.withAppDelegate)(config, (c) => {
|
|
14
|
-
const contents = c.modResults.contents;
|
|
15
|
-
// Add import for GoogleMaps
|
|
16
|
-
if (!contents.includes('import GoogleMaps')) {
|
|
17
|
-
c.modResults.contents = contents.replace(/(import (?:UIKit|Expo))/, '$1\nimport GoogleMaps');
|
|
18
|
-
}
|
|
19
|
-
// Add GMSServices.provideAPIKey call
|
|
20
|
-
if (!c.modResults.contents.includes('GMSServices.provideAPIKey')) {
|
|
21
|
-
c.modResults.contents = c.modResults.contents.replace(/(func application\([^)]+\)[^{]*\{)/, `$1\n GMSServices.provideAPIKey("${apiKey}")\n`);
|
|
22
|
-
}
|
|
23
|
-
return c;
|
|
24
|
-
});
|
|
25
|
-
return config;
|
|
26
|
-
};
|
|
27
|
-
exports.withLuggMapsIOS = withLuggMapsIOS;
|