0

我想通过以下代码更改谷歌地图中的标记图像,但它不起作用

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"
}
);
4

1 回答 1

0
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

于 2012-10-01T23:25:21.407 回答