ASP.NET Pack Programmer's Guide
MapView.viewLoad Event
See Also
 





Raised when map view layers are loaded.

Namespace: MindFusion.Mapping
Package: MapView.js

 Syntax

JavaScript  Copy Code

EventDispatcher viewLoad

 Event Data

The event handler method receives the following arguments:
sender
A MapView instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
An EmptyEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following code handles the layerLoad event of a MapView and checks if all layers are completely loaded:

JavaScript  Copy Code

var m = MindFusion.Mapping;

// create a new instance of the mapView
var view = new m.MapView(document.getElementById("mapView"));
view.theme = "light";

// create a map layer
var l = new m.MapLayer("Map");
l.urlTemplate = "http://d.tile.stamen.com/terrain/{z}/{x}/{y}.png";
l.attribution = 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.';
view.layers.add(l);

view.viewLoad.addEventListener(handleLayerLoad);

function handleViewLoad( sender, args )
{
     
      if(sender == view)
          view.scrollTo( new Point(500, 500));

 See Also

MapView Members
MapView Class
MindFusion.Mapping Namespace