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

Custom styling #17

Closed
chiss2906 opened this issue Aug 25, 2015 · 5 comments
Closed

Custom styling #17

chiss2906 opened this issue Aug 25, 2015 · 5 comments

Comments

@chiss2906
Copy link

There is no way to make custom buttons (like replacing the zoom in/out icons), markers, color themes (e.g. https://snazzymaps.com/).

@MicheleBertoli
Copy link
Owner

Hey @chiss2906,
once the map is created, you can set any options.

This simple example generates the following map:
screen shot 2015-08-25 at 18 52 40

@wmertens
Copy link
Contributor

Wouldn't it be easier to provide map options to the GMap props?

@MicheleBertoli
Copy link
Owner

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 :)

@wmertens
Copy link
Contributor

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?

@MicheleBertoli
Copy link
Owner

@chiss2906 @wmertens here we go.
Thanks for your contributions.

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

No branches or pull requests

3 participants