ASP.NET Pack Programmer's Guide
MapView.overlays Property
See Also
 





Gets the collection of DecorationLayer-s.

Namespace: MindFusion.Mapping
Package: MapView.js

 Syntax

JavaScript  Copy Code

Object.defineProperty(MapView.prototype, "overlays", { value: ObservableCollection });

 Property Value

ObservableCollection. A collection of DecorationLayer instances.

 Example

The following code creates a new MapView using a <DIV> element called "mapview" that we've declared in the HTML code of the page. Then it checks if there are any DecorationLayer-s and if not - adds one with a Marker in it:

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";
....................
....................

if(view.overlays.count() == 0)
{

   //add a new DecorationLayer
   var markers = new m.DecorationLayer("Images");

   // create some markers with images
   var mark = new m.Marker(new m.LatLong(-22.951916, -43.210487));
   mark.imageSrc = "./images/christ_redeemer.png";
   mark.text = "Christ the Redeemer";
   mark.visible = false;
   markers.decorations.add(mark);

   view.layers.add(markers);
}

 See Also

MapView Members
MapView Class
MindFusion.Mapping Namespace