ia.MapController Class
Used to control chart navigation.
Constructor
Item Index
Methods
Properties
Methods
centerOnCoords
-
px
-
py
Centers the view on a pair of coordinates.
Parameters:
-
px
NumberThe x-coord (data units).
-
py
NumberThe y-coord (data units).
centerOnCursor
()
Centers the view on the cursor position.
changeBBox
-
dXMin
-
dYMin
-
dXMax
-
dYMax
Changes the bounding box using the given distances.
Parameters:
-
dXMin
NumberThe change in the xMin (data units).
-
dYMin
NumberThe change in the yMin (data units).
-
dXMax
NumberThe change in the xMax (data units).
-
dYMax
NumberThe change in the yMax (data units).
pan
-
direction
-
ratio
Pans the given direction and distance.
Parameters:
-
direction
NumberThe direction in degrees. Valid values are >=0 and <=360.
-
ratio
NumberTo calculate the distance moved,
ratio
is multiplied by thebBox
width or height (depending on the direction of the pan).The
bBox
is then shifted by the calculated distance.Valid values are > 0.
panDistance
-
direction
-
distance
Pans the given direction and distance.
Parameters:
-
direction
NumberThe direction in degrees. Valid values are >=0 and <=360.
-
distance
NumberThe distance (data units).
panE
()
Pans East.
panN
()
Pans North.
panNE
()
Pans North-East.
panNW
()
Pans North-West.
panS
()
Pans South.
panSE
()
Pans South-East.
panSW
()
Pans South-West.
panW
()
Pans West.
resetBBox
-
bx
-
by
-
bw
-
bh
Zooms to a bounding box as defined by the following parameters. This is a utility function so that bounding boxes can be dealt with in terms of their x, y, width and height;
Parameters:
-
bx
NumberThe x position of the bBox.
-
by
NumberThe y position of the bBox.
-
bw
NumberThe width of the bBox.
-
bh
NumberThe height of the bBox.
translate
-
dx
-
dy
Moves the view by the given distance.
Parameters:
-
dx
NumberThe distance in the x direction (data units).
-
dy
NumberThe distance in the y direction (data units).
zoomFull
()
Zooms to full extents as defined by the default bBox.
zoomIn
()
Zooms in around the center of the view.
zoomInOnCursor
()
Zooms in around the cursor position.
zoomOnCenter
-
ratio
Zooms around the center of the view.
Parameters:
-
ratio
NumberTo calculate the distance zoomed, the
bBox
width and height are multiplied by theratio
.Valid values are > 0.
Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.
zoomOnCoords
-
px
-
py
-
ratio
Zooms in around a pair of coordinates.
Parameters:
-
px
NumberThe x-coord (data units).
-
py
NumberThe y-coord (data units).
-
ratio
NumberTo calculate the distance zoomed, the
bBox
width and height are multiplied by theratio
.Valid values are > 0.
Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.
zoomOnCursor
-
ratio
Zooms around the cursor position by the given ratio.
Parameters:
-
ratio
NumberTo calculate the distance zoomed, the
bBox
width and height are multiplied by theratio
.Valid values are > 0.
Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.
zoomOnPoint
-
px
-
ratio
Zooms in around a point.
Parameters:
-
px
ia.PointThe point (data units).
-
ratio
NumberTo calculate the distance zoomed, the
bBox
width and height are multiplied by theratio
.Valid values are > 0.
Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.
zoomOut
()
Zooms out around the center of the view.
zoomOutOnCursor
()
Zooms out around the cursor position.
zoomToExtent
-
extent
Zooms to an extent around the center of the view.
Parameters:
-
extent
ObjectThe extent to zoom to (data units).
zoomToPointExtent
-
p1
-
p2
Zooms to an extent as defined by two points.
zoomToRect
-
rect
Zooms to a rectangle if the rectangle is greater than 5*5 pixels.
Parameters:
-
rect
ia.RectangleThe rect (pixel units).