Hi ThinkGeo,
I am using 80x20 icons that keep getting chopped offf when they are displayed on a WPF Map most likely in location in tile boundaries. Please look into it. Thankx
Regards,
Anil
Hi ThinkGeo,
I am using 80x20 icons that keep getting chopped offf when they are displayed on a WPF Map most likely in location in tile boundaries. Please look into it. Thankx
Regards,
Anil
Hi Anil,
The reason for this issue is that WPF edition renders asynchronously by tile. The point cannot be across two tiles; so it isn't be queried on another tile. We actually have a solution about this that is setting the DrawingMarginPercentage on the layer. Here is the code I tested.Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9);
Random r = new Random();
InMemoryFeatureLayer featureLayer = new InMemoryFeatureLayer();
featureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(new GeoImage("d:\\Drop.png"));
featureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
featureLayer.DrawingMarginPercentage = 50;
for (int i = 0; i < 300; i++)
{
featureLayer.InternalFeatures.Add(new Feature(r.Next(-180, 180), r.Next(-90, 90)));
}
LayerOverlay layerOverlay = new LayerOverlay();
layerOverlay.Layers.Add(featureLayer);
Map1.Overlays.Add(layerOverlay);
Map1.Refresh();
Please let us know if you have any more queries.
Thanks,
Howard
Thanks Howard. It works!!!
Regards,
Anil
Hi Anil,
You are welcome; just feel free to let us know if you have more queries.
Thanks,
Howard
Hi Howard,
Why the DrawingMarginPercentage belongs to the Layer instead of to the Overlay which is the one having tiles?
Is 50 the recommended value? this means that the "get features intersecting the tile" will include a 50% more of its actual size in the search extent, right?
Regards,
Carlos.
Hi Carlos,
Let’s take LayerOverlay as an example; it has tiles inside it, but the real “dirty work” is done by the layers. The layers query features in a certain extent and draw them on tiles, so the DrawingMarginPercentage belongs to layer.
The recommended value for DrawingMarginPercentage is actually a tricky thing. Its proper value depends on what kind of styles are being used, if we use a large point style (larger than the size of one tile), then we need to set the DrawingMarginPercentage to more than 100 to prevent points from being chopped off. But for most case, 50 would be a proper value.
As the name implies, the DrawingMarginPercentage property only affects the drawing process. The GetFeaturesIntersecting method and other query-related methods don’t get affected by this property.
Hope this will be of help.
Regards,
Tsui
Hi Tsui,
I was meaning the GetFeatures within the extend of the layer for the drawing process, not the GetFeaturesInteresecting method and any other queyr-related metod that I know has no relationship this this. Anyway you clarified the issue.
Thanks
Carlos.
Hi Carlos,
Good to know it’s clear for you, let us know if you have other questions.
Regards,
Tsui
Does this also apply to labels? I’m seeing labels cut off as they pass over tile boundaries. I’ve set the DrawingMarginPercentage to 50 as a test, but I still get the problem.
Hi David,
Try using single tile mode instead and see if the labels are still being chopped off.
If using single tile mode can solve the problem, then it’s the same deal, just try setting the DrawingMarginPercentage to a larger value.
If not, then please let us know more about your scenario, like what style you are using and what data you are rendering.
Regards,
Tsui