react-native-maps 1.21.0-alpha.45 → 1.21.0-alpha.47

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.
@@ -274,6 +274,35 @@ using namespace facebook::react;
274
274
  mapViewEventEmitter->onUserLocationChange(data);
275
275
  }
276
276
  };
277
+
278
+ _view.onPoiClick = [self](NSDictionary* dictionary) {
279
+ if (_eventEmitter) {
280
+
281
+ NSDictionary* coordinateDict = dictionary[@"coordinate"];
282
+ NSDictionary* positionDict = dictionary[@"position"];
283
+
284
+ // Populate the OnMapPressCoordinate struct
285
+ facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickCoordinate coordinate = {
286
+ .latitude = [coordinateDict[@"latitude"] doubleValue],
287
+ .longitude = [coordinateDict[@"longitude"] doubleValue],
288
+ };
289
+ // Populate the OnMapDouplePressPosition struct
290
+ facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickPosition position = {
291
+ .x = [positionDict[@"x"] doubleValue],
292
+ .y = [positionDict[@"y"] doubleValue],
293
+ };
294
+
295
+
296
+ auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
297
+ facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClick data = {
298
+ .coordinate = coordinate,
299
+ .position = position,
300
+ .placeId = [dictionary[@"placeId"] UTF8String],
301
+ .name = [dictionary[@"name"] UTF8String],
302
+ };
303
+ mapViewEventEmitter->onPoiClick(data);
304
+ }
305
+ };
277
306
 
278
307
 
279
308
 
package/lib/MapMarker.js CHANGED
@@ -130,8 +130,8 @@ class MapMarker extends React.Component {
130
130
  image = this.props.image;
131
131
  }
132
132
  else {
133
- image = react_native_1.Image.resolveAssetSource(this.props.image) || {};
134
- image = image.uri || this.props.image;
133
+ const resolvedImage = react_native_1.Image.resolveAssetSource(this.props.image) || {};
134
+ image = resolvedImage.uri || this.props.image;
135
135
  }
136
136
  }
137
137
  return (<AIRMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
package/lib/MapOverlay.js CHANGED
@@ -35,14 +35,8 @@ class MapOverlay extends React.Component {
35
35
  render() {
36
36
  const { opacity = 1.0 } = this.props;
37
37
  let image;
38
- if (typeof this.props.image !== 'number' &&
39
- this.props.image.uri?.startsWith('http')) {
40
- image = this.props.image.uri;
41
- }
42
- else {
43
- const sourceAsset = react_native_1.Image.resolveAssetSource(this.props.image) || {};
44
- image = sourceAsset.uri;
45
- }
38
+ const resolvedImage = react_native_1.Image.resolveAssetSource(this.props.image) || {};
39
+ image = resolvedImage.uri || this.props.image;
46
40
  const AIRMapOverlay = this.getNativeComponent();
47
41
  return (<AIRMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
48
42
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
6
6
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
7
7
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
8
- "version": "1.21.0-alpha.45",
8
+ "version": "1.21.0-alpha.47",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",