Skip to content

Commit ba4daab

Browse files
authored
Merge pull request #53 from manuszep/master
Remove string constraint on Marker icon because it should accept obje…
2 parents cbd8e38 + 77a871c commit ba4daab

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
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-

src/components/Marker.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ export class Marker extends React.Component {
8888

8989
Marker.propTypes = {
9090
position: T.object,
91-
map: T.object,
92-
icon: T.string
91+
map: T.object
9392
}
9493

9594
evtNames.forEach(e => Marker.propTypes[e] = T.func)

0 commit comments

Comments
 (0)