ScaleAndCenterMapView Example - C# - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-09-26
ft:lastPublication
2025-09-26T10:03:58.880000

The following shows a C# example that returns a ScaleAndCenterMapView object.


public static ScaleAndCenterMapView createScaleAndCenterMapView()
{
    ScaleAndCenterMapView scaleAndCenterMapView = new ScaleAndCenterMapView();
    scaleAndCenterMapView.Height = 600;
    scaleAndCenterMapView.Width = 800;
    scaleAndCenterMapView.Scale = 20000;
    scaleAndCenterMapView.unit = PaperUnit.Pixel;
    //sets the map resolution. If not specified, the default one is set to 96 DPI
    //scaleAndCenterMapView.mapResolution = 200;

    Point point = BuildGeometry.buildPoint();
    scaleAndCenterMapView.MapCenter = point;
    return scaleAndCenterMapView;
}