谷歌地图自定义风格赢得'不起作用

Google Maps Custom Style won't work

本文关键字:不起作用 自定义 风格 谷歌地图      更新时间:2023-09-26

我目前正在尝试自定义谷歌地图。

我通过API设计了我的地图(http://www.achimsagner.de/test/klysz/)但由于我使用了InfoBox,我的样式无法加载。(http://www.achimsagner.de/test/gmaps_test.html)

我就是找不到我的错误,也许有人能帮我。

将样式添加到myMapOptions

 var myMapOptions = {
                zoom: 16,
                center: secheltLoc,
                styles : styles,
                disableDefaultUI: true,
                scrollwheel: false          
        }

应用样式的页面包含以下行,而这些行在不存在的页面上不存在:

  //Associate the styled map with the MapTypeId and set it to display.
    theMap.mapTypes.set('map_style', styledMap);
    theMap.setMapTypeId('map_style');

工作示例