expo-maps 0.2.0 → 0.3.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 CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.3.0 — 2023-10-17
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Dropped support for Android SDK 21 and 22. ([#24201](https://github.com/expo/expo/pull/24201) by [@behenate](https://github.com/behenate))
18
+
19
+ ### 💡 Others
20
+
21
+ - Ship untranspiled JSX to support custom handling of `jsx` and `createElement`. ([#24889](https://github.com/expo/expo/pull/24889) by [@EvanBacon](https://github.com/EvanBacon))
22
+
13
23
  ## 0.2.0 — 2023-09-04
14
24
 
15
25
  ### 🎉 New features
@@ -3,15 +3,15 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.2.0'
6
+ version = '0.3.0'
7
7
 
8
- buildscript {
9
- def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
- if (expoModulesCorePlugin.exists()) {
11
- apply from: expoModulesCorePlugin
12
- applyKotlinExpoModulesCorePlugin()
13
- }
8
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
+ if (expoModulesCorePlugin.exists()) {
10
+ apply from: expoModulesCorePlugin
11
+ applyKotlinExpoModulesCorePlugin()
12
+ }
14
13
 
14
+ buildscript {
15
15
  // Simple helper that allows the root project to override versions declared by this library.
16
16
  ext.safeExtGet = { prop, fallback ->
17
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
@@ -51,7 +51,19 @@ afterEvaluate {
51
51
  }
52
52
 
53
53
  android {
54
- compileSdkVersion safeExtGet("compileSdkVersion", 33)
54
+ // Remove this if and it's contents, when support for SDK49 is dropped
55
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
56
+ compileSdkVersion safeExtGet("compileSdkVersion", 33)
57
+
58
+ defaultConfig {
59
+ minSdkVersion safeExtGet("minSdkVersion", 23)
60
+ targetSdkVersion safeExtGet("targetSdkVersion", 33)
61
+ }
62
+
63
+ lintOptions {
64
+ abortOnError false
65
+ }
66
+ }
55
67
 
56
68
  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
69
  if (agpVersion.tokenize('.')[0].toInteger() < 8) {
@@ -67,13 +79,8 @@ android {
67
79
 
68
80
  namespace "expo.modules.maps"
69
81
  defaultConfig {
70
- minSdkVersion safeExtGet("minSdkVersion", 21)
71
- targetSdkVersion safeExtGet("targetSdkVersion", 33)
72
82
  versionCode 1
73
- versionName '0.2.0'
74
- }
75
- lintOptions {
76
- abortOnError false
83
+ versionName '0.3.0'
77
84
  }
78
85
  publishing {
79
86
  singleVariant("release") {
package/build/Map.js CHANGED
@@ -162,7 +162,7 @@ export class ExpoMap extends React.Component {
162
162
  if (parseInt(Platform.Version, 10) < 13) {
163
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
164
  }
165
- return (React.createElement(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 }));
165
+ 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
166
  }
167
167
  let googleMapsJsonStyleString = this.props.googleMapsJsonStyleString
168
168
  ? this.props.googleMapsJsonStyleString
@@ -180,7 +180,7 @@ export class ExpoMap extends React.Component {
180
180
  ]);
181
181
  }
182
182
  }
183
- return (React.createElement(NativeExpoGoogleMapsView, { ...defaultNativeExpoMapViewProps, ...this.props, googleMapsJsonStyleString: googleMapsJsonStyleString, 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, overlays: this.state.overlays, heatmaps: this.state.heatmaps }));
183
+ return (<NativeExpoGoogleMapsView {...defaultNativeExpoMapViewProps} {...this.props} googleMapsJsonStyleString={googleMapsJsonStyleString} 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} overlays={this.state.overlays} heatmaps={this.state.heatmaps}/>);
184
184
  }
185
185
  }
186
186
  //# sourceMappingURL=Map.js.map
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,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,EAA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CAAC,OAAO,GACjB,CACH,CAAC;SACH;QAED,IAAI,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB;YAClE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,yBAAyB;YACtC,CAAC,CAAC,EAAE,CAAC;QACP,IAAI,IAAI,CAAC,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,oBAAC,wBAAwB,OACnB,6BAA6B,KAC7B,IAAI,CAAC,KAAK,EACd,yBAAyB,EAAE,yBAAyB,EACpD,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC7B,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 module: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n module = NativeExpoAppleMapsModule;\n } else {\n module = NativeExpoGoogleMapsModule;\n }\n\n module\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 module: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n module = requireNativeModule('ExpoAppleMaps');\n } else {\n module = requireNativeModule('ExpoGoogleMaps');\n }\n return module.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;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,UAAU,CAAC;AAEzB,MAAM,6BAA6B,GAAkC;IACnE,OAAO,EAAE,QAAQ;IACjB,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,IAAI;IACpB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IACrB,oBAAoB,EAAE,KAAK;IAC3B,oBAAoB,EAAE,IAAI;IAC1B,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE;QACr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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 module: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n module = NativeExpoAppleMapsModule;\n } else {\n module = NativeExpoGoogleMapsModule;\n }\n\n module\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 module: ProxyNativeModule;\n if (Platform.OS === 'ios' && this.props.provider === 'apple') {\n module = requireNativeModule('ExpoAppleMaps');\n } else {\n module = requireNativeModule('ExpoGoogleMaps');\n }\n return module.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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-maps",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "ExpoMaps standalone module",
5
5
  "main": "build/Map.js",
6
6
  "types": "build/Map.d.ts",
@@ -41,5 +41,5 @@
41
41
  "jest": {
42
42
  "preset": "expo-module-scripts/ios"
43
43
  },
44
- "gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
44
+ "gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
45
45
  }