【发布时间】:2013-08-06 16:18:09
【问题描述】:
我正在开展一个项目,我们正在使用谷歌地图显示俄勒冈州的地图。现在我有一个 KML 图层,其中包含所有县的线条和红色叠加层。我正在尝试更改叠加层的颜色,但我对 kml 文件中的样式标签所做的任何更改都没有显示出来。
kml 文件在这里,http://sixswords.net/oregon/kml/oregon_counties.kml
您可以在此处查看带有叠加层的地图https://maps.google.com/?q=http://sixswords.net/oregon/kml/oregon_counties.kml
编辑以获取更多具体信息:
原来的kml文件样式是这样的。
<Style id='Style0-polygon-3'>
<LabelStyle>
<scale>0.0</scale>
</LabelStyle>
<LineStyle>
<color>ff666666</color>
<width>1</width>
</LineStyle>
<PolyStyle>
<color>7f0000ff</color>
</PolyStyle>
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
</Style>
<Style id='Style0-polygon-3-hover'>
<LineStyle>
<color>ff666666</color>
<width>1</width>
</LineStyle>
<PolyStyle>
<color>7f0000ff</color>
</PolyStyle>
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
</Style>
<StyleMap id='Style0-polygon-3-map'>
<Pair>
<key>normal</key>
<styleUrl>#Style0-polygon-3</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#Style0-polygon-3-hover</styleUrl>
</Pair>
</StyleMap>
我已尝试更改 Style0-polygon-3 样式中 polystyle 标记的颜色值,但它实际上并没有改变任何东西。
【问题讨论】:
-
StyleMap 在 Google 地图中不起作用,也许这是您的问题? (在 Google 地球中尝试您的 KML 文件——如果它在那里工作,那么您做对了。)
标签: google-maps-api-3 kml