0
我有,我正在开发一个站点中的两个谷歌地图的设置,我想申请自定义标记他们两个。这是我写的 -谷歌地图自定义标记显示不出来
var coordinates_1 = new google.maps.LatLng(x, x);
var coordinates_2 = new google.maps.LatLng(x, x);
var map_1_options = {
zoom: 14,
center: coordinates_1,
mapTypeControl: false,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map_2_options = {
zoom: 14,
center: coordinates_2,
mapTypeControl: false,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var marker_1 = new google.maps.Marker({
position: coordinates_1,
map: map_1,
icon: '/images/marker.png'
});
var marker_2 = new google.maps.Marker({
position: coordinates_2,
map: map_2,
icon: '/images/marker.png'
});
var map_1 = new google.maps.Map(document.getElementById('location_1'), map_1_options);
var map_2 = new google.maps.Map(document.getElementById('location_2'), map_2_options);
我想脚本可以优化,但这不是重要的问题在这里。会发生什么是我没有收到任何错误信息(或缺失图像),并且我将两个地图都显示在正确的位置,但没有显示标记。如果有问题,图片是32x32px。 任何帮助,将不胜感激。
Doh! :) 感谢您指出了这一点。现在工作。 –