簡體   English   中英

將Google Maps API V2升級到V3

[英]Upgrading Google Maps API V2 to V3

My Map完成項目時,我發現自2013年起將不再支持API V2。我開始考慮升級過程。

我有這個

 function initialize() {
  var myLatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
  var myOptions = {
    zoom: 5,
    center: myLatLng,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  var bermudaTriangle;

  var map = new google.maps.Map(document.getElementById("map_canvas"),
      myOptions);

  var triangleCoords = [
    new google.maps.LatLng(25.774252, -80.190262),
    new google.maps.LatLng(18.466465, -66.118292),
    new google.maps.LatLng(32.321384, -64.75737),
    new google.maps.LatLng(25.774252, -80.190262)
  ];

  // Construct the polygon
  // Note that we don't specify an array or arrays, but instead just
  // a simple array of LatLngs in the paths property
  bermudaTriangle = new google.maps.Polygon({
    paths: triangleCoords,
    strokeColor: "#FF0000",
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: "#FF0000",
    fillOpacity: 0.35
  });

  bermudaTriangle.setMap(map);
}

如V3文檔中所述。 但是,據我所知,v3不使用我在當前實現中使用的GXmlHttp。 我假設我應該采用類似於使用Php MySQL w / V3的路線..但我有點難過如何利用我的多邊形點函數來使用這種方法。

任何意見,將不勝感激。 謝謝!

據我GXmlHttp只是一個AJAX請求包裝器。

使用像jQuery這樣的庫來執行AJAX請求。

您實際上沒有在代碼中證明您的問題,因此很難說出您想要用它做什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM