ScaleAndCenterMapView Example - Java - 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 Java example that returns a ScaleAndCenterMapView object.


public static ScaleAndCenterMapView getScaleAndCenterMapView() throws Exception
{
    ScaleAndCenterMapView scaleAndCenterMapView = new ScaleAndCenterMapView();
    scaleAndCenterMapView.setHeight(600);
    scaleAndCenterMapView.setWidth(800);
    scaleAndCenterMapView.setScale(20000);
    scaleAndCenterMapView.setUnit(PaperUnit.PIXEL);
    //sets the map resolution. If not specified, the default one is set to 96 DPI
    //scaleAndCenterMapView.setMapResolution(200);

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