2017-08-09 57 views
-1

有沒有一種方法來着色如:沒有使用styleUrl的地標? 我想要做的是直接在地標內部設置地標的樣式,而不必聲明樣式標識並在地標中引用該標識。KML樣式沒有styleUrl

我想象中的一樣的東西:

<Folder> 
    <name>Paths</name> 
    <Placemark> 
    <name>Extruded</name> 
    <visibility>1</visibility> 
    <LineString color="7f00ffff" width="2"> 
     <extrude>1</extrude> 
     <tessellate>0</tessellate> 
     <altitudeMode>absolute</altitudeMode> 
     <coordinates> 
     -112.2656634181359,36.09445214722695,2630 
     -112.2652238941097,36.09520916122063,2630 
     -112.2645079986395,36.09580763864907,2830 
     </coordinates> 
    </LineString> 
    </Placemark> 
</Folder> 

回答

0

我想通了自己。您只需在地標內添加樣式標記,但外部對象。在提出問題之前,我犯了錯誤,將線型中的樣式放入。

是滿足我的需求的代碼:

<Folder> 
    <name>Paths</name> 
    <Placemark> 
     <Style> 
      <LineStyle> 
       <color>7f00ffff</color> 
       <width>2</width> 
      </LineStyle> 
     </Style> 
     <name>Extruded</name> 
     <visibility>1</visibility> 
     <LineString> 
      <extrude>1</extrude> 
      <tessellate>0</tessellate> 
      <altitudeMode>absolute</altitudeMode> 
      <coordinates> 
       -112.2656634181359,36.09445214722695,2630 
       -112.2652238941097,36.09520916122063,2630 
       -112.2645079986395,36.09580763864907,2830 
      </coordinates> 
     </LineString> 
    </Placemark> 
</Folder> 
+0

介意編輯職位並追加KML是做你需要什麼? – rheitzman

+1

地標內的樣式元素稱爲內聯樣式。 – JasonM1