SetMapScope()

Summary

Sets the area covered by a map.

Syntax

SetMapScope(string map_name, scope scp)

Argument Contents
map_name The name of the map
scp The scope displayed in the map window

Notes

  • The map is not drawn at the new scale until the next call to RedrawMap() or the map window is uncovered and needs to be redrawn.

  • If the map argument is null, SetMapScope() changes the current map.

  • SetMapScope() does not change the shape of the map window. Consequently, more than the specified scope is displayed if the scope and the window are different shapes. SetMapScope() guarantees that the entire scope is visible in the map window no matter how the user reshapes it.

  • If the map has an image layer, SetMapScope() cannot change the projection from that of the image layer. You must drop the image layer to change the projection of the map.

  • For a full list of scope-related GISDK functions, see Map Scales and Scopes.

Example

SetMapScope("Customer Map", GetLayerScope("Customers"))
SetMapScope(null, ClickScope()) // Lets the user zoom in

Error Codes

Error Type Meaning
NotFound There is no map with the specified name

See Also

Function Summary
GetMapScope() Gets the scope of a map
GetMapWindowScope() Gets the scope of a map using the current window width and height
GetLayerScope() Gets the scope of a map layer
GetSetScope() Gets the scope of the features in a selection set
SetMapDefaultScope() Sets the default scope of a map