Search
MapView.layerLoad Event
See Also
 






Raised when all tiles in a map layer are loaded.

Namespace: MindFusion.Mapping
File: MapView.js

 Syntax

JavaScript  Copy Code

EventDispatcher layerLoad

 Event Data

The event handler method receives the following arguments:
sender
A MapLayer instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
An EventArgs 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 the tile layer is 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.layerLoad.addEventListener(handleLayerLoad);

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

 See Also