I'm trying to figure out how to generate numbered map icons in C# UWP. But since I am looping and grabbing Lat and Long values from a database to plot on the map, I need to number the icons so they don't get overwritten (I think).
Can anyone shed some light on this issue for me? Here is where I am at:
while (reader.Read())
{
TargetLat = reader.GetString("lat");
TargetLon = reader.GetString("lon");
Uname = reader.GetString("uname");
//UPDATES THE UI
BasicGeoposition TargetPosition = new BasicGeoposition() { Latitude = Convert.ToDouble(TargetLat), Longitude = Convert.ToDouble(TargetLon) };
Geopoint TargetPoint = new Geopoint(TargetPosition);
// Create a MapIcon.
MapIcon mapIcon = new MapIcon();
mapIcon.Location = TargetPoint;
mapIcon.NormalizedAnchorPoint = new Point(0.5, 1.0);
mapIcon.Title = Uname;
mapIcon.ZIndex = 0;
// Add the MapIcon to the map.
MapControl1.MapElements.Add(mapIcon);
}
Is there an index or id that I can attach to the mapicon? Any help would be appreciated.