我正在使用 Google Maps For Javascript。我重新组织了所有选项和工作真实位置。但是当我添加样式和标记时,我看不到效果。我该如何解决?
var locations = [
['MyLocation', 41.084951,29.016048],
];
var waStyle = [
{
featureType: "all",
stylers: [
{ saturation: -100 }
]
}
];
var map = new google.maps.StyledMapType(waStyle,{name: "MyLoc"});
var img = new google.maps.MarkerImage("/themes/bc/images/bc_pin.png");
var map = new google.maps.Map(document.getElementById('map_detail'), {
zoom: 10,
center: new google.maps.LatLng(41.084951,29.016048),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}