Hi Khalil
Thank you for the reply. The purpose of wanting to project SimpleMarkerOverlay is to use my own icon image instead of depending on the default one. The code snippet below works fine but I am using InmemoryMarkerOverlay which I can not set icon images of my own.
InMemoryMarkerOverlay inMarkerOverlay = new InMemoryMarkerOverlay("markerOverlay", columns);
foreach (DataRow item in datatable.Rows)
{
string x = item["X"].ToString();
Feature feature = new Feature(double.Parse(item["X"].ToString()), double.Parse(item["Y"].ToString()));
foreach (DataColumn col in datatable.Columns)
{
feature.ColumnValues[col.ColumnName] = item[col].ToString();
}
inMarkerOverlay.Features.Add(feature);
}
ManagedProj4Projection proj4 = new ManagedProj4Projection();
proj4.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);// in Geodetic (the GPS device reads).
proj4.ExternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(32737); //in UTM (the projection of the Map).
inMarkerOverlay.FeatureSource.Projection = proj4;
inMarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Width = 450;
inMarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Height = 200;
inMarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = "[#Remarks#]";
inMarkerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Can you help me to modify the code below to get it plotting the same coordinates used above and achieve a result which an end user can not distinguish using the projection concept you have mention in your last post.
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay("MarkerOverlay");
string pushpin = "../../theme/default/img/marker_gold.gif";
for (int i = 0; i < datatable.Rows.Count; i++)
{
DataRow rw = datatable.Rows<i>;
String x = rw["X"].ToString();
String y = rw["Y"].ToString();
String Remarks = rw["Remarks"].ToString();
Marker marker = new Marker(double.Parse(x), double.Parse(y), new WebImage(pushpin, 21, 25, -10.5f, -25f));
//marker.Popup.ContentHtml = "ContentHtml";
marker.Popup.ContentHtml = Remarks;
marker.Popup.IsVisible = true;
marker.Popup.BackgroundColor = GeoColor.SimpleColors.Red;
markerOverlay.Markers.Add(marker);
}
Map1.CustomOverlays.Add(markerOverlay);
Best Regards,
Vincent