1

I want to apply a snazzymap to MX Google Maps.

  • Hey Seb, thanks for sharing this info! Snazzy Maps is very cool. It would be best if you add your share in the QA format. To do that just rewrite your "question" as a question and then post the code share as an answer to your own question. – Alex Kendrick Mar 4 '15 at 17:06
  • Thanks, Seb. In 48 hours you can accept your own answer. :-) – Alex Kendrick Mar 4 '15 at 17:25
2

If you're using Max's MX Google Map [1.5.3] for publish form maps and wish to apply a snazzymap you can do so by adding the snazzymap styles on line 496 of system/third_party/mx_google_map/ft.mx_google_map.php.

Download the snazzymap you want to apply. View the source. Copy from:

// How you would like to style the map. 
// This is where you would paste any style found on Snazzy Maps.
    styles: ... ]}]

And then paste it just after:

jQuery(document).ready(function() {
    jQuery("#'.$randid.'_map").mxgoogleMaps({
    latitude: '.$data["latitude"].',
    longitude: '.$data["longitude"].',
    zoom:  '.$zoom.',
    markers: ['.$markers.'],

So it looks something like this:

   [...]
   markers: ['.$markers.'],

   // Snazzy maps hackery
   styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}],
   // End Snazzy maps hackery

   field_id : "'.$randid.'"
   [...]

Remember to add a comma after the closing square bracket ]}],.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.