This is looking very promising. The one thing I haven't been able to do yet is to apply the Gmap saturation style values to the map. The Gmap style spec is very simple, just saturation: -100".
As I expected, putting this in the Map styles field doesn't do anything. I've tried putting it in the Map options field but haven't had any luck yet. {"mapTypeId":"roadmap", "zoom":2} works fine, so I've tried extending this along the lines of {"mapTypeId":"roadmap", "zoom":2, StyledMapType(styles:Array.<stylers>, saturation:-100)} - but I'm really just guessing here, so either it does nothing or gives me a "Syntax error in map options" error.
I'd be grateful for any suggestions - am I just putting quotes in the wrong place, or am I trying to make it do something it won't? I should point out that I'm not a developer and arrays tend to make my brain go into an infinite loop...
Comments
Comment #1
rdeboerYeah.. the MapTypeStyle object is rather complex....
This works for me (note the keywords "styles" and "stylers"):
or add a grey/green hue to the roads only:
To try out more styles and to generate the JSON-syntax used above, see http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.... Use the UI on the left to create your effect, then hit the "Show JSON" button in lower right to copy and paste the JSON.
And while we're at it, here's an example of putting the controls in a different position (right-hand side):
Good luck!
Comment #2
rdeboerI've updated the help text and also increased the max.allowed length of the map options string in the latest 7.x-1.x-dev snapshot (13 March 2013).
Comment #3
adam_b commentedMy hero! The styling works perfectly - and now that you've set out the code, I can see how it works. Many thanks.
Comment #4
rdeboerExcellent. Closing. The additional example I've added to the configuration panel (see #2) should remind you, me and others how to do it next time.
Comment #5
adam_b commentedAfraid you didn't "increase the max.allowed length of the map options string" in the new release version - you increased the size to 127, but the length is still limited to 128 chars which means the available options are very limited (at least once you start using styles arrays - those brackets take a lot of characters).
Comment #6
adam_b commentedApologies, ignore my previous comment - I think I'd uploaded the wrong copy of the module.
Comment #6.0
adam_b commentedadded caveat in last line