Hi there,
I seem to have a projection issue when creating an InMemoryFeatureLayer. I have the following code and with it my markers appear in the right spot with the LayerOverlay commented out but if I uncomment I end up in the South Atlantic someplace. I am adding the points using Decimal Degrees with no projecting happening when adding the point. However, you will see that I am adding the projection to the FeatureSource.
Any idea why I may be ending up with my points where they are?
Thanks
Curtis
ISignInventoryDAL signInventoryDAL = new SignInventoryDAL();
List<ISignInventoryItem> signs = signInventoryDAL.getSignsWithinDistanceToPoint(latitude, longitude, distance);
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
LayerOverlay layerOverlay = new LayerOverlay("PointOverlay", false, TileType.SingleTile);
layerOverlay.TransitionEffect = TransitionEffect.None;
//mapControl.CustomOverlays.Add(layerOverlay);
InMemoryFeatureLayer pointLayer = new InMemoryFeatureLayer();
pointLayer.FeatureSource.Projection = proj4;
layerOverlay.Layers.Add(pointLayer);
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay("MarkerOverlay");
mapControl.CustomOverlays.Add(markerOverlay);
pointLayer.FeatureSource.Open();
pointLayer.FeatureSource.BeginTransaction();
for(int i = 0; i < signs.Count; i++){
signs[i].renderToMap(markerOverlay, pointLayer, urlString);
}
//mapControl.CurrentExtent = pointLayer.GetBoundingBox();
pointLayer.FeatureSource.CommitTransaction();
pointLayer.FeatureSource.Close();