2013-05-14 5 views
0

모두! 이 내면의 경계가있는 전세계 KML은 Google지도에 wierd로 표시됩니다.

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://www.opengis.net/kml/2.2"> 
    <Document> 
    <name>KML file with polygon for bird species range</name> 
    <description>Source various books and websites</description> 
    <Style id="rangecolour"> 
     <LineStyle><color>660000FF</color><width>1</width></LineStyle> 
     <PolyStyle><color>660000FF</color></PolyStyle> 
    </Style> 
    <Style id="linecolour"> 
     <LineStyle><color>660000FF</color><width>3</width></LineStyle> 
    </Style> 
    <Placemark><name>distribution/range</name> 
     <description></description> 
     <styleUrl>#rangecolour</styleUrl> 
     <Polygon> 
     <tessellate>1</tessellate> 
     <altitudeMode>clampToGround</altitudeMode> 
     <outerBoundaryIs> 
      <LinearRing> 
      <coordinates> 
       -180.0,180.0,0.0 
       -180.0,-180.0,0.0 
       180.0,-180.0,0.0 
       180.0,180.0,0.0 
       -180.0,180.0,0.0 
      </coordinates> 
      </LinearRing> 
     </outerBoundaryIs> 
     <innerBoundaryIs> 
      <LinearRing> 
      <coordinates> 
       153.056374,-27.500658,0.0 
       153.056374,-27.524105,0.0 
       153.093109,-27.524105,0.0 
       153.093109,-27.500658,0.0 
       153.056374,-27.500658,0.0 
      </coordinates> 
      </LinearRing> 
     </innerBoundaryIs> 
     </Polygon> 
    </Placemark> 
    </Document> 
</kml> 
내 의도는 전 세계 내부의 "구멍"을하는 것입니다

의 (a 경계 외부 세계를 shadded 얻을 수 있습니다

단지 예 :

나는 다음과 같은 KML 파일을),하지만, 어째서인지 모르겠다. 구글 어스는 잘 작동하지만, 구글 맵스 (API v3, 적어도 ... 내가 "google.maps.KmlLayer (url. kml) "...) 아닙니다.

이유를 아는 사람이 있습니까?

미리 감사드립니다.

답변

0

외부 경계는 다음과 같습니다

KML 아래에 표시되는 작은과 (다각형 온 세상이 사용 (-180과 180 사이) 매우 좁은 사각형입니다

 <coordinates> 
      -180.0,180.0,0.0 
      -180.0,-180.0,0.0 
      180.0,-180.0,0.0 
      180.0,180.0,0.0 
      -180.0,180.0,0.0 
     </coordinates> 

구멍) : geoxml3와 나를 위해

<Placemark><name>distribution/range</name> 
    <description></description> 
    <styleUrl>#rangecolour</styleUrl> 
    <Polygon> 
    <tessellate>1</tessellate> 
    <altitudeMode>clampToGround</altitudeMode> 
    <outerBoundaryIs> 
     <LinearRing> 
     <coordinates> 
      180,85 
      90,85 
      0,85 
      -90,85 
      -180,85 
      -180,0 
      -180,-85 
      -90,-85 
      0,-85 
      90,-85 
      180,-85 
      180,0 
      180,85 
     </coordinates> 
     </LinearRing> 
    </outerBoundaryIs> 
    <innerBoundaryIs> 
     <LinearRing> 
     <coordinates> 
      153.056374,-27.500658,0.0 
      153.093109,-27.500658,0.0 
      153.093109,-27.524105,0.0 
      153.056374,-27.524105,0.0 
      153.056374,-27.500658,0.0 
     </coordinates> 
     </LinearRing> 
    </innerBoundaryIs> 
    </Polygon> 
</Placemark> 

This 작품, KmlLayer 작동하지 않습니다. Google Maps KML parserKmlLayer 항상이 방법을 끊어진 꽤 많은 이유,

Another example

나도 몰라.

Related question: shading area outside of kml boundary

+0

내 의도는 당신이 말한대로, 그것은 매우 좁은 사각형이되었다, 구글지도 API의 KmlLayer를를 사용 aparently 온 세상을 할 심지어 구글 어스에서 전 세계를 shadded 나타납니다,하지만이지만, intencion은 다른 방향으로 "이동"하는 것입니다 :( 어쨌든,이 라이브러리가 개선되는지 아닌지를 확인하기 위해 geoxml3을 사용하고 있습니다. 결과를 알려 드리겠습니다. 감사합니다 !! –

+0

geoxml3으로 OK, 아름답게 할 수 있습니다.이 kml 파일을 게시하면 전 세계의 "커버"할 수 있습니다. 매우 유용합니다! 정말 고마워요! 이제 음영이 아닌 영역을 확대/축소해야합니다. 샘플 "http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?l"에서 어떻게 했습니까? at = -27.521011 & lng = 153.075531 & zoom = 12 & type = m & filename = http : //www.geocodezip.com/geoxml3_test/so_wholeworldkmlb.kml "? 고맙습니다!! –

+0

URL 위도 = -27.521011 & lng = 153.075531 & zoom = 12 – geocodezip

관련 문제