Javascript 如何更改谷歌地图中的标记图像?
我想用下面的代码更改谷歌地图中的标记图像,但它不起作用Javascript 如何更改谷歌地图中的标记图像?,javascript,google-maps,Javascript,Google Maps,我想用下面的代码更改谷歌地图中的标记图像,但它不起作用 remap.gMap( { markers: [<?php echo $markers;?>], latitude:document.getElementById('searchlatitude').value, longitude:document.getElementById('searchlongitude').value, zoom:10 , panControl:true, icon: "ht
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"
}
);
remap.gMap(
{
标记:[],
纬度:document.getElementById('searchlatitude')。值,
经度:document.getElementById('search经度')。值,
缩放:10,
泛控制:对,
图标:“http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png"
}
);
当我添加图标:图像标记被隐藏时,我想将代码添加到以下代码remap.gMap({markers:[],纬度:document.getElementById('searchlatitude')。值,经度:document.getElementById('search经度')。值,缩放:10,panControl:true});你在用什么插件?
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
});
}