JavaScript

mapControl.viewMarkers Method

Syntax

mapObj.viewMarkers(marker1, [,...markerN]);

mapObj.viewMarkers(markerArray);

Arguments

marker1

The first marker to include in the view calculation.

markerN

Optional. Additional marker(s) to include in the view calculation. You can specify as many additional markers as you want.

markerArray

An array of markers to include in the view calculation.

Description

Adjusts the Map Control's center point and zoom to view one or more markers.

Example

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

// center on a single marker named 'mymarker1'
mapObj.viewMarkers('mymarker1');

// view multiple markers
mapObj.viewMarkers('mymarker1','mymarker2','mymarker3');