ASP.NET Pack Programmer's Guide
IEnumerable.select Method
See Also
 





Projects each element of a sequence into a new form.

Namespace: MindFusion.Mapping
Package: IEnumerable.js

 Syntax

JavaScript  Copy Code

function select (selector)

 Parameters

selector

function. A transform function to invoke on each element.

 Return Value

IEnumerable. An collection whose elements are the resultof invoking the transform function on each element.

 Example

The following code selects all members of a decorations list in a DecorationLayer that have some text set. The decorations property is of type ObservableCollection, which derives from IEnumerable.

JavaScript  Copy Code

var m = MindFusion.Mapping;

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";
markers.decorations.add(mark);

mark = new m.Marker();
mark.location = new m.LatLong(41.89021, 12.492231);
mark.imageSrc = "./images/colosseum100.png";
mark.text = "Colloseum";
markers.decorations.add(mark);
...........................
...........................

markers.decorations.select(function(x) { if (x.text != "")  return true});

 See Also

IEnumerable Members
IEnumerable Class
MindFusion.Mapping Namespace