ThinkGeo.com    |     Documentation    |     Premium Support

Change frequency of GraticuleFeatureLayer lines

Hello,

I use a GraticuleFeatureLayer to create the latitude and longitude grid on a map. Is there a way to change the number of lines/features that are drawn on this layer? For example, if I wanted to give users the option to have a high frequency or low frequency of grid lines.

I currently override the GraticuleFeatureLayer DrawCore for some other customizations, and use GetFeaturesForDrawing(). This function seems to return 12-18 features depending on the zoom level.

Thanks,
Dane

Hi Dane,

Yes, there’s a field graticuleDensity, but it’s private. I’ve made some change on it, so you could change it by the following code after upgrade your ThinkGeo.Core to 13.0.0-beta323:

GraticuleFeatureLayer gFeatureLayer = new GraticuleFeatureLayer(20);
((GraticuleFeatureSource)gFeatureLayer.FeatureSource).GraticuleDensity = 25;

GraticuleDensity must be in the range from 5 to 50, including 5 and 50.

Thanks,
Leo

1 Like