I have a map with FeatureCollection including : Markers and Polygons.
HOW TO (when traversing FeatureCollection of this map) to differentiate action based on feature type. Speed is important here as collection can be big.
Any help appreciated.
You didn't show an example of your FeatureCollection. If you did you would notice parts of the json uses a keyword polygon and it probably named each of them if only by a number suffix. Similarly Makers are id'ed as marker
This snippet might be of uses. It tells the app to differentiate (color them differently as needed) the individual polygons.
So you might make a List of Polygons and then traverse the JSON list.
Thanks @ABG - always fast and helpful !
You inspired me to see if I can loop through every Polygon, as I have just single map on that screen.
Function for Markers goes by every Marker.
IMHO these 2 loops are simpler and not slower.
Works!
In the meantime I've created sample extension using getClass().getSimpleName() to see if it is an option - works too (I wish there is built-in appinventor method available for any component and variable...).