이것이 내가 "나무를위한 숲을 볼 수없는"버그 중 하나라고 생각합니다. 며칠 동안이 작업을 해왔으며 문제를 정확히 지적하지 못했습니다. 그렇게 힘들지 않아야합니다. 하지만 나는 그것을보기 위해 코드에 너무 가깝거나 (.kml에 너무 익숙하지 않다) 생각한다.Google 어스 .kml 파일의 아이콘 문제
아래에 게시 한 .kml 파일이 있습니다. 나는 대부분을 제거 했으므로 문제가있는 주소 하나만 표시합니다. 파일에는 원래 색상이있는 12 개 이상의 사각형에 대해 "IconStyle"태그가있었습니다.
내 .kml 파일이 Google 어스의 Walmart 주소를 가져옵니다. 표시된 아이콘은 파일의 URL (파일에서)입니다. http://maps.google.com/mapfiles/kml/pal4/icon18.png (녹색 원 안에 사각형입니다.)
대신 아래에 코드를 실행하면 빨간색 사각형이 표시됩니다. 조심 스레 눈을 뗄 수 없을 것입니다! 감사!
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1/">
<Document>
<name>test.kml</name>
<description>testIcon</description>
<LookAt>
<longitude>-111.5863733742289</longitude>
<latitude>39.55637809106051</latitude>
<altitude>0</altitude>
<range>610178.2115040587</range>
<tilt>-1.037184070538429e-013</tilt>
<heading>0.5510762374861048</heading>
</LookAt>
<StyleMap id="te">
<Pair>
<key>normal</key>
<styleUrl>#te1</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#te2</styleUrl>
</Pair>
</StyleMap>
<StyleMap id="fac">
<Pair>
<key>normal</key>
<styleUrl>#fac1</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#fac2</styleUrl>
</Pair>
</StyleMap>
<Style id="te1">
<IconStyle>
<color>ff87ff66</color>
<scale>0.8</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon56.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="te2">
<IconStyle>
<color>8887ff66</color>
<scale>1.2</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon56.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="fac1">
<IconStyle>
<scale>1.0</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon18.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="fac2">
<IconStyle>
<color>66ffffff</color>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon18.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>Walmart</name>
<address>1710 E Skyline Dr, South Ogden, UT 84405</address>
<styleUrl>#te</styleUrl>
<description><![CDATA[<div>Some Text</div>]]></description>
<styleUrl>#fac</styleUrl>
</Placemark>
</Document>
</kml>
장소 표시에서 KML과 관련하여 유효하지 않은 styleUrl 요소가 두 개 있습니다 (아이콘 당 하나의 styleUrl 요소 만 허용됨) - https://developers.google.com/kml/documentation/kmlreference#placemark – JasonM1