Can Draw Order of Polygons Be Controlled in KML? -


i have adjacent polygons (clamptoground) portion of boundaries overlap. able control 1 appears on top. method i've found work far list polygon placemarks in stack order (last on list appears on top). however, i'd organize placemarks based on other logic , coding method specify polygon on top.

note, i've tried using relativetoground , small elevation differences, leads potions of polygons fill disappear beneath topography.

you can specify <gx:draworder> element (which google earth kml extension) order polygons lines , rings in kml.

note documentation (see below) specifies linestrings works lines, linearrings, , polygons. anywhere "linestrings" mentioned below replace lines, rings, , polygons. draworder support polygons undocumented reported issue.

kml documentation:

<gx:draworder>

"an integer value specifies order drawing multiple line strings. linestrings drawn first may partially or obscured linestrings later (or higher) draw order. element may required in conjunction <gx:outercolor> , <gx:outerwidth> elements in <linestyle> when dual-colored lines cross each other."

note work in clients support google earth kml extensions.

in example below, red polygon drawn on blue polygon. make blue polygon draw on red 1 change draworder value higher number.

 <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">     <document>         <placemark>             <name>red polygon</name>             <description>gx:draworder=3</description>             <style>               <linestyle>                 <color>ff000000</color>               </linestyle>               <polystyle>                 <color>ff0000ff</color>               </polystyle>             </style>             <polygon>                 <gx:draworder>3</gx:draworder>                 <tessellate>1</tessellate>                 <outerboundaryis>                     <linearring>                         <coordinates>                         14.456906,37.345497,0 14.949769,37.346531,0                         14.960918,37.987563,0 14.45089,37.987521,0                         14.456906,37.3455,0                      </coordinates>                     </linearring>                 </outerboundaryis>             </polygon>         </placemark>                  <placemark>             <name>blue polygon</name>             <description>gx:draworder=2</description>             <style>               <linestyle>                 <color>ff000000</color>               </linestyle>               <polystyle>                 <color>ffff0000</color>               </polystyle>             </style>             <polygon>                 <gx:draworder>2</gx:draworder>                 <tessellate>1</tessellate>                 <outerboundaryis>                     <linearring>                         <coordinates>                         14.83626,38.016863,0 14.835535,37.645589,0                         15.47025,37.589266,0 15.470457,38.019158,0                         14.83626,38.016862,0                      </coordinates>                     </linearring>                 </outerboundaryis>             </polygon>         </placemark>     </document>  </kml> 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -