[英]how can i change marker image in google map?
I would like to change the marker image in Google Maps by the following code but it's not working 我想通过以下代码更改Google Maps中的标记图像,但无法正常工作
remap.gMap(
{
markers: [<?php echo $markers;?>],
latitude:document.getElementById('searchlatitude').value,
longitude:document.getElementById('searchlongitude').value,
zoom:10 ,
panControl:true,
icon: "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png"
}
);
function initialize() {
var myLatlng = new google.maps.LatLng(document.getElementById('searchlatitude').value,document.getElementById('searchlongitude').value);
var mapOptions = {
zoom: 10,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var image = 'http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png';
var myLatLng = new google.maps.LatLng(-33.890542, 151.274856);
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image
});
}
https://developers.google.com/maps/documentation/javascript/overlays?hl=en-US#SimpleIcons https://developers.google.com/maps/documentation/javascript/overlays?hl=zh-CN#SimpleIcons
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.