Skip to content

Commit 77a871c

Browse files
committed
Add a Marker with custom icon example in readme.
1 parent 905c272 commit 77a871c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ To place a marker on the Map, include it as a child of the `<Map />` component.
143143
name={'Dolores park'}
144144
position={{lat: 37.759703, lng: -122.428093}} />
145145
<Marker />
146+
<Marker
147+
name={'Your position'}
148+
position={{lat: 37.762391, lng: -122.439192}}
149+
icon={{
150+
url: "/path/to/custom_icon.png",
151+
anchor: new google.maps.Point(32,32),
152+
scaledSize: new google.maps.Size(64,64)
153+
}}
146154
</Map>
147155
```
148156

@@ -303,7 +311,7 @@ npm install
303311
make dev
304312
```
305313

306-
The Google Map React component library uses React and the Google API to give easy access to the Google Maps library.
314+
The Google Map React component library uses React and the Google API to give easy access to the Google Maps library.
307315

308316
___
309317

@@ -323,4 +331,3 @@ This app is only one of several apps we have in the book. If you're looking to l
323331

324332
## License
325333
[MIT](/LICENSE)
326-

0 commit comments

Comments
 (0)