簡體   English   中英

如何知道谷歌地圖的幾何坐標

[英]How to know the Geometry coordinates for google Maps

我在Google代碼上找到了以下示例腳本:Google Maps Javascript API V3疊加層-http: //code.google.com/apis/maps/documentation/javascript/overlays.html#Overlays概述

而且我想將此代碼應用於其他國家/地區(法國,西班牙...),但是我不知道在哪里/如何找到此腳本中的Geometry代碼(請參見注釋行)

這是代碼:

var australia = new google.maps.LatLng(-25, 133);

    map = new google.maps.Map(document.getElementById('map_canvas'), {
      center: australia,
      zoom: 4,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    layer = new google.maps.FusionTablesLayer({
      query: {
        select: 'geometry', 
        from: '815230' // This one
      },
      styles: [{
        polygonOptions: {
          fillColor: "#00FF00",
          fillOpacity: 0.3
        }
      }, {
        where: "birds > 300",
        polygonOptions: {
          fillColor: "#0000FF"
        }
      }, {
        where: "population > 5",
        polygonOptions: {
          fillOpacity: 1.0
        }
      }]
    });
    layer.setMap(map);

附言:我試圖將google.maps.LatLng(-25,133)更改為France Lat&Long,但這僅用於使地圖在該位置居中。

謝謝您的幫助

您發布的示例使用了FusionTables圖層。 FusionTables基本上就像一個包含實際數據的小型數據庫或電子表格。 您在代碼( 815230 )中注釋的ID不是坐標,而是FusionTable的ID。 實際上,您可以在此鏈接中看到此ID后面的數據。

您可以通過自己提供的鏈接(特別是在此處)閱讀有關如何在地圖應用程序中使用FusionTables的更多信息 如果您決定從FusionTables中獲取數據,我建議您閱讀有關如何與FusionTables一起使用的文章。 您可以在此處找到更長的文章。

暫無
暫無

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

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