谷歌地图显示shapefile中的多边形

时间:2015-09-11 12:41:16

标签: google-maps google-maps-api-3

我对使用Google地图的机会有疑问。

我们有一个带有一组多边形的shapfile,所有多边形都有一个唯一的id。是否可以从列表/数据库中突出显示某些多边形或具有多边形id的内容以突出显示? 当点击地图中的多边形时,是否可以在该列表中添加id或删除id?

如果有人有一些链接,我可以看看它会很棒,找出从哪里开始..

提前致谢,抱歉我的英语不好:)

1 个答案:

答案 0 :(得分:0)

谢谢你的回答。我想我发现了如何显示形状文件。我需要将其转换为kml文件。

现在这是kml文件的样子:

<Placemark id="0">
  <Snippet maxLines="0">RÅSTAD - SOLLØKKA</Snippet>
  <name>0706706</name>
  <description>&lt;br&gt;&lt;br&gt;&lt;table border="1"padding="1"width="97%"&gt;&lt;tr&gt;&lt;td&gt;ID:&lt;/td&gt;&lt;td&gt;0706706&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
  <visibility>1</visibility>
  <open>0</open>
  <Polygon>
    <extrude>1</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>clampToGround</altitudeMode>
    <outerBoundaryIs>
      <LinearRing>
        <coordinates>10.2523636384489,59.1447359102789,0 10.2491296302902,59.1395560791909,0 10.2532230162908,59.1374941167945,0 10.263360691017,59.1367043657945,0 10.2634595062511,59.1384376257802,0 10.2649309077057,59.1394572514333,0 10.269233770364,59.1400441116529,0 10.2697022332493,59.1403216454834,0 10.270226363019,59.1403798402083,0 10.2712874576306,59.1407701469098,0 10.2797498489266,59.1407388533888,0 10.284476754492,59.1393075261033,0 10.3213655748521,59.1198007555867,0 10.3244406119112,59.1201186543517,0 10.330913554855,59.1294550046376,0 10.3317127328163,59.139828002045,0 10.3248919998049,59.1539487711044,0 10.3215362102992,59.1626071415408,0 10.3197868790073,59.1680633313157,0 10.3092533751796,59.1704360002405,0 10.3010112944765,59.1753917058148,0 10.2839272303475,59.1785670163406,0 10.2809551476738,59.1814412337641,0 10.2771550018462,59.1831332052011,0 10.2754038754411,59.1837791037246,0 10.2626393488688,59.1879021502356,0 10.2598018937944,59.1724670783896,0 10.2570474792395,59.1625631845719,0 10.2636028932216,59.1621701468898,0 10.2659526888692,59.1648279737181,0 10.2680633144255,59.1643948170748,0 10.2779341266802,59.1564481861203,0 10.2756177183904,59.1513466643591,0 10.2523636384489,59.1447359102789,0 </coordinates>
      </LinearRing>
    </outerBoundaryIs>
  </Polygon>
  <styleUrl>#trb2</styleUrl>
</Placemark>

名称是多边形的id。现在我尝试给所有多边形一个颜色..

任何帮助?