JavaScript

mapControl.view Method

Syntax

mapObj.view(location1, location2 [,...locationN [, pan]]);

mapObj.plotRoute(locationArray [, pan]);

Arguments

location1

The first location, specified as an array containing latitude/longitude values, to include in the view calculation.

location2

The second location, specified as an array containing latitude/longitude values, to include in the view calculation.

locationN

Optional. Additional location(s), specified as an array containing latitude/longitude values, to include in the view calculation. You can specify as many additional locations as you want.

locationArray

An array of locations, each specified as an array containing latitude/longitude values, to include in the view calculation.

pan

Optional. A true/false value. If true, the Map Control will animate, or 'pan', to the new location.

Description

Adjusts the Map Control's center point and zoom to view multiple latitude/longitude locations.

Discussion

You can optionally pass in a boolean as the last parameter to specify if you would like the view to be panned (animated) to the new location.

Example

//get a pointer to the map control for variable 'mymap1'
var mapObj = {dialog.object}.getControl('mymap1');

mapObj.view([42.1,-71.3],[42.12,-71.34],[41.234,-73.1],true);