The Calibrate method sets the map calibration.
Syntax
object.Calibrate( pProjection, DefaultProjection, ctrlLeft, ctrlTop, ctrlRight, ctrlBottom, wLeft, wTop, wRight, wBottom)
Parameter |
Type |
Description |
pProjection |
pProjection |
required; defined projection variable, see remarks |
DefaultProjection |
Boolean |
optional; use default projection |
ctrlLeft |
Double |
optional; left calibration point location in page units |
ctrlTop |
Double |
optional; top calibration point location in page units |
ctrlRight |
Double |
optional; right calibration point location in page units |
ctrlBottom |
Double |
optional; bottom calibration point location in page units |
wLeft |
Double |
optional; new left calibration point in projection units, see remarks |
wTop |
Double |
optional; new top calibration point in projection units, see remarks |
wRight |
Double |
optional; new right calibration point in projection units, see remarks |
wBottom |
Double |
optional; new bottom calibration point in projection units, see remarks |
Remarks
For the pProjection parameter, it is necessary to make a copy of the current map document projection with the CopyDocProjection method. Make the desired changes to the copy of the projection, apply the new changes with the ConvertProjection method, and then delete the copy of the projection. NOTE: It is important to delete the copy of the projection created with CopyDocProjection when you are done with it. If the projection copy is not deleted, the MapViewer application process will run even after MapViewer and Scripter are closed.
If ctrlLeft, ctrlTop, ctrlRight and ctrlBottom are all 0, they are ignored and the current map bounds are used instead.
If wLeft, wTop, wRight and wBottom are all 0, they are ignored and the current map bounds in world units are used instead.
If DefaultProjection is true, then the ProjectionType property is ignored and the current projection type is used.
wLeft, wTop, wRight and wBottom should be in projection coordinates. The unit types for projection coordinates are defined as follows.
If the projection is unknown, the unit type is unknown.
If the projection is Unprojected Lat/Long, the units are latitude/longitude.
If the projection is known and not Unprojected Lat/Long, the units are meters. The exception to this is when the ellipsoid type is "Standard sphere of one unit". In that case the unit type is "Unit of 1."
Example
This example calibrates a blank map window.
'Creates an instance of the MapViewer Application
'object and assigns it to the variable named "mvApp"
Set mvApp = CreateObject("MapViewer.Application")
'Makes MapViewer visible
mvApp.Visible = True
'Creates a map document object and assigns it
'to the variable named "Plot"
Set Plot = mvApp.Documents.Add(1)
'Copy the projection and set a new projection for
'the pProjection parameter
Set Proj = Plot.CopyDocProjection
Proj.ProjectionType = mvProjLambertConformalConic
'Calibrate the document
Plot.Calibrate(pProjection:=Proj, DefaultProjection:=False, _
ctrlLeft:=0.0, ctrlTop:=0.0, ctrlRight:=0.0, ctrlBottom:=0.0, _
wLeft:=-13803616, wTop:=6082427, wRight:=-7347086, wBottom:=2841288)
'Delete the copy of the projection
Proj.Delete
Used by: PlotDocument object