I have customized a FeatureSource
class and overrridden the GetFeaturesInsideBoundingBoxCore
method. I would like to restrict this method to return features only at specified zoom levels (for example, zoom levels 18+). Is the best way to restrict the zoom levels at which features are retrieved inside the GetFeaturesInsideBoundingBoxCore
method, or can this be better handled another way?
Restricting FeatureSource.GetFeaturesInsideBoundingBoxCore to zoom levels
Gregory,
Do you want a new method to get the features in a specified zoom level and the specified bounding box or in a zoom level only? Because if you call this method new, we find the features from current zoom level already you know. I’m not quite sure that do you want a method like: GetFeaturesFromZoomLevel(ZoomLevel level) or GetFeaturesInsideBoundingBox(RectangleShape boundingBox, ZoomLevel) etc.
Please provide us more information for your requirement.
Thanks,
Howard
Hmmm… good question. I want to display POI but only at zoom levels 18-20. I can check the zoom level inside the GetFeaturesInsideBoundingBox and that seems to work for me. Is that the best place for me to effect this?
Gregory,
If you just want to display POI data at some restricted zoom levels 18-20, you need to use PresetZoomLevels. PresetZoomLevels has a very useful property called “ZoomLevel.ApplyUntilZoomLevel”, which you can very easily use to extend your ZoomLevels. Let’s say you want a particular Style to be visible at ZoomLevel18 through ZoomLevel20. To make that work, you can simply code as follows:
ctycuLayer.ZoomLevelSet.ZoomLevel18.DefaultPointStyle = PointStyles.Capital1;
ctycuLayer.ZoomLevelSet.ZoomLevel18.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Thanks,
Khalil
Thanks - that makes sense. I’ll give it a try!
Gregory,
Hope it works well. If you still have any problem please let me know.
Thanks,
Khalil