0

我需要去饱和我的谷歌地图。我用过stylers,它们不起作用。这是我的代码:

            <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
            <script type="text/javascript">
                document.write('<div id="gmap" style="width:960px; height:360px;"></div>');
                var map_center = new google.maps.LatLng(xxx, xxx);
                var map = new google.maps.Map( document.getElementById("gmap"),  {
                    zoom: 11,
                    center: map_center,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    panControl: false,
                    streetViewControl: false,
                    mapTypeControl: false,
                    stylers: [
                        { visibility: "on" },
                        { saturation: -100 }
                    ]
                });

                var pos;
                var marker;
                for(var i = 0 ; i < 10 ; i++) {
                    pos = new google.maps.LatLng(xxx, xxx);
                    marker = new google.maps.Marker({
                        position: pos,
                        map: map,
                        title: 'Tu jesteśmy',
                        icon: 'pointer.png'
                    });
                }

            </script>

请注意,我还需要使用自定义指针。

4

1 回答 1

1

没有MapOption样式器。它是样式。

            var map = new google.maps.Map( document.getElementById("gmap"),  {
                zoom: 11,
                center: map_center,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                panControl: false,
                streetViewControl: false,
                mapTypeControl: false,
                styles: [
                {
                   featureType: 'all',
                   elementType: 'all',
                   stylers: [
                     { visibility: "on" },
                     { saturation: -100 }
                  ]
                }]
            });

工作示例

于 2013-08-02T13:09:09.620 回答