onclick event. For example, if you have a task in the task list that zooms the map to a pre-defined location, then you do not need any user input. The Viewer should zoom as soon as the page loads.
Use this technique when you want the Viewer API calls to be made when the page loads or as a result of anonLoad event occurs. The following is a simple example. If you add this to the task list and select the task, the displayed map will reposition to the given location.
The map frame contains a JavaScript function to center the map to a given coordinate at a given map scale. To call this function from a page loading in the task pane, create a function that will be executed when the<html>
<head>
<title>Viewer Sample Application - Zoom</title>
</head>
<script language="javascript">
function OnPageLoad()
{
parent.parent.ZoomToView(-87.7116768,
43.7766789973, 5000, true);
}
</script>
<body onLoad="OnPageLoad()">
<h1>Zooming...</h1>
</body>
</html>
Use a similar technique to call custom JavaScript based on an action in the task pane, like clicking a link.