Mas*_*nin 4 google-maps-markers
function createMarker(latlng, item) {
var marker = new google.maps.Marker({
position: latlng,
map: map
});
Run Code Online (Sandbox Code Playgroud)
这部分代码.在网站上它显示为标准标记,它适合我们所有人,但红色.如何将其更改为其他颜色?
Yel*_*yev 25
你应该使用icon财产.例如,
var marker = new google.maps.Marker({
position: latlng,
map: map,
icon: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'
});
Run Code Online (Sandbox Code Playgroud)
google.com上有许多颜色可供选择.只需green-dot用你的颜色替换:
http://maps.google.com/mapfiles/ms/icons/green-dot.png http://maps.google.com/mapfiles/ms/icons/blue-dot.png http://maps.google. com/mapfiles/ms/icons/red-dot.png http://maps.google.com/mapfiles/ms/icons/yellow-dot.png
| 归档时间: |
|
| 查看次数: |
28950 次 |
| 最近记录: |