2

我对使用地理位置非常陌生,我的客户提供了一个 url 并要求我显示 url 包含的所有负载。网址是:

http://maps.google.co.uk/maps?q=119+5th+Avenue,+New+York,+NY+10003,+USA&hl=en&ll=40.713956,-73.828125&spn=146.915575,14.414062&sll=50.064192,-21.445312&sspn=141.347566,14.414063&oq=119+Fifth+Avenue+New+York+NY+10003+USA+&hnear=119+5th+Ave,+New+York,+10003,+United+States&t=m&z=2

我在网络上得到了一个示例工作,并实施了,这很好。现在我需要更新我下载的函数以适用于上述 url,并且需要显示 url(above) 包含的所有位置,我不知道要更新到函数

任何人帮助我显示更新我的功能以显示我上面http包含的所有位置?

我下载的功能:

<script type="text/javascript">
var locations = [
  ['Bondi Beach', 40.713956, -73.828125, 4],
  ['Coogee Beach', 146.915575, 14.414062, 5],
  ['Cronulla Beach', 50.064192, -21.445312, 3],
  ['Manly Beach', 141.347566, 14.414063, 2]
];
var map = new google.maps.Map(document.getElementById('map'), {
  zoom: 11,
  center: new google.maps.LatLng(),
  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));
}
</script>

提前致谢。如果有人放小提琴,那就没问题了。

4

0 回答 0