MapSpecification.HighlightedEntityIDs Property
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. Integer[]. Optional.
Public Dim HighlightedEntityIDs As Integer()
Member of [Namespace].MapSpecification
[C#]
public int[] HighlightedEntityIDs
Member of [Namespace].MapSpecification
Remarks
- The geographic entity is highlighted (if the entity is an area, such as a province or country/region, as opposed to a point, such as a city or town) and labeled on the map, as shown in the following examples:
- The geographic entity must be from the data source identified in the DataSourceName property, and that data source must have a CanFindPlaces capability (DataSourceCapability enumeration).
- For a table of the MapPoint Web Service data sources and functions that can be performed on them, see MapPoint Web Service Data Sources and Capabilities.
- To return a list of data sources and their capabilities, use the CommonServiceSoap.GetDataSourceInfo method.
- The FindResult.FoundLocation property of a found place contains the geographic entity identifier.
Example
[Visual Basic]
'This example assumes that the service instances
''findService' and 'renderService' have already
'been created and that the MapPoint Web Service namespace
'has been imported
'Get a map of Seattle and highlight Seattle on the map
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 myEntityIDs(0) As Integer
myEntityIDs(0) = foundResults.Results(0).FoundLocation.Entity.ID
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.HighlightedEntityIDs = myEntityIDs
mapSpec.Views = myViews
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
[C#]
//This example assumes that the service instances
//'findService' and 'renderService' have already
//been created and that the MapPoint Web Service namespace
//has been imported
//Get a map of Seattle and highlight Seattle on the map
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;
int[] myEntityIDs = new int[1];
myEntityIDs[0] = foundResults.Results[0].FoundLocation.Entity.ID;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.HighlightedEntityIDs = myEntityIDs;
mapSpec.Views = myViews;
MapImage[] mapImages = renderService.GetMap(mapSpec);
See Also
MapSpecification Class | Entity.ID Property | MapSpecification.DataSourceName Property | DataSourceCapability Enumeration | MapPoint Web Service Data Sources and Capabilities | CommonServiceSoap.GetDataSourceInfo Method | FindResult.FoundLocation Property