expo-maps 1.0.0-canary-20240912-1059f85 → 1.0.0-canary-20240927-ab8a962
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 +8 -1
- package/android/src/main/java/expo/modules/maps/ExpoGoogleMapsModule.kt +2 -2
- package/build/ExpoMaps.d.ts +2 -2
- package/build/ExpoMaps.d.ts.map +1 -1
- package/build/ExpoMaps.js +3 -3
- package/build/ExpoMaps.js.map +1 -1
- package/build/Map.d.ts.map +1 -1
- package/build/Map.js +0 -6
- package/build/Map.js.map +1 -1
- package/build/NativeExpoMapView.d.ts +2 -2
- package/build/NativeExpoMapView.d.ts.map +1 -1
- package/build/NativeExpoMapView.js +3 -3
- package/build/NativeExpoMapView.js.map +1 -1
- package/package.json +5 -5
- package/src/ExpoMaps.ts +3 -3
- package/src/Map.tsx +0 -10
- package/src/NativeExpoMapView.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -11,11 +11,18 @@
|
|
|
11
11
|
### 🐛 Bug fixes
|
|
12
12
|
|
|
13
13
|
- Removed usage of reserved keyword `module`. ([#30010](https://github.com/expo/expo/pull/30010) by [@EvanBacon](https://github.com/EvanBacon))
|
|
14
|
-
Add missing `react` and `react-native` peer dependencies for isolated modules. ([#30475](https://github.com/expo/expo/pull/30475) by [@byCedric](https://github.com/byCedric))
|
|
14
|
+
- Add missing `react` and `react-native` peer dependencies for isolated modules. ([#30475](https://github.com/expo/expo/pull/30475) by [@byCedric](https://github.com/byCedric))
|
|
15
15
|
|
|
16
16
|
### 💡 Others
|
|
17
17
|
|
|
18
18
|
- Removed redundant usage of `EventEmitter` instance. ([#28946](https://github.com/expo/expo/pull/28946) by [@tsapeta](https://github.com/tsapeta))
|
|
19
|
+
- Removed all `NativeModulesProxy` occurrences. ([#31496](https://github.com/expo/expo/pull/31496) by [@reichhartd](https://github.com/reichhartd))
|
|
20
|
+
- Removed old `Platform.Version` checks. ([#31557](https://github.com/expo/expo/pull/31557) by [@reichhartd](https://github.com/reichhartd))
|
|
21
|
+
|
|
22
|
+
## 0.5.0 - 2024-09-23
|
|
23
|
+
|
|
24
|
+
### 💡 Others
|
|
25
|
+
|
|
19
26
|
- drop unused web `name` property. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
|
|
20
27
|
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
|
|
21
28
|
|
|
@@ -16,7 +16,7 @@ class ExpoGoogleMapsModule : Module() {
|
|
|
16
16
|
AsyncFunction("getSearchCompletions") { viewHandle: Int, searchQueryFragment: String, promise: Promise ->
|
|
17
17
|
val rnContext = appContext.reactContext as? ReactApplicationContext ?: return@AsyncFunction
|
|
18
18
|
val uiManager = rnContext.getNativeModule(UIManagerModule::class.java) ?: return@AsyncFunction
|
|
19
|
-
appContext.
|
|
19
|
+
appContext.throwingActivity.runOnUiThread {
|
|
20
20
|
val view = uiManager.resolveView(viewHandle) as GoogleMapsView
|
|
21
21
|
view.fetchPlacesSearchCompletions(searchQueryFragment, promise)
|
|
22
22
|
}
|
|
@@ -24,7 +24,7 @@ class ExpoGoogleMapsModule : Module() {
|
|
|
24
24
|
AsyncFunction("moveCamera") { viewHandle: Int, cameraPosition: CameraMoveRecord, promise: Promise ->
|
|
25
25
|
val rnContext = appContext.reactContext as? ReactApplicationContext ?: return@AsyncFunction
|
|
26
26
|
val uiManager = rnContext.getNativeModule(UIManagerModule::class.java) ?: return@AsyncFunction
|
|
27
|
-
appContext.
|
|
27
|
+
appContext.throwingActivity.runOnUiThread {
|
|
28
28
|
val view = uiManager.resolveView(viewHandle) as GoogleMapsView
|
|
29
29
|
view.moveCamera(cameraPosition, promise)
|
|
30
30
|
}
|
package/build/ExpoMaps.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const NativeExpoAppleMapsModule:
|
|
2
|
-
export declare const NativeExpoGoogleMapsModule:
|
|
1
|
+
export declare const NativeExpoAppleMapsModule: any;
|
|
2
|
+
export declare const NativeExpoGoogleMapsModule: any;
|
|
3
3
|
//# sourceMappingURL=ExpoMaps.d.ts.map
|
package/build/ExpoMaps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoMaps.d.ts","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"ExpoMaps.d.ts","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,KAAuC,CAAC;AAC9E,eAAO,MAAM,0BAA0B,KAAwC,CAAC"}
|
package/build/ExpoMaps.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const NativeExpoAppleMapsModule =
|
|
3
|
-
export const NativeExpoGoogleMapsModule =
|
|
1
|
+
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
export const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');
|
|
3
|
+
export const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');
|
|
4
4
|
//# sourceMappingURL=ExpoMaps.js.map
|
package/build/ExpoMaps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoMaps.js","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ExpoMaps.js","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nexport const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');\nexport const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');\n"]}
|
package/build/Map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.d.ts","sourceRoot":"","sources":["../src/Map.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAiC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAS5F,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,UAAU,CAAC;AA8BzB;;;;GAIG;AACH,qBAAa,OAAQ,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAC5D,KAAK,EAAE,YAAY,CAUjB;IACF,UAAU,UAAS;IACnB,OAAO,2BAA8B;IAErC,oBAAoB,CAAC,aAAa,EAAE,MAAM;IAmBpC,UAAU,CAAC,UAAU,EAAE,UAAU;IAWvC,iBAAiB;IAKjB,oBAAoB;IAIpB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.js
CHANGED
|
@@ -156,12 +156,6 @@ export class ExpoMap extends React.Component {
|
|
|
156
156
|
}
|
|
157
157
|
render() {
|
|
158
158
|
if (Platform.OS === 'ios' && this.props.provider === 'apple') {
|
|
159
|
-
if (parseInt(Platform.Version, 10) < 13 && this.state.geojsons.length > 0) {
|
|
160
|
-
console.warn("Versions of iOS < 13 doesn't support GeoJSON features for Apple Maps. Adding of GeoJSON for these versions will be omitted.");
|
|
161
|
-
}
|
|
162
|
-
if (parseInt(Platform.Version, 10) < 13) {
|
|
163
|
-
console.warn("Versions of iOS < 13 doesn't support Points Of Interest Filters and their display modifications for Apple Maps. Adding POI filters for these versions will be omitted.");
|
|
164
|
-
}
|
|
165
159
|
return (<NativeExpoAppleMapsView {...defaultNativeExpoMapViewProps} {...this.props} markers={this.state.markers} polygons={this.state.polygons} polylines={this.state.polylines} circles={this.state.circles} clusters={this.state.clusters} kmls={this.state.kmls} geojsons={this.state.geojsons} ref={this.mapView}/>);
|
|
166
160
|
}
|
|
167
161
|
let googleMapsJsonStyleString = this.props.googleMapsJsonStyleString
|
package/build/Map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../src/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OA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,CAAC,CAC9B,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAClB,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAC9B,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { ProxyNativeModule, requireNativeModule } from 'expo-modules-core';\nimport React from 'react';\nimport { Platform, findNodeHandle } from 'react-native';\n\nimport { CameraMove } from './Common.types';\nimport { DefaultNativeExpoMapViewProps, ExpoMapState, ExpoMapViewProps } from './Map.types';\nimport {\n NativeExpoAppleMapsView,\n NativeExpoAppleMapsModule,\n NativeExpoGoogleMapsView,\n NativeExpoGoogleMapsModule,\n} from './NativeExpoMapView';\nimport * as Utils from './Utils';\n\nexport { Marker } from './Marker';\nexport { Polygon } from './Polygon';\nexport { Polyline } from './Polyline';\nexport { Circle } from './Circle';\nexport { Cluster } from './Cluster';\nexport { KML } from './KML';\nexport { GeoJson } from './GeoJson';\nexport { Overlay } from './Overlay';\nexport { ExpoMapRef } from './Map.types';\nexport { POICategoryType } from './Map.types';\nexport { Heatmap } from './Heatmap';\nexport * from './Events';\n\nconst defaultNativeExpoMapViewProps: DefaultNativeExpoMapViewProps = {\n mapType: 'normal',\n showZoomControls: true,\n showCompass: true,\n showMapToolbar: true,\n showMyLocationButton: true,\n showLevelPicker: true,\n enableRotateGestures: false,\n enableScrollGestures: true,\n enableTiltGestures: false,\n enableZoomGestures: true,\n initialCameraPosition: {\n target: {\n latitude: 51.51,\n longitude: 0.13,\n },\n zoom: 4,\n animate: true,\n duration: 1000,\n },\n enableTraffic: false,\n enablePOISearching: false,\n enablePOIs: false,\n enablePOIFilter: [],\n createPOISearchRequest: '',\n clickablePOIs: true,\n};\n\n/**\n * Main map component of Expo Maps library.\n *\n * See {@link ExpoMapViewProps} to learn more about props.\n */\nexport class ExpoMap extends React.Component<ExpoMapViewProps> {\n state: ExpoMapState = {\n markers: [],\n polygons: [],\n polylines: [],\n circles: [],\n clusters: [],\n kmls: [],\n geojsons: [],\n overlays: [],\n heatmaps: [],\n };\n _ismounted = false;\n mapView = React.createRef<ExpoMap>();\n\n getSearchCompletions(queryFragment: string) {\n const nodeHandle = findNodeHandle(this.mapView.current);\n let nativeModule: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n nativeModule = NativeExpoAppleMapsModule;\n } else {\n nativeModule = NativeExpoGoogleMapsModule;\n }\n\n nativeModule\n .getSearchCompletions(nodeHandle, queryFragment)\n .then((response: [string]) => {\n console.log(response);\n })\n .catch((error: Error) => {\n console.log('Error with message: ' + error.message);\n });\n }\n\n async moveCamera(cameraMove: CameraMove) {\n const nodeHandle = findNodeHandle(this.mapView.current);\n let nativeModule: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n nativeModule = requireNativeModule('ExpoAppleMaps');\n } else {\n nativeModule = requireNativeModule('ExpoGoogleMaps');\n }\n return nativeModule.moveCamera(nodeHandle, cameraMove);\n }\n\n componentDidMount() {\n this.mapChildren();\n this._ismounted = true;\n }\n\n componentWillUnmount() {\n this._ismounted = false;\n }\n\n componentDidUpdate(_, prevState: ExpoMapState) {\n if (Object.is(this.state, prevState)) {\n this.mapChildren();\n }\n }\n\n private async mapChildren() {\n const childrenArray = React.Children.map(this.props.children, async (child) => {\n if (!Utils.isSimpleType(child)) {\n if (Utils.isMarker(child)) {\n return Utils.buildMarkerObject(child);\n } else if (Utils.isPolygon(child)) {\n return Utils.buildPolygonObject(child);\n } else if (Utils.isPolyline(child)) {\n return Utils.buildPolylineObject(child);\n } else if (Utils.isCircle(child)) {\n return Utils.buildCircleObject(child);\n } else if (Utils.isKML(child)) {\n return Utils.buildKMLObject(child);\n } else if (Utils.isGeoJson(child)) {\n return Utils.buildGeoJsonObject(child);\n } else if (Utils.isCluster(child)) {\n return Utils.buildClusterObject(child);\n } else if (Utils.isOverlay(child)) {\n return Utils.buildOverlayObject(child);\n } else if (Utils.isHeatmap(child)) {\n return Utils.buildHeatmapObject(child);\n }\n Utils.warnIfChildIsIncompatible(child);\n return null;\n }\n Utils.warnIfChildIsIncompatible(child);\n return null;\n });\n\n if (childrenArray !== undefined) {\n // TODO(@lukmccall): remove any cast\n const propObjects = await Promise.all(childrenArray as any);\n if (this._ismounted) {\n this.setState({\n markers: propObjects.filter((elem) => elem?.type === 'marker'),\n polygons: propObjects.filter((elem) => elem?.type === 'polygon'),\n polylines: propObjects.filter((elem) => elem?.type === 'polyline'),\n circles: propObjects.filter((elem) => elem?.type === 'circle'),\n clusters: propObjects.filter((elem) => elem?.type === 'cluster'),\n kmls: propObjects.filter((elem) => elem?.type === 'kml'),\n geojsons: propObjects.filter((elem) => elem?.type === 'geojson'),\n overlays: propObjects.filter((elem) => elem?.type === 'overlay'),\n heatmaps: propObjects.filter((elem) => elem?.type === 'heatmap'),\n });\n }\n }\n }\n\n render() {\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n if (parseInt(Platform.Version, 10) < 13 && this.state.geojsons.length > 0) {\n console.warn(\n \"Versions of iOS < 13 doesn't support GeoJSON features for Apple Maps. Adding of GeoJSON for these versions will be omitted.\"\n );\n }\n if (parseInt(Platform.Version, 10) < 13) {\n console.warn(\n \"Versions of iOS < 13 doesn't support Points Of Interest Filters and their display modifications for Apple Maps. Adding POI filters for these versions will be omitted.\"\n );\n }\n return (\n <NativeExpoAppleMapsView\n {...defaultNativeExpoMapViewProps}\n {...this.props}\n markers={this.state.markers}\n polygons={this.state.polygons}\n polylines={this.state.polylines}\n circles={this.state.circles}\n clusters={this.state.clusters}\n kmls={this.state.kmls}\n geojsons={this.state.geojsons}\n ref={this.mapView}\n />\n );\n }\n\n let googleMapsJsonStyleString = this.props.googleMapsJsonStyleString\n ? this.props.googleMapsJsonStyleString\n : '';\n if (this.props.enablePOIs === false) {\n if (this.props.googleMapsJsonStyleString) {\n console.warn(\n \"Expo Maps enablePOIs prop isn't effective when custom Google Maps map style is active. Please adjust your style manually to disable the POIs. https://developers.google.com/maps/documentation/ios-sdk/poi\"\n );\n } else {\n googleMapsJsonStyleString = JSON.stringify([\n {\n featureType: 'poi',\n stylers: [{ visibility: 'off' }],\n },\n ]);\n }\n }\n\n return (\n <NativeExpoGoogleMapsView\n {...defaultNativeExpoMapViewProps}\n {...this.props}\n googleMapsJsonStyleString={googleMapsJsonStyleString}\n markers={this.state.markers}\n polygons={this.state.polygons}\n polylines={this.state.polylines}\n circles={this.state.circles}\n clusters={this.state.clusters}\n kmls={this.state.kmls}\n geojsons={this.state.geojsons}\n ref={this.mapView}\n overlays={this.state.overlays}\n heatmaps={this.state.heatmaps}\n />\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../src/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5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C,KAAK,CAAC,UAAU,KAAK,KAAK,EAAE;YACnC,IAAI,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE;gBACxC,OAAO,CAAC,IAAI,CACV,4MAA4M,CAC7M,CAAC;aACH;iBAAM;gBACL,yBAAyB,GAAG,IAAI,CAAC,SAAS,CAAC;oBACzC;wBACE,WAAW,EAAE,KAAK;wBAClB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;qBACjC;iBACF,CAAC,CAAC;aACJ;SACF;QAED,OAAO,CACL,CAAC,wBAAwB,CACvB,IAAI,6BAA6B,CAAC,CAClC,IAAI,IAAI,CAAC,KAAK,CAAC,CACf,yBAAyB,CAAC,CAAC,yBAAyB,CAAC,CACrD,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAC5B,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAChC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAC5B,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAClB,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC9B,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAC9B,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { ProxyNativeModule, requireNativeModule } from 'expo-modules-core';\nimport React from 'react';\nimport { Platform, findNodeHandle } from 'react-native';\n\nimport { CameraMove } from './Common.types';\nimport { DefaultNativeExpoMapViewProps, ExpoMapState, ExpoMapViewProps } from './Map.types';\nimport {\n NativeExpoAppleMapsView,\n NativeExpoAppleMapsModule,\n NativeExpoGoogleMapsView,\n NativeExpoGoogleMapsModule,\n} from './NativeExpoMapView';\nimport * as Utils from './Utils';\n\nexport { Marker } from './Marker';\nexport { Polygon } from './Polygon';\nexport { Polyline } from './Polyline';\nexport { Circle } from './Circle';\nexport { Cluster } from './Cluster';\nexport { KML } from './KML';\nexport { GeoJson } from './GeoJson';\nexport { Overlay } from './Overlay';\nexport { ExpoMapRef } from './Map.types';\nexport { POICategoryType } from './Map.types';\nexport { Heatmap } from './Heatmap';\nexport * from './Events';\n\nconst defaultNativeExpoMapViewProps: DefaultNativeExpoMapViewProps = {\n mapType: 'normal',\n showZoomControls: true,\n showCompass: true,\n showMapToolbar: true,\n showMyLocationButton: true,\n showLevelPicker: true,\n enableRotateGestures: false,\n enableScrollGestures: true,\n enableTiltGestures: false,\n enableZoomGestures: true,\n initialCameraPosition: {\n target: {\n latitude: 51.51,\n longitude: 0.13,\n },\n zoom: 4,\n animate: true,\n duration: 1000,\n },\n enableTraffic: false,\n enablePOISearching: false,\n enablePOIs: false,\n enablePOIFilter: [],\n createPOISearchRequest: '',\n clickablePOIs: true,\n};\n\n/**\n * Main map component of Expo Maps library.\n *\n * See {@link ExpoMapViewProps} to learn more about props.\n */\nexport class ExpoMap extends React.Component<ExpoMapViewProps> {\n state: ExpoMapState = {\n markers: [],\n polygons: [],\n polylines: [],\n circles: [],\n clusters: [],\n kmls: [],\n geojsons: [],\n overlays: [],\n heatmaps: [],\n };\n _ismounted = false;\n mapView = React.createRef<ExpoMap>();\n\n getSearchCompletions(queryFragment: string) {\n const nodeHandle = findNodeHandle(this.mapView.current);\n let nativeModule: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n nativeModule = NativeExpoAppleMapsModule;\n } else {\n nativeModule = NativeExpoGoogleMapsModule;\n }\n\n nativeModule\n .getSearchCompletions(nodeHandle, queryFragment)\n .then((response: [string]) => {\n console.log(response);\n })\n .catch((error: Error) => {\n console.log('Error with message: ' + error.message);\n });\n }\n\n async moveCamera(cameraMove: CameraMove) {\n const nodeHandle = findNodeHandle(this.mapView.current);\n let nativeModule: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n nativeModule = requireNativeModule('ExpoAppleMaps');\n } else {\n nativeModule = requireNativeModule('ExpoGoogleMaps');\n }\n return nativeModule.moveCamera(nodeHandle, cameraMove);\n }\n\n componentDidMount() {\n this.mapChildren();\n this._ismounted = true;\n }\n\n componentWillUnmount() {\n this._ismounted = false;\n }\n\n componentDidUpdate(_, prevState: ExpoMapState) {\n if (Object.is(this.state, prevState)) {\n this.mapChildren();\n }\n }\n\n private async mapChildren() {\n const childrenArray = React.Children.map(this.props.children, async (child) => {\n if (!Utils.isSimpleType(child)) {\n if (Utils.isMarker(child)) {\n return Utils.buildMarkerObject(child);\n } else if (Utils.isPolygon(child)) {\n return Utils.buildPolygonObject(child);\n } else if (Utils.isPolyline(child)) {\n return Utils.buildPolylineObject(child);\n } else if (Utils.isCircle(child)) {\n return Utils.buildCircleObject(child);\n } else if (Utils.isKML(child)) {\n return Utils.buildKMLObject(child);\n } else if (Utils.isGeoJson(child)) {\n return Utils.buildGeoJsonObject(child);\n } else if (Utils.isCluster(child)) {\n return Utils.buildClusterObject(child);\n } else if (Utils.isOverlay(child)) {\n return Utils.buildOverlayObject(child);\n } else if (Utils.isHeatmap(child)) {\n return Utils.buildHeatmapObject(child);\n }\n Utils.warnIfChildIsIncompatible(child);\n return null;\n }\n Utils.warnIfChildIsIncompatible(child);\n return null;\n });\n\n if (childrenArray !== undefined) {\n // TODO(@lukmccall): remove any cast\n const propObjects = await Promise.all(childrenArray as any);\n if (this._ismounted) {\n this.setState({\n markers: propObjects.filter((elem) => elem?.type === 'marker'),\n polygons: propObjects.filter((elem) => elem?.type === 'polygon'),\n polylines: propObjects.filter((elem) => elem?.type === 'polyline'),\n circles: propObjects.filter((elem) => elem?.type === 'circle'),\n clusters: propObjects.filter((elem) => elem?.type === 'cluster'),\n kmls: propObjects.filter((elem) => elem?.type === 'kml'),\n geojsons: propObjects.filter((elem) => elem?.type === 'geojson'),\n overlays: propObjects.filter((elem) => elem?.type === 'overlay'),\n heatmaps: propObjects.filter((elem) => elem?.type === 'heatmap'),\n });\n }\n }\n }\n\n render() {\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n return (\n <NativeExpoAppleMapsView\n {...defaultNativeExpoMapViewProps}\n {...this.props}\n markers={this.state.markers}\n polygons={this.state.polygons}\n polylines={this.state.polylines}\n circles={this.state.circles}\n clusters={this.state.clusters}\n kmls={this.state.kmls}\n geojsons={this.state.geojsons}\n ref={this.mapView}\n />\n );\n }\n\n let googleMapsJsonStyleString = this.props.googleMapsJsonStyleString\n ? this.props.googleMapsJsonStyleString\n : '';\n if (this.props.enablePOIs === false) {\n if (this.props.googleMapsJsonStyleString) {\n console.warn(\n \"Expo Maps enablePOIs prop isn't effective when custom Google Maps map style is active. Please adjust your style manually to disable the POIs. https://developers.google.com/maps/documentation/ios-sdk/poi\"\n );\n } else {\n googleMapsJsonStyleString = JSON.stringify([\n {\n featureType: 'poi',\n stylers: [{ visibility: 'off' }],\n },\n ]);\n }\n }\n\n return (\n <NativeExpoGoogleMapsView\n {...defaultNativeExpoMapViewProps}\n {...this.props}\n googleMapsJsonStyleString={googleMapsJsonStyleString}\n markers={this.state.markers}\n polygons={this.state.polygons}\n polylines={this.state.polylines}\n circles={this.state.circles}\n clusters={this.state.clusters}\n kmls={this.state.kmls}\n geojsons={this.state.geojsons}\n ref={this.mapView}\n overlays={this.state.overlays}\n heatmaps={this.state.heatmaps}\n />\n );\n }\n}\n"]}
|
|
@@ -2,6 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { NativeExpoGoogleMapsViewProps, NativeExpoAppleMapsViewProps } from './Map.types';
|
|
3
3
|
export declare const NativeExpoGoogleMapsView: React.ComponentType<NativeExpoGoogleMapsViewProps>;
|
|
4
4
|
export declare const NativeExpoAppleMapsView: React.ComponentType<NativeExpoAppleMapsViewProps>;
|
|
5
|
-
export declare const NativeExpoAppleMapsModule:
|
|
6
|
-
export declare const NativeExpoGoogleMapsModule:
|
|
5
|
+
export declare const NativeExpoAppleMapsModule: any;
|
|
6
|
+
export declare const NativeExpoGoogleMapsModule: any;
|
|
7
7
|
//# sourceMappingURL=NativeExpoMapView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeExpoMapView.d.ts","sourceRoot":"","sources":["../src/NativeExpoMapView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE1F,eAAO,MAAM,wBAAwB,oDAEkB,CAAC;AAExD,eAAO,MAAM,uBAAuB,mDAEkB,CAAC;AAEvD,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"NativeExpoMapView.d.ts","sourceRoot":"","sources":["../src/NativeExpoMapView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE1F,eAAO,MAAM,wBAAwB,oDAEkB,CAAC;AAExD,eAAO,MAAM,uBAAuB,mDAEkB,CAAC;AAEvD,eAAO,MAAM,yBAAyB,KAAuC,CAAC;AAC9E,eAAO,MAAM,0BAA0B,KAAwC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { requireNativeViewManager,
|
|
1
|
+
import { requireNativeViewManager, requireNativeModule } from 'expo-modules-core';
|
|
2
2
|
export const NativeExpoGoogleMapsView = requireNativeViewManager('ExpoGoogleMaps');
|
|
3
3
|
export const NativeExpoAppleMapsView = requireNativeViewManager('ExpoAppleMaps');
|
|
4
|
-
export const NativeExpoAppleMapsModule =
|
|
5
|
-
export const NativeExpoGoogleMapsModule =
|
|
4
|
+
export const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');
|
|
5
|
+
export const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');
|
|
6
6
|
//# sourceMappingURL=NativeExpoMapView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeExpoMapView.js","sourceRoot":"","sources":["../src/NativeExpoMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"NativeExpoMapView.js","sourceRoot":"","sources":["../src/NativeExpoMapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAKlF,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAC9D,gBAAgB,CACqC,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAC7D,eAAe,CACqC,CAAC;AAEvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager, requireNativeModule } from 'expo-modules-core';\nimport * as React from 'react';\n\nimport { NativeExpoGoogleMapsViewProps, NativeExpoAppleMapsViewProps } from './Map.types';\n\nexport const NativeExpoGoogleMapsView = requireNativeViewManager(\n 'ExpoGoogleMaps'\n) as React.ComponentType<NativeExpoGoogleMapsViewProps>;\n\nexport const NativeExpoAppleMapsView = requireNativeViewManager(\n 'ExpoAppleMaps'\n) as React.ComponentType<NativeExpoAppleMapsViewProps>;\n\nexport const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');\nexport const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-maps",
|
|
3
|
-
"version": "1.0.0-canary-
|
|
3
|
+
"version": "1.0.0-canary-20240927-ab8a962",
|
|
4
4
|
"description": "Provides a Map component that uses Google Maps on Android and Apple Maps or Google Maps on iOS.",
|
|
5
5
|
"main": "build/Map.js",
|
|
6
6
|
"types": "build/Map.d.ts",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"homepage": "https://docs.expo.dev",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"expo-asset": "11.0.0-canary-
|
|
36
|
+
"expo-asset": "11.0.0-canary-20240927-ab8a962"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"expo-module-scripts": "3.6.0-canary-
|
|
39
|
+
"expo-module-scripts": "3.6.0-canary-20240927-ab8a962"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"expo": "52.0.0-canary-
|
|
42
|
+
"expo": "52.0.0-canary-20240927-ab8a962",
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-native": "*"
|
|
45
45
|
},
|
|
46
46
|
"jest": {
|
|
47
47
|
"preset": "expo-module-scripts/ios"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ab8a962d2c3dddbda124a6bd88d24475831dae00"
|
|
50
50
|
}
|
package/src/ExpoMaps.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { requireNativeModule } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
export const NativeExpoAppleMapsModule =
|
|
4
|
-
export const NativeExpoGoogleMapsModule =
|
|
3
|
+
export const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');
|
|
4
|
+
export const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');
|
package/src/Map.tsx
CHANGED
|
@@ -168,16 +168,6 @@ export class ExpoMap extends React.Component<ExpoMapViewProps> {
|
|
|
168
168
|
|
|
169
169
|
render() {
|
|
170
170
|
if (Platform.OS === 'ios' && this.props.provider === 'apple') {
|
|
171
|
-
if (parseInt(Platform.Version, 10) < 13 && this.state.geojsons.length > 0) {
|
|
172
|
-
console.warn(
|
|
173
|
-
"Versions of iOS < 13 doesn't support GeoJSON features for Apple Maps. Adding of GeoJSON for these versions will be omitted."
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
if (parseInt(Platform.Version, 10) < 13) {
|
|
177
|
-
console.warn(
|
|
178
|
-
"Versions of iOS < 13 doesn't support Points Of Interest Filters and their display modifications for Apple Maps. Adding POI filters for these versions will be omitted."
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
171
|
return (
|
|
182
172
|
<NativeExpoAppleMapsView
|
|
183
173
|
{...defaultNativeExpoMapViewProps}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireNativeViewManager,
|
|
1
|
+
import { requireNativeViewManager, requireNativeModule } from 'expo-modules-core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { NativeExpoGoogleMapsViewProps, NativeExpoAppleMapsViewProps } from './Map.types';
|
|
@@ -11,5 +11,5 @@ export const NativeExpoAppleMapsView = requireNativeViewManager(
|
|
|
11
11
|
'ExpoAppleMaps'
|
|
12
12
|
) as React.ComponentType<NativeExpoAppleMapsViewProps>;
|
|
13
13
|
|
|
14
|
-
export const NativeExpoAppleMapsModule =
|
|
15
|
-
export const NativeExpoGoogleMapsModule =
|
|
14
|
+
export const NativeExpoAppleMapsModule = requireNativeModule('ExpoAppleMaps');
|
|
15
|
+
export const NativeExpoGoogleMapsModule = requireNativeModule('ExpoGoogleMaps');
|