ASP.NET Pack Programmer's Guide
MapLayer.parent Property
See Also
 





Gets the parent control of this layer.

Namespace: MindFusion.Mapping
Package: MapLayer.js

 Syntax

JavaScript  Copy Code

Object.defineProperty(MapLayer.prototype, "parent", { value: MapView });

 Property Value

MapView. The parent control of this layer.

 Example

The following code creates a new MapLayer which loads its map tiles from a tile server. It uses the parent property to check, which is the containing Control of the layer:

JavaScript  Copy Code

var m = MindFusion.Mapping;

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

var l = new m.MapLayer();
l.id = 0;
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);
..............................
.............................
if(map.parent == view)
 {
   //do something
 }

 See Also

MapLayer Members
MapLayer Class
MindFusion.Mapping Namespace