You can render street maps in OpenStreetMap format by adding a StreetMapLayer instance to the MapView. In order to load an OSM map, create a new StreetMapLayer object and call its Map's LoadFromXml method to load the corresponding *.osm file. This is demonstrated in following excerpt from the StreetMaps sample project:
C#
Copy Code
|
---|
var streetLayer = new StreetMapLayer(); streetLayer.Map = new Map(); streetLayer.Map.LoadFromXml(fileName); mapView.Layers.Add(streetLayer); |
The pens and brushes used for drawing the map are stored within the
StreetMapPens and
StreetMapBrushes collections in the static
StreetMapFeatures class. You can define additional pens and brushes for drawing and painting certain map features by using the
StreetMapLayer's
AddPen and
AddBrush methods. If their
MapFeature parameter specifies a key but not a value, the pen or brush parameters will be applied to all features with associated key. For a list of standard key and value identifiers of map features, see
http://wiki.openstreetmap.org/wiki/Map_Features.