ThinkGeo.com    |     Documentation    |     Premium Support

GraticuleAdornmentLayer Labels

Hello,

We have created our own GraticuleAdornmentLayer inherited from Core.GraticuleAdornmentLayer, and overridden DrawCore. Our version does not automatically show the Lat/Lon labels of the lines, and I’m not sure why. Should these show up by default? By overriding DrawCore, have we removed that functionality, and need to replace it in the code? As of now we are using a LatLonNumAdormentLayer from code found on this site.

Thanks,
Dib

Hi Dib,

If you remove the base.DrawCore in DrawCore which means you need to draw everything include the label by your custom code, so please complete the render logic here.

What’s the purpose here to override DrawCore of the GraticuleAdornmentLayer?

Regards,

Don

Don,

We needed to add functionality, namely showing 1 degree lat/lon ticks (the + symbol), between the solid lines when they are spaced 5 degrees apart. I used code found on your site to create ours. It worked very well.

We have since moved from a decimal degree projection to a web mercator one, and our base map limits are 300 lon east to 0 west. Our code now has to convert the lat/lon locations of the lines to the new extent in the drawing loop. This is slowing down the redraw, something we didn’t see when using decimal degrees. Do you know of any ways to speed up the conversion?

Hi Dib,

If you had to convert the projection on the fly, I think the performance is not easy to get enhancement.

But I think you can try something like this:

  1. Do spatial query between the lines and your current extent, then convert the cut lines, it can reduce the reprojection calculate time.

  2. Pre-build the lines into some data format like a shape file, then directly render it.

  3. Use cache for your lines.

Wish that’s helpful, I hadn’t thought other solutions about this problem, if I found any idea about this I will update to let you know.

Regards,

Don

Don,

Thanks for the thoughts. We are going to try out the shape file option.

Hi Dib,

I am glad to hear that’s helpful.

Regards,

Don