Skip to content

Commit bb4c92c

Browse files
satori-ytolstoguzovrborn
authored andcommitted
Added tracksInfoWindowChanges property to iOS Google Maps (react-native-maps#1969)
1 parent afaac30 commit bb4c92c

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

docs/marker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| `identifier` | `String` | | An identifier used to reference this marker at a later date.
1818
| `rotation` | `Float` | | A float number indicating marker's rotation angle, in degrees.
1919
| `draggable` | `<null>` | | This is a non-value based prop. Adding this allows the marker to be draggable (re-positioned).
20+
| `tracksInfoWindowChanges` | false | Sets whether this marker should track view changes in info window. Enabling it will let marker change content of info window after first render pass, but will lead to decreased performance, so it's recommended to disable it whenever you don't need it. **Note**: iOS Google Maps only.
2021

2122
## Events
2223

lib/components/MapMarker.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ const propTypes = {
177177

178178
tracksViewChanges: PropTypes.bool,
179179

180+
/**
181+
* Sets whether this marker should track view changes in info window true.
182+
*
183+
* @platform ios
184+
*/
185+
186+
tracksInfoWindowChanges: PropTypes.bool,
187+
180188
/**
181189
* Callback that is called when the user presses on the marker
182190
*/

lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@property (nonatomic, assign) double opacity;
3333
@property (nonatomic, assign) BOOL draggable;
3434
@property (nonatomic, assign) BOOL tracksViewChanges;
35+
@property (nonatomic, assign) BOOL tracksInfoWindowChanges;
3536

3637
- (void)showCalloutView;
3738
- (void)hideCalloutView;

lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ - (instancetype)init
3737
_realMarker = [[AIRGMSMarker alloc] init];
3838
_realMarker.fakeMarker = self;
3939
_realMarker.tracksViewChanges = true;
40+
_realMarker.tracksInfoWindowChanges = false;
4041
}
4142
return self;
4243
}
@@ -304,4 +305,12 @@ - (BOOL)tracksViewChanges {
304305
return _realMarker.tracksViewChanges;
305306
}
306307

308+
- (void)setTracksInfoWindowChanges:(BOOL)tracksInfoWindowChanges {
309+
_realMarker.tracksInfoWindowChanges = tracksInfoWindowChanges;
310+
}
311+
312+
- (BOOL)tracksInfoWindowChanges {
313+
return _realMarker.tracksInfoWindowChanges;
314+
}
315+
307316
@end

lib/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ - (UIView *)view
3838
RCT_EXPORT_VIEW_PROPERTY(zIndex, NSInteger)
3939
RCT_EXPORT_VIEW_PROPERTY(draggable, BOOL)
4040
RCT_EXPORT_VIEW_PROPERTY(tracksViewChanges, BOOL)
41+
RCT_EXPORT_VIEW_PROPERTY(tracksInfoWindowChanges, BOOL)
4142
RCT_EXPORT_VIEW_PROPERTY(opacity, double)
4243
RCT_EXPORT_VIEW_PROPERTY(onDragStart, RCTDirectEventBlock)
4344
RCT_EXPORT_VIEW_PROPERTY(onDrag, RCTDirectEventBlock)

0 commit comments

Comments
 (0)