Search
MapView Class
Remarks See Also
 






Represents a container for map layers.

Namespace: MindFusion.Mapping
File: MapView.js

 Syntax

JavaScript  Copy Code

// class
MapView.prototype = {}

 Remarks

Remember always to call the load method after you've finished customizing the map.

 Example

The following example creates a new MapView using a <DIV> element called "mapview" that we've declared in the HTML code of the page. Then it adds a new MapLayer that provides map tiles to it. FInally it calls the load method to load all added layers and specify the center of the visible map:

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 = "https://umn56jbmqq5z0m223w.julianrbryant.com/terrain/{z}/{x}/{y}.png";
l.attribution = 'Map tiles by <a href="https://umn0c8y22w.julianrbryant.com">Stamen Design</a>, under <a href="https://umn5e1qggq890yd1x28f6wr.julianrbryant.com/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://umn4vxzy557bxyc2hkae4.julianrbryant.com">OpenStreetMap</a>, under <a href="https://umn0mtkzgjhpv53x17yq8x349yug.julianrbryant.com/copyright">ODbL</a>.';
view.layers.add(l);

 // load all layers
 view.load(new m.LatLong(0, 0), 2);

 Inheritance Hierarchy

MindFusion.Mapping.Control
    MindFusion.Mapping.MapView

 See Also