制作Google地图标记

时间:2013-01-29 22:55:38

标签: javascript google-maps google-maps-api-3 google-maps-markers

我们正在使用v3.10重新编写将Google地图用于HTML / CSS / JavaScript的Flash应用程序。在Flash中,他们使用mx效果创建不同颜色的脉动光,以指示状态。

我一直试图找到一种在JavaScript中复制它的方法,但我找不到解决方案。 我玩过阴影,但那时它只是一个png图像。理想情况下,我想使用CSS或JavaScript工具,但也许我可以在标记后面使用动画gif?

createMarker = function (mapMarkerVm) {
            var shadow = new google.maps.MarkerImage(
                    '/Content/images/mapIcon_glow.png',
                    new google.maps.Size(36, 52),
                    new google.maps.Point(0, 0),
                    new google.maps.Point(20, 52));
            return new google.maps.Marker({
                title: mapMarkerVm.Title() || "",
                position: new google.maps.LatLng(mapMarkerVm.Latitude() || 0.0, mapMarkerVm.Longitude() || 0.0),
                icon: createMarkerImage(mapMarkerVm.StatusIcon()),
                map: map,
                shadow: shadow,
                draggable: false,
                visible: true
            });
        };

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以使用gif,但必须在标记构造函数中设置optimized: false

来源: .gif marker google maps