It'd be great if this module could support styling of google maps using their API as documented at https://developers.google.com/maps/documentation/javascript/styling It would then allow for support for things like SnazzyMaps (https://snazzymaps.com/).

I've created a small patch to do this. Currently it only works on Views maps, but could probably be extended for the rendered field view too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stella created an issue. See original summary.

stella’s picture

screon’s picture

I need the same kind of functionality. I'll try out your patch somewhere this week and let you know if it works.

screon’s picture

Just tested your patch, and the feature working great! I was able to paste a JSON from Snazzymaps, and it successfully themed my map.However, the patch didn't apply to the latest dev version, there are some conflicts in the files which should be fixed..

Some remarks on my part after a (very) quick review:

  • I wouldn't pass the styles through an HTML data attribute, as it makes the markup very messy. (same remark for the other settings from the view style). I think it would be better to pass all settings directly to drupalSettings in your render array.
  • Maybe this module/patch can use some ideas of the styles_google_map module or share some code?
  • There are some formatting errors in the patch.
  • I quickly try extending the field formatter to allow styles there as well, and this is working (not that hard).
  • Maybe we could create an admin page where one can create multiple Styles and reference to them from a field formatter or Views style? Just an idea though :)

Status: Needs review » Needs work

The last submitted patch, geolocation_styled_maps.patch, failed testing.

The last submitted patch, geolocation_styled_maps.patch, failed testing.

The last submitted patch, geolocation_styled_maps.patch, failed testing.

The last submitted patch, geolocation_styled_maps.patch, failed testing.

ChristianAdamski’s picture

@stella testbot had some issues and some other stuff was committed.

Long story short: could you re-roll your patch against current git?

The last submitted patch, geolocation_styled_maps.patch, failed testing.

ChristianAdamski’s picture

ChristianAdamski’s picture

kae76’s picture

ChristianAdamski’s picture

Status: Needs work » Needs review
ChristianAdamski’s picture

Please see the referenced issue for a patch against current git. It builds the styles integration based on this patch. It extends the validation by checking for correct JSON. Interestingly enough, JSON demands all properties in "" which the Google style example do not adhere to.

If possible, please provide feedback.

ChristianAdamski’s picture

Status: Needs review » Fixed

I comitted #2747251 - I added both your usernames to the commit. I'm new to this, hopefully they show up in your commit history. If not ping me and I'll figure it out.

stella’s picture

Excellent, thanks!

kae76’s picture

Only just seen this, thank you :)

ChristianAdamski’s picture

Hmm, this is the commit: https://www.drupal.org/commitlog/commit/5688/67b9b8154c2bad4c4bdc67360cb...

I followed this guide: https://www.drupal.org/node/52287

And you both still do not show up as comitters. I don't know what I missed. Any ideas?

derjochenmeyer’s picture

Christian, it seems the git message is for git credit only? For Drupal.org credit you maybe need to use the Credit & committing UI below the issue.

Commit messages - providing history and credit

Note that the Credit & committing UI also allows maintainers to save credit for the issue itself (outside of the git repository). This will record the efforts of all contributors and their attributed organizations, and that data will then be available for display on their Drupal.org profiles.

ChristianAdamski’s picture

Ok, I added both names as getting credit in the other issue, and I see that does show up in the profiles each. I have now idea how to add people as committers and asking in #drupal-contribute did not result in any new insights. So I guess this is the best I can do...

It would be really good to be able to add other people as co-committers as well.

derjochenmeyer’s picture

Hm... don't know if i understand what you mean with co-committers. I think there has to be ONE author/committer per patch/commit in git.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.