Comments (5)
Hey @chiss2906,
once the map is created, you can set any options.
This simple example generates the following map:
from react-gmaps.
Wouldn't it be easier to provide map options to the GMap props?
from react-gmaps.
I would not say "easier" but we could do that.
It's all about making the Gmaps component accept all the options, like other components already do.
PRs are welcome :)
from react-gmaps.
Untested, would something like this work:
createMap() {
var center = !isNan(this.props.lat) ? new google.maps.LatLng(this.props.lat, this.props.lng): undefined;
var googleOptions = assign({
center: center
}, this.props);
this.map = new google.maps.Map(this.getDOMNode(), googleOptions);
...
That way it is both handy to use and supports all Google options...
Also, wouldn't it be better to pass the map to the onMapCreated
callback?
from react-gmaps.
@chiss2906 @wmertens here we go.
Thanks for your contributions.
from react-gmaps.
Related Issues (20)
- PolyLine for drawing lines between markers HOT 13
- Get lat and long with pointer HOT 3
- Load libraries HOT 14
- How can i disable the zooming. HOT 4
- Map is showing blank HOT 5
- <Marker> not displayed if wrapped by another React component HOT 3
- Custom Markers HOT 3
- Support for responsive map containers HOT 1
- Marker event listener for infoWindow HOT 5
- How use preloader in 'loadingMessage'? HOT 2
- heroku is down HOT 1
- .setOptions method in entity.js missing HOT 2
- Map navigation buttons hidden and click on map enter fullscreen mode HOT 1
- How to drop marker with a click HOT 2
- Can't retrieve data from markers/circles HOT 1
- Map Label HOT 1
- NPM react-gmaps - how to get latitude and logintud when finished dragging a marker? HOT 2
- Old React lifecycle method HOT 1
- polyline is not defined in react-leaflet tried to solve the issue from Months.Below is the code HOT 1
- Outdated React HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-gmaps.