GeezerVison is showing github.com — Zoom and Street View controls position by Sh3nr0n · Pull Request #222 · fullstackreact/google-maps-react
Conversation
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}}
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
|
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 :)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks, I've manually put this in as well. Please pull this into the repo along with other missing options!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
GiselaMD
commented
Feb 15, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
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 }
>
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
//Its not working any other way
<GoogleMap
streetViewControlOptions = {{ position: google.maps.ControlPosition.LEFT_CENTER }}
defaultCenter={center}
center={center}
>
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.