fullstackreact / google-maps-react

Companion code to the "How to Write a Google Maps React Component" Tutorial
https://www.fullstackreact.com/articles/how-to-write-a-google-maps-react-component/
MIT License
1.64k stars 819 forks source link

Street view #270

Open msreekm opened 6 years ago

msreekm commented 6 years ago

Is it possible to load google-maps-react with streetview as the default ? any examples?

Qwiso commented 6 years ago

There are no examples but I guess you could hack it together. Streetview is a feature of the normal maps and you can load it with dragging the little person around. This library is only meant to handle basic Maps JavaScript API

https://developers.google.com/maps/documentation/javascript/streetview

msreekm commented 6 years ago

i dont want to click or drag, basically load the map with streetview.

Qwiso commented 6 years ago

There is an available method that can be your starting point. Within the component that you use, look closer at this.props.google.maps.StreetViewPanorama

https://developers.google.com/maps/documentation/javascript/examples/streetview-service

andrehigher commented 5 years ago

You just need to pass streetViewControl to the main component:

<Map
  ref='map'
  google={window.google}
  streetViewControl
  ...
 />