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

Inject custom JSON styling #10

Open
ghost opened this issue Apr 14, 2016 · 1 comment
Open

Inject custom JSON styling #10

ghost opened this issue Apr 14, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 14, 2016

Hello,

Fantastic widget!
I could use some help on a few issue.
I am having troubling finding the right spot to inject my JSON map styling could you please tell where I should put them without breaking the widget.

Thanks,
Chris

@wimagguc
Copy link
Owner

Thanks Chris,
It's been quite a while, but the map object is stored in _self.vars.map after it's been created in line 172 in the js file:

    _self.vars.map = new google.maps.Map(...);

To customise this, the easiest is probably to just pop your styling code in here, and apply it by:

    _self.vars.map.mapTypes.set('map_style', styledMap);
    _self.vars.map.setMapTypeId('map_style');

(From GoogleDevs.)

If you want to extend the plugin with a public applyStyle() function, feel free to do so and then send a pull request. I think it might be useful for others too.

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

1 participant