简体   繁体   English

使Google Map Marker发光

[英]Make a Google Map Marker glow

We're re-writing a Flash application that uses Google Maps into an HTML/CSS/JavaScript with the v3.10. 我们正在使用v3.10将使用Google Maps的Flash应用程序重新编写为HTML / CSS / JavaScript。 In Flash they used an mx effect to create a pulsating glow of different colors to indicate status. 在Flash中,他们使用mx效果创建了不同颜色的脉动发光,以指示状态。

I've been trying to find a way to replicate this in JavaScript, but I haven't been able to find a solution. 我一直在尝试找到一种在JavaScript中复制此内容的方法,但是我一直找不到解决方案。 I've played around with shadow, but then it's only a png image. 我玩过阴影,但是那只是png图片。 Ideally I'd like to use CSS, or a JavaScript tool, but maybe I could use an animated gif behind the marker? 理想情况下,我想使用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
            });
        };

在此处输入图片说明

You could use a gif but you must set optimized: false in your marker constructor. 您可以使用gif,但必须在标记构造函数中设置“ optimized: false

Source: .gif marker google maps 资料来源: .gif标记Google地图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM