Share via


Pushpin.Pixel Property

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 Pixel As PixelCoord



[C#]

public PixelCoord Pixel;

Remarks

  • If both the Pixel and LatLong properties are passed, the LatLong property takes precedence.

Example

[Visual Basic]

'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#]

//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