I was not setting graticule overlay projection so that could be the problem. Is there a way to extract the current map projection from a layer?
Thanks for the sample. It still needs tuning as map zooming and panning does not rescale the latitudes. Longitudes are being scaled to map width OK.
My map is in DecimalDegress so I modified the sample as follows:
wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
WorldMapKitWmsWpfOverlay worldMapKitOverlay = new WorldMapKitWmsWpfOverlay();
worldMapKitOverlay.Projection = WorldMapKitProjection.DecimalDegrees;
wpfMap1.Overlays.Add("WorldOverlay", worldMapKitOverlay);
ManagedProj4Projection proj4 = new ManagedProj4Projection();
proj4.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);
proj4.ExternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);
proj4.Open();
GraticuleAdornmentLayer graticuleAdornmentLayer = new GraticuleAdornmentLayer();
graticuleAdornmentLayer.Projection = proj4;
graticuleAdornmentLayer.GraticuleLineStyle.OuterPen.Color = GeoColor.FromArgb(125, GeoColor.StandardColors.Navy);
wpfMap1.AdornmentOverlay.Layers.Add("graticule", graticuleAdornmentLayer);
wpfMap1.CurrentExtent = //new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962);
new RectangleShape(-180.0, 83.0, 180.0, -90.0);
wpfMap1.Refresh();
This sample locks up upon map refresh. Ideas?
Thanks again.