I am calling a a method which returns a marker overlay, everything works with inmemorymarkeroverlay, but does not work with simple marker overlay, I can confirm that the code for a simple marker overlay returns a populated overlay.
This code produces a working map:
InMemoryMarkerOverlay HospitalsOverlay = new InMemoryMarkerOverlay("HospitalsOverlay");
for (int i = 0; i < dt.Rows.Count; i++)
{
HospitalsOverlay.Features.Add(new Feature(Convert.ToDouble(dt.Rows["Long"]), Convert.ToDouble(dt.Rows["Lat"])));
}
WebImage HospitalSymbol = new WebImage("/images/circle_green.png");
WebImage ClientSymbol = new WebImage("/images/circle_red.png");
//Marker ClientMarker = new Marker(Convert.ToDouble(dt1.Rows[0]["Long"]), Convert.ToDouble(dt1.Rows[0]["Lat"]), ClientSymbol);
HospitalsOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage = HospitalSymbol;
HospitalsOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageWidth = 20;
HospitalsOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageHeight = 20;
HospitalsOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
HospitalsOverlay.IsVisible = true;
return HospitalsOverlay;
This code does not:
SimpleMarkerOverlay HospitalsOverlay = new SimpleMarkerOverlay("HospitalsOverlay");
WebImage HospitalSymbol = new WebImage("/images/circle_green.png");
for (int i = 0; i < dt.Rows.Count; i++)
{
HospitalsOverlay.Markers.Add(new Marker(Convert.ToDouble(dt.Rows["Long"]), Convert.ToDouble(dt.Rows["Lat"]), HospitalSymbol));
}
int d = HospitalsOverlay.Markers.Count;
HospitalsOverlay.IsVisible = true;
return HospitalsOverlay;