Hi guangming,
The GridSize is not for cut-of labels, it’s used to
calculate the density of displaying the labels. For the question on how to
control which scale to show labels or not, it depends on the TextStyle of zoom
level, if you didn’t give the textStyle to a specific Zoom level (scale), we
will not show the labels on that scale. Here are some codes:
ShapeFileFeatureLayer majorCitiesShapeLayer =
new
ShapeFileFeatureLayer(@
"..\..\SampleData\Data\MajorCities.shp"
);
majorCitiesShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City1(
"AREANAME"
);
majorCitiesShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
majorCitiesShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
If you just would like to show the label on Zoom level 06, you just need to change the zoomLevel01 to ZoomLevel06, and change ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level06.
Hope it helped.
Johnny