JustFly1984 / react-google-maps-api

React Google Maps API
MIT License
1.81k stars 437 forks source link

Zoom on StreetViewPanorama not working #153

Closed Wintervacht closed 5 years ago

Wintervacht commented 5 years ago

The issue

I have successfully implemented a StreetViewPanorama using the following method in another component's render function: `const StreetViewMap = withScriptjs(withGoogleMap((props) =>

    ));`

I have tried to change the default zoomlevel but nothing seems to work, am I doing something wrong or is this just not implemented?

My Environment

os: linux react version: 16.6

How does it behave?

No matter whow or where i try to define zoom or defaultZoom, nothing seems to work, not even when playing around with the documentation.

i have tried adding the options defaultZoom={4} zoom={4} in the parent GoogleMap component, in the StreetViewpanorama subcomponent and in the eventually called component within the main component's render method. Nothing works.

How should it behave correctly?

It should render the panorama with a narrower (or wider, depending on zoom level) field of view, to show less or more of the area.

Full disclosure: I'm using the sadly unmaintained React-Google-Maps library, but am willing to change that to this newer version if it solves my problem. I've posted my issue here since this library is basically a newer, rewritten and extended version of that, and this place is more likely to yield an answer than a dead repository.

JustFly1984 commented 5 years ago

@Wintervacht Can you please make an basic example at codesandbox?

There is no default props on components to simplify API in our lib.

As I see a source code, there is an options prop for <StreetViewPanorama />, which accepts an object with next interface:

Screenshot 2019-06-11 19 16 47

the zoom property is on this object among others.

JustFly1984 commented 5 years ago

please reopen if it does not solve your issue