Commit d5574a4
authored
Adding support for InfoWindow as a child prop
Let's say you want to a simple map with 1 marker and you want to have an InfoWindow open when the component renders. For example, you want a location and you want to show some details about the location in an InfoWindow. InfoWindow requires either a position or a marker, but if you use the position, it will be laid on top of the marker.
This change allows the InfoWindow to be passed as a child inside of the Marker and passes on the Marker's marker, google and map to the child. Example:
```
<Marker
title="Location"
id={1}
position={markerCenter}
draggable={true}
onDragend={this.moveMarker.bind(this)}
>
<InfoWindow
visible={showInfoWindow}
style={styles.infoWindow}
>
<div className={classes.infoWindow}>
<p>Click on the map or drag the marker to select location where the incident occurred</p>
</div>
</InfoWindow>
</Marker>1 parent f3c70a6 commit d5574a4
1 file changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
| |||
0 commit comments