I'm running competely offline with World Map Kit. When using the WrapDateLine feautre I'm trying to add trackshapes to the map such as a circle or polygon and see them as I pan from map to map. I can see the trackshape where it is drawn but not when I pan to the next map nothing. Is this possible?
WrapDateLine and TrackShapes
Michael, enabling WrapDateline mode on the WorldMapKitOverlay is one step. You also have to enable WrapDateline on the parent LayerOverlay that contains your FeatureLayer.
Thanks Klaus. I have tried this but no luck. I am using the different TrackModes(i.e Point, Line, etc…) on the TrackOverly to draw my shapes. I have set the TrackShapeLayer.WrappingMode = WrappingMode.WrapDateline and still do not see the shapes as I pan to the next map.
Thank you for your help Klaus,
Michael,
Have you set the WrappingExtent for the layer? Following is a sample code shows how to do it,
wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
wpfMap1.CurrentExtent = new RectangleShape(-133.2515625, 89.2484375, 126.9046875, -88.290625);
ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(@"…/…/sampleData/data/Countries02.shp", ShapeFileReadWriteMode.ReadOnly);
layer.Open();
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layer.WrappingMode = WrappingMode.WrapDateline;
layer.WrappingExtent = layer.GetBoundingBox();
LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add(layer);
overlay.WrappingExtent = layer.GetBoundingBox();
overlay.WrappingMode = WrappingMode.WrapDateline;
wpfMap1.TrackOverlay.TrackShapeLayer.WrappingExtent = layer.GetBoundingBox();
wpfMap1.TrackOverlay.TrackShapeLayer.WrappingMode = WrappingMode.WrapDateline;
wpfMap1.Overlays.Add(overlay);
wpfMap1.Refresh();
and the result is
Hope it helps,
Edgar
Thanks Edgar that fixed my problem.
Hello Michael,
You are welcome, please feel free to let us know your problem.
Regards,
Gary