Change the style of a Styled Google Map

337 Views Asked by At

I want to change the style of my Google Maps. I am using jQuery-UI-Map, but I can't figure out how.

Here's the code I am using right now:

$(document).ready(function(){
    $("#changeMap").click(function(){
        alert('About to change style...');
        $('#map_canvas').gmap({styles: mapStyleRed});
    });
});

The message box is being fired, but the map is not being updated to my "mapStyleRed".

1

There are 1 best solutions below

0
Hamster_NL On BEST ANSWER

It's always nice to find the answer a few minutes after posting a question...

$(document).ready(function(){
    $("#changeMap").click(function(){
        alert('About to change style...');
        $('#map_canvas').gmap('get','map').setOptions({styles: mapStyleRed});
    });
});