ZoomAndCenterMap()

Summary

Changes the scale and center of a map.

Syntax

ZoomAndCenterMap(string map_name, real fraction, coordinate center)

Argument Contents
map_name The map to be modified
fraction The multiplier by which the width and height should be changed
center The new center of the map

Notes

  • If the map_name is null, ZoomAndCenterMap() uses the current map.

Example

scp = GetMapScope()
ZoomAndCenterMap (null, 2.0, scp.center) // Zoom out (double the width and height); don't change the center
newcenter = Coord(-78000000, 43000000)
ZoomAndCenterMap ("my map", 0.5, newcenter) // Zoom in (cut the width and height in half), with new center

Error Codes

Error Type Meaning
NotFound The specified map does not exist

See Also

Function Summary
CenterMap() Centers a map at a particular location
SetScale() Sets the scale of a map
ZoomMap() Changes the scale of a map