Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom and Street View controls position #222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Sh3nr0n
Copy link

@Sh3nr0n Sh3nr0n commented Jun 14, 2018

Added the capability to change the default position of the zoom control and street view control.
Control names are those from the google-maps API.
Example : Add them to the map component and pass them an object as follow :

<Map
google={this.props.google}
zoom={5}
style={{ height: '80%' }}
initialCenter={{lat: 47.4840791,lng: 5.683411}}
zoomControl={true}
streetViewControl={true}
streetViewControlOptions={{position: google.maps.ControlPosition.LEFT_TOP}}
zoomControlOptions= {{position :google.maps.ControlPosition.LEFT_TOP}}

Sh3nr0n added 2 commits June 14, 2018 16:42
Added the capability to pass the "streetViewControlOptions" and "zoomControlOptions" from the google API to change the position of these controls on the map using the predefined "ControlPosition".
Zoom and Street View controls
@Sh3nr0n
Copy link
Author

Sh3nr0n commented Jun 14, 2018

Hey,

Just needed to move the default controls elsewhere on the map.
This is my first contribution so I hope I didn't make any mistake in the process or in the code itself.

Thanks for this lib anyway :)

@copperseed
Copy link

Thanks, I've manually put this in as well. Please pull this into the repo along with other missing options!

@GiselaMD
Copy link

GiselaMD commented Feb 15, 2019

ControlOptions is not working for me...
Can you tell me why?

<Map
google={window.google}
className={'map-wrapper'}
containerStyle={{ display: 'flex', flexDirection: 'column' }}
zoom={11}
gestureHandling= {'cooperative'}
mapTypeControl= {false}
streetViewControl= {true}
streetViewControlOptions = {{ position: google.maps.ControlPosition.LEFT_CENTER }}
zoomControlOptions = {{ position: google.maps.ControlPosition.LEFT_BOTTOM}}
fullscreenControl= {true}
fullscreenControlOptions = {{ position: google.maps.ControlPosition.LEFT_TOP }}
zoomControl= {true}
scaleControl= {true}
scaleControlOptions = {{position: google.maps.ControlPosition.BOTTOM_LEFT }}
styles={mapStyles}
centerAroundCurrentLocation= {false}
initialCenter={ initialCenter }
center={ (centerMap !== null) ? centerMap : selectedPlace }
>

@akshayaj29
Copy link

//Its not working any other way
<GoogleMap
streetViewControlOptions = {{ position: google.maps.ControlPosition.LEFT_CENTER }}
defaultCenter={center}
center={center}
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants