Pushpin.Pixel Property
The pixel coordinates (PixelCoord object) representing the point where the pushpin should be placed. Required if the LatLong property is null.
Public Dim Pixel As [Namespace].PixelCoord
Member of [Namespace].Pushpin
[C#]
public [Namespace].PixelCoord Pixel
Member of [Namespace].Pushpin
Remarks
- If both the Pixel and LatLong properties are passed, the LatLong property takes precedence.
- If the Pixel property is located outside of the specified map view, nothing is drawn and no SOAP fault is returned.
Example
[Visual Basic]
'This example assumes that the service instance
''renderService' has already been created and that
'the MapPoint Web Service namespace has been imported
'Get a map using height and width, and then mark the center
'with a pushpin
Dim myViews(0) As ViewByHeightWidth
myViews(0) = New ViewByHeightWidth()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).Height = 250
myViews(0).Width = 250
Dim myPushpins(0) As Pushpin
myPushpins(0) = New Pushpin()
myPushpins(0).IconDataSource = "MapPoint.Icons"
myPushpins(0).IconName = "3"
myPushpins(0).Pixel = New PixelCoord()
myPushpins(0).Pixel.X = 125
myPushpins(0).Pixel.Y = 125
myPushpins(0).Label = "Center"
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
mapSpec.Pushpins = myPushpins
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
[C#]
//This example assumes that the service instance
//'renderService' has already been created and that
//the MapPoint Web Service namespace has been imported
//Get a map using height and width, and then mark the center
//with a pushpin
ViewByHeightWidth[] myViews = new ViewByHeightWidth[1];
myViews[0] = new ViewByHeightWidth();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].Height = 250;
myViews[0].Width = 250;
Pushpin[] myPushpins = new Pushpin[1];
myPushpins[0] = new Pushpin();
myPushpins[0].IconDataSource = "MapPoint.Icons";
myPushpins[0].IconName = "3";
myPushpins[0].Pixel = new PixelCoord();
myPushpins[0].Pixel.X = 125;
myPushpins[0].Pixel.Y = 125;
myPushpins[0].Label = "Center";
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
mapSpec.Pushpins = myPushpins;
MapImage[] mapImages = renderService.GetMap(mapSpec);
See Also
Pushpin Class | PixelCoord Class | Pushpin.LatLong Property