RenderServiceSoap.GetMap Method
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 Function GetMap ( ByVal specification As MapSpecification ) As
MapImage()
[C#]
public MapImage[] GetMap
( MapSpecification specification );
Parameters
- specification
The specification (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:
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]
'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#]
//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 | Using MapPoint Web Service in a Web Application | Working with Map Views