Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何在google map api 3中更改标记的颜色_Css_Google Maps - Fatal编程技术网

Css 如何在google map api 3中更改标记的颜色

Css 如何在google map api 3中更改标记的颜色,css,google-maps,Css,Google Maps,我正在寻找一个解决方案,以改变颜色的制造商在谷歌地图在API V3。我想在鼠标悬停时更改生成器的颜色。如果有人得到了解决方案,请将其发布,我将非常感谢。提前感谢您必须自定义标记属性,并为此使用自定义标记和阴影图像。但这是在MAPAPI2中,所以在此之前我很抱歉 var normal_icon = new GIcon(); normal_icon.image = "images/google_marker_green.png"; normal_icon.shadow = "images/shado

我正在寻找一个解决方案,以改变颜色的制造商在谷歌地图在API V3。我想在鼠标悬停时更改生成器的颜色。如果有人得到了解决方案,请将其发布,我将非常感谢。提前感谢

您必须自定义标记属性,并为此使用自定义标记和阴影图像。但这是在MAPAPI2中,所以在此之前我很抱歉

var normal_icon = new GIcon();
normal_icon.image = "images/google_marker_green.png";
normal_icon.shadow = "images/shadow-google_marker_green.png";
normal_icon.iconSize = new GSize(20.0, 34.0);
normal_icon.shadowSize = new GSize(38.0, 34.0);
normal_icon.iconAnchor = new GPoint(10.0, 17.0);
normal_icon.infoWindowAnchor = new GPoint(10.0, 17.0);

var hover_icon = new GIcon();
hover_icon.image = "images/google_marker_blue.png";
hover_icon.shadow = "images/shadow-google_marker_blue.png";
hover_icon.iconSize = new GSize(20.0, 34.0);
hover_icon.shadowSize = new GSize(38.0, 34.0);
hover_icon.iconAnchor = new GPoint(10.0, 17.0);
hover_icon.infoWindowAnchor = new GPoint(10.0, 17.0);

var lat="Your lat. point";
var long="Your long. point";

map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(lat, long), 15);
map.setUIToDefault();
var point = new GLatLng(lat,long);
var marker = new GMarker(point,normal_icon);
var message="Custom message";
GEvent.addListener(marker, "click", function() {
  map.openInfoWindowHtml(point, message);
});
map.addOverlay(marker);

function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'mouseover', function() {
        marker.setIcon(hover_icon);
      });
      google.maps.event.addListener(marker, 'mouseout', function() {
        marker.setIcon(normal_icon);
      });
    }
你可以从下面的例子中找到确切的例子

谢谢和问候


Haresh

链接未执行。。。你会提供其他链接吗?