Share via


MapOptions.Format Property

The format (ImageFormat object) of the map image to return. The default is 8-bit color in GIF format, with a size of 296 x 240 pixels. Optional.

Public Dim Format As [Namespace].ImageFormat
    Member of [Namespace].MapOptions
[C#]
public [Namespace].ImageFormat Format
    Member of [Namespace].MapOptions

Remarks

  • If the IsOverviewMap property is set to True and the dimensions specified in the Format property are larger than 180 x 180 pixels or smaller than 32 x 32 pixels, a 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 

'Return a very large image
Dim myViews(0) As ViewByScale
myViews(0) = New ViewByScale()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).MapScale = 5000

Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
mapSpec.Options = New MapOptions()
mapSpec.Options.Format = New ImageFormat()
mapSpec.Options.Format.Height = 800
mapSpec.Options.Format.Width = 800

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 

//Return a very large image
ViewByScale[] myViews = new ViewByScale[1];
myViews[0] = new ViewByScale();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].MapScale = 5000;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
mapSpec.Options = new MapOptions();
mapSpec.Options.Format = new ImageFormat();
mapSpec.Options.Format.Height = 800;
mapSpec.Options.Format.Width = 800;

MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);

 

See Also

MapOptions Class | ImageFormat Class | MapOptions.IsOverviewMap Property