RenderServiceSoap.GetMap Method
Creates one or more rendered images of a map. Returns a MapImage object or an array of MapImage[] objects, based on a map specification. The map specification includes the data source to use, map views, pushpins, route, selected entities, and map options.
Public NotOverridable Function GetMap ( ByVal specification As
[Namespace].MapSpecification ) As
[Namespace].MapImage()
Member of [Namespace].RenderServiceSoap
[C#]
public [Namespace].MapImage[] GetMap
( [Namespace].MapSpecification specification )
Member of [Namespace].RenderServiceSoap
Parameters
- specification
The specifications (MapSpecification object) for rendering a map.
Remarks
Use the MapOptions.ReturnType property sent in the MapSpecification.Options property to set whether to return the MapImage.MimeData property (a map image) or the MapImage.Url property (a URL to a map image cached on the MapPoint Web Service servers). For example:
- This Windows Form uses the MapImage.MimeData property:
- This Web Form uses the MapImage.Url property:
For information about rendering a map on a Web page, see Using MapPoint Web Service in a Web Application.
For information about the relationship between map image size and map views, see Working with Map Views.
Example
[Visual Basic]
'This example assumes that the MapPoint Web Service namespace
'has been imported
'Get a map of Seattle
Dim findService As New FindServiceSoap()
Dim findSpec As New FindSpecification()
findSpec.DataSourceName = "MapPoint.NA"
findSpec.InputPlace = "Seattle, WA"
Dim foundResults As FindResults
foundResults = findService.Find(findSpec)
Dim myViews(0) As ViewByHeightWidth
myViews(0) = foundResults.Results(0).FoundLocation.BestMapView.ByHeightWidth
Dim renderService As New RenderServiceSoap()
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
[C#]
//This example assumes that the MapPoint Web Service namespace
//has been imported
//Get a map of Seattle
FindServiceSoap findService = new FindServiceSoap();
FindSpecification findSpec = new FindSpecification();
findSpec.DataSourceName = "MapPoint.NA";
findSpec.InputPlace = "Seattle, WA";
FindResults foundResults = findService.Find(findSpec);
ViewByHeightWidth[] myViews = new ViewByHeightWidth[1];
myViews[0] = foundResults.Results[0].FoundLocation.BestMapView.ByHeightWidth;
RenderServiceSoap renderService = new RenderServiceSoap();
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
MapImage[] mapImages = renderService.GetMap(mapSpec);
See Also
RenderServiceSoap Class | MapImage Class | MapSpecification Class | MapOptions.ReturnType Property | MapSpecification.Options Property | MapImage.MimeData Property | MapImage.Url Property | Using MapPoint Web Service in a Web Application | Working with Map Views