MapSpecification Class
MapSpecification Class
Contains the specifications for rendering a map. Includes the data source to use, map views, pushpins, route, selected entities, and map options.
Public Class MapSpecification Inherits System.Object
[C#]
public class MapSpecification : System.Object
Public Properties
Name | Description |
---|---|
DataSourceName | A string representing the name of the data source (DataSource.Name property) to use to render the map. Required. |
HighlightedEntityIDs | An array of the IDs of geographic entities (Entity.ID property) that should appear as selected on the map. Valid array range is 0 through 50. Optional. |
Options | The map rendering options (MapOptions object), such as image format, panning and zooming factors, identification of the requested map as an overview map, route highlight colors, font size, and map style. Optional. |
Polygons | An array of Polygon objects to render. Optional. |
Pushpins | An array of pushpins (Pushpin[] objects) to render on the map. Valid array range is 0 through 100. Optional. |
Route | The route (Route object) to render on the map. |
Views | An array of map views (MapView[] objects) to render. One map image is returned for each map view. Valid array range is 0 through 50. |
HideEntityTypes | Specifies which built-in points of interest will not be rendered on the map. Optional. |
Remarks
The MapSpecification class is passed in the specification parameter of the RenderServiceSoap.GetMap method.
For the MapSpecification class to be valid, it must contain a valid DataSourceName property and the referenced data source must have a DataSource.Capability property value of CanDrawMaps.
Note If rendering a route, the DataSource.Capability property value must be CanRoute; otherwise, a SOAP fault is returned.
To retrieve the properties of a data source, use the CommonServiceSoap.GetDataSourceInfo method.
For more information about MapPoint Web Service data sources, see MapPoint Web Service Data Sources and Capabilities.
For the MapSpecification class to be valid, either the Views property must contain at least one map view or the Route property must contain a route. If the Route property is passed and the Views property is null, the map view of the entire route is used. If both the Route and Views properties are null, a SOAP fault is returned. If both the Route and Views properties are passed, the route is highlighted on the map and the Views property determines the map view.
To render a route, the passed Route object must contain at least a Route.CalculatedRepresentation or a Route.Specification property (the Route.Itinerary property is ignored). If it contains just a Route.Specification property, then the RenderServiceSoap.GetMap method calls the route service to calculate the route.
MapPoint Web Service constrains the map view in terms of how far the map is zoomed out or zoomed in. The constraints vary per data source and map style. If the Views or Options properties are set such that these limits would be exceeded, the returned map image is modified to meet the limit and the MapImage.View property contains the returned view.
If the Options property is null, the default property values of the MapOptions object are used.
See Also
MapOptions Class | Route Class | MapView Class | RenderServiceSoap.GetMap Method | MapPoint Web Service Data Sources and Capabilities