Open GoogleCodeExporter opened 9 years ago
Alternatively, the Polygon could be extended using existing
PolygonObjectExtensionGroup to allow KML to be created that still supports
older GE client versions as well as other Earth browsers that don't support the
gx:Circle extension.
<element name="Circle" type="gx:CircleType"
substitutionGroup="kml:PolygonObjectExtensionGroup"/>
<complexType name="CircleType">
<annotation>
<documentation>The polygon outerBoundaryIs element could still represent the polygon coordinates for backwards compatability to older clients, but advanced clients that support this circle extension would override polygon definition with the Circle elements below. The Location would be the coordinates of the center of the circle.
</documentation>
</annotation>
<complexContent>
<extension base="kml:AbstractObjectType">
<sequence>
<element ref="kml:Location" minOccurs="0"/>
<element ref="gx:radius" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="radius" type="double" default="0.0">
<annotation>
<documentation>The radius of the circle in meters from center</documentation>
</annotation>
</element>
Using this approach using the PolyStyle for circles is intuitive.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:gx="http://www.google.com/kml/ext/2.2">
<Placemark>
<name>test circle</name>
<Style>
<LineStyle>
<width>1.5</width>
</LineStyle>
<PolyStyle>
<color>ffffffff</color>
<fill>1</fill>
<outline>1</outline>
</PolyStyle>
</Style>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>-76.0031983,36.92143473064811 -76.00543766213661,36.922179454908445 -76.00636531066532,36.923977407782495 -76.00543776730223,36.92577540232853 -76.0031983,36.92652016826084 -76.00095883269778,36.92577540232853 -76.00003128933467,36.923977407782495 -76.00095893786337,36.922179454908445</coordinates>
</LinearRing>
</outerBoundaryIs>
<gx:Circle>
<Location>
<longitude>-76.003198</longitude>
<latitude>36.923977</latitude>
</Location>
<gx:radius>282.181317</gx:radius>
</gx:Circle>
</Polygon>
</Placemark>
</kml>
Original comment by gjmath...@gmail.com
on 20 May 2011 at 2:38
Original issue reported on code.google.com by
gjmath...@gmail.com
on 19 May 2011 at 12:45