【发布时间】:2020-03-26 08:18:25
【问题描述】:
我可以制作带有字母的图钉
那我想改变这个图钉的颜色。
所以,我试试这个图标 http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|0099cc|
字母移位,大小略有变化....
我改用color : "blue",但徒劳无功。
我怎样才能只改变别针的颜色???
var marker =new google.maps.Marker({
position:latlng,
path: google.maps.SymbolPath.CIRCLE,
icon: "http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|0099cc|",
//icon: "https://maps.google.com/mapfiles/ms/icons/blue-dot.png",
//icon: "https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-poi.png&scale=1",
map:this.map,
color: "blue" // it dosen't work
label: String(label),
title:"google map"
});
【问题讨论】:
-
1)
path不是 MarkerOption,color也不是 2) 您使用的图标来自于 2012 年弃用并于 2019 年关闭的 Image Charts API。我我什至惊讶你仍然可以得到一个图标...... 3)有很多方法可以创建自定义标记。您应该参考文档或周围的许多教程 -
谢谢我的 API 是 Google Maps API 版本:3.40.6。
标签: javascript html css google-maps