更改 Styled Google 地图的样式
Change the style of a Styled Google Map
我想更改 Google 地图的样式。我正在使用 jQuery-UI-Map,但我不知道如何使用。
这是我现在使用的代码:
$(document).ready(function(){
$("#changeMap").click(function(){
alert('About to change style...');
$('#map_canvas').gmap({styles: mapStyleRed});
});
});
正在触发消息框,但地图没有更新到我的"mapStyleRed"。
在发布问题几分钟后找到答案总是很好...
$(document).ready(function(){
$("#changeMap").click(function(){
alert('About to change style...');
$('#map_canvas').gmap('get','map').setOptions({styles: mapStyleRed});
});
});
我想更改 Google 地图的样式。我正在使用 jQuery-UI-Map,但我不知道如何使用。
这是我现在使用的代码:
$(document).ready(function(){
$("#changeMap").click(function(){
alert('About to change style...');
$('#map_canvas').gmap({styles: mapStyleRed});
});
});
正在触发消息框,但地图没有更新到我的"mapStyleRed"。
在发布问题几分钟后找到答案总是很好...
$(document).ready(function(){
$("#changeMap").click(function(){
alert('About to change style...');
$('#map_canvas').gmap('get','map').setOptions({styles: mapStyleRed});
});
});