GeoXml Module

Bing
 

Module name: Microsoft.Maps.GeoXml

Namespace: Microsoft.Maps

The GeoXml module makes it easy to read and write common geospatial XML file formats such as KML (Keyhole Markup Language), KMZ (compressed KML), GeoRSS, GML (Geography Markup Language, exposed via GeoRSS), and GPX (GPS Exchange Format).

There are two ways to make use of this module. The first is to use the static methods in the GeoXml class to read/write the raw data. This gives you full control over the data and how it is rendered, if you choose to render it. The second option is to use the GeoXmlLayer which handles the importing of the XML data and generates a data layer which you can add to the map like any other layer. It handles all the rendering for you. This is a quick and easy way to get your geospatial XML data on the map with as little as 3 lines of code.

Tip: If GeoJSON data is passed into the GeoXmlLayer or the read functions of the GeoXml class, it will automatically load the GeoJSON module and read the data.

The GeoXml module supports XML tags from the following namespaces.

Namespace PrefixNamespace URINotes
atomhttp://www.w3.org/2005/Atom
geohttp://www.w3.org/2003/01/geo/wgs84_pos#Read only support in GeoRSS files.
georsshttp://www.georss.org/georss
geourlhttp://geourl.org/rss/module/Read only support in GeoRSS files.
gmlhttp://www.opengis.net/gmlGML is supported when included in GeoRSS documents.
gpxhttp://www.topografix.com/GPX/1/1
kmlhttp://www.opengis.net/kml/2.2
mappointhttp://virtualearth.msn.com/apis/annotate#Read only support in GeoRSS files.
rssRead only. GeoRSS writes using Atom format.
gpxxhttp://www.garmin.com/xmlschemas/GpxExtensions/v3Read only support in GPX files. Parses and uses DisplayColor. All other properties added to shape metadata.
gpx_stylehttp://www.topografix.com/GPX/gpx_style/0/2Supported in GPX files. Uses line color.

The GeoXml module supports the following XML elements. Any XML tags that are not supported will be converted into a JSON object and added to the metadata property of the parent shape or layer.

KML Elements

The GeoXml module supports the following KML elements.

Element NameReadWriteNote
addresspartialyesObject is parsed but is not used for positioning shape.
AddressDetailspartialnoObject is parsed but is not used for positioning shape.
atom:authoryesyes
atom:linkyesyes
atom:nameyesyes
BalloonStylepartialyesOnly supports text and textColor. Exposed through a balloonStyle and balloonDescription metadata property.
beginyesyes
coloryesyesIncludes #AABBGGRR and #BBGGRR
coordinatesyesyes
Datayesyes
descriptionyesyes
displayNameyesyes
Documentyesyes
eastyesyes
endyesyes
ExtendedDatayesyesSupports untyped Data, SimpleData or Schema, and entity replacements of the form $[dataName].
fillyesyes
Folderyesyes
GroundOverlayyesyesdrawOrder not supported
headingnono
hotSpotpartialyesOnly pixel units supported.
hrefyesyes
IconpartialpartialOnly href supported.
IconStylepartialpartialNo support for scale, heading, colorMode, or fractional hotspots.
innerBoundaryIsyesyes
kmlyesyes
LabelStylenono
LatLonBoxyesyes
LinearRingyesyes
LineStringyesyes
LineStyleyesyescolorMode not supported.
LinkyesnoOnly the href property is supported for network links.
MultiGeometryyesyes
nameyesyes
NetworkLinkyesnoLinks need to be on same domain as the document.
NetworkLinkControlnono
northyesyes
openyesyes
outerBoundaryIsyesyes
outlineyesyes
overlayXYyesno
PairpartialnoOnly the normal style in a StyleMap is supported.
phoneNumberyesyes
PhotoOverlaynono
Placemarkyesyes
Pointyesyes
Polygonyesyes
PolyStyleyesyes
RegionpartialpartialRegion LatLongBox only supported at document level.
rotationyesyes
rotationXYyesno
scalenono
Schemayesyes
SchemaDatayesyes
schemaUrlpartialyesDoes not support loading styles from external documents that are not included inside of a KMZ.
ScreenOverlayyesno
screenXYyesno
SimpleDatayesyes
SimpleFieldyesyes
sizeyesno
SnippetpartialpartialmaxLines attribute ignored.
southyesyes
Styleyesyes
StyleMappartialnoOnly the normal style in a StyleMap is supported.
styleUrlpartialyesExternal style URL's not supported.
textyesyesReplacement of $[geDirections] is not supported
textColoryesyes
TimeSpanyesyes
TimeStampyesyes
valueyesyes
visibilityyesyes
westyesyes
whenyesyes
widthyesyes

GeoRSS Elements

The GeoXml module supports the following GeoRSS elements.

Element NameReadWriteNote
atom:authoryesyes
atom:categoryyesyes
atom:contentyesyes
atom:contributoryesyes
atom:emailyesyes
atom:entryyesyes
atom:feedyesyes
atom:generatoryesno
atom:iconyesyes
atom:idyesyes
atom:linkyesyes
atom:logoyesyes
atom:nameyesyes
atom:publishedyesyes
atom:rightsyesyes
atom:sourceyesyes
atom:subtitleyesyes
atom:summaryyesyes
atom:titleyesyes
atom:updatedyesyes
atom:uriyesyes
geo:latyesnoWritten as a georss:point.
geo:lonyesnoWritten as a georss:point.
geo:longyesnoWritten as a georss:point.
georss:boxpartialnoWhen read, converted into a polygon.
georss:circlepartialnoWhen read, converted into a polygon.
georss:elevyesyes
georss:featurenameyesyes
georss:featuretypetagyesyes
georss:flooryesyes
georss:lineyesyes
georss:pointyesyes
georss:polygonyesyes
georss:radiusyesyes
georss:relationshiptagyesyes
georss:whereyesyes
geourl:latitudeyesnoWritten as a georss:point.
geourl:longitudeyesnoWritten as a georss:point.
mappoint:iconyesnoWritten as an atom:icon.
positionyesnoSome XML feeds will wrap GML with a position tag instead of with a georss:where tag. Will read this, but will write using a georss:where tag.
rssyesnoGeoRSS written in ATOM format.
rss:authoryespartialWritten as an atom:author.
rss:categoryyespartialWritten as an atom:category.
rss:channelyesno
rss:cloudyesno
rss:commentsyesno
rss:copyrightyespartialWritten as an atom:rights if shape doesn't have an rights metadata property already.
rss:descriptionyespartialWritten as an atom:content if shape doesn't have a content metadata property already.
rss:docsyesno
rss:enclosureyesno
rss:generatoryesno
rss:guidyespartialWritten as an atom:id if shape doesn't have an id metadata property already.
rss:imageyespartialWritten as an atom:logo if shape doesn't have a logo metadata property already.
rss:itemyespartialWritten as an atom:entry.
rss:languageyesno
rss:lastBuildDateyespartialWritten as an atom:updated if shape doesn't have an updated metadata property already.
rss:linkyespartialWritten as an atom:link.
rss:managingEditoryespartialWritten as an atom:contributor.
rss:pubDateyespartialWritten as an atom:published if shape doesn't have a published metadata property already.
rss:ratingyesno
rss:skipDaysyesno
rss:skipHoursyesno
rss:sourceyespartialWritten as an atom:source containing an atom:link.
rss:textInputyesno
rss:titleyespartialWritten as an atom:title.
rss:ttlyesno
rss:webMasteryesno

GML Elements

The GeoXml module supports the following GML elements. GML is supported when included in GeoRSS documents.

Element NameReadWriteNote
gml:coordinatesyesnoWritten using gml:posList.
gml:exterioryesyes
gml:FeatureyesnoWritten as a shape.
gml:FeatureCollectionyesnoWritten as a geometry collection.
gml:featureMemberyesnoWritten as a geometry collection.
gml:geometryyesnoWritten as a shape.
gml:geometryMemberyesyes
gml:innerBoundaryIsyesnoWritten using gml.interior.
gml:interioryesyes
gml:LinearRingyesyes
gml:LineStringyesyes
gml:lineStringMemberyesyes
gml:MultiGeometryyesyes
gml:MultiLineStringyesyes
gml:MultiPointyesyes
gml:MultiPolygonyesyes
gml:outerBoundaryIsyesnoWritten using gml.exterior.
gml:Pointyesyes
gml:pointMemberyesyes
gml:Polygonyesyes
gml:polygonMemberyesyes
gml:posyesyesReads coordinates that are in WGS84 decimal degrees format. Writes with dimension="2".
gml:posListyesyesReads coordinates that are in WGS84 decimal degrees format. Writes with dimension="2".

GPX Elements

The GeoXml module supports the following GPX elements.

Element NameReadWriteNote
gpx:ageofdgpsdatayesyes
gpx:authoryesyes
gpx:boundsyesyesConverted into a LocationRect when read.
gpx:cmtyesyes
gpx:copyrightyesyes
gpx:descyesyesCopied into a description property when read to align with other XML formats.
gpx:dgpsidyesyes
gpx:eleyesyes
gpx:extensionspartialpartialWhen read, style information extracted. All other extensions flattened into a simple JSON object. Only shape style information is written.
gpx:geoidheightyesyes
gpx:gpxyesyes
gpx:hdopyesyes
gpx:linkyesyes
gpx:magvaryesyes
gpx:metadatayesyes
gpx:nameyesyes
gpx:pdopyesyes
gpx:rteyesyes
gpx:rteptyesyes
gpx:satyesyes
gpx:srcyesyes
gpx:symyesyesValue is captured, but is not used to alter the pushpin icon.
gpx:textyesyes
gpx:timeyesyes
gpx:trkyesyes
gpx:trkptyesyes
gpx:trksegyesyes
gpx:typeyesyes
gpx:vdopyesyes
gpx:wptyesyes
gpx_style:coloryesyes
gpx_style:linepartialpartialcolor, opacity and width supported.
gpx_style:opacityyesyes
gpx_style:widthpartialpartialIf value is less than or equal to 1, will be multiplied by 5 and rounded.
gpxx:DisplayColoryesnoUsed to specify the color of a shape. When writing, line color will be used instead.
gpxx:RouteExtensionpartialnoAll properties are read into metadata. Only DisplayColor is used.
gpxx:TrackExtensionpartialnoAll properties are read into metadata. Only DisplayColor is used.
gpxx:WaypointExtensionpartialnoAll properties are read into metadata. Only DisplayColor is used.
gpx:keywordsyesyes
gpx:fixyesyes
Show: