# Graticule Customization

**URL:** <https://community.thinkgeo.com/t/graticule-customization/2024>\
**Category:** WinForms\
**Created:** [July 6, 2012, 3:20pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024 "2012-07-06T15:20:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@Damian1](https://community.thinkgeo.com/u/Damian1)\
**Post date:** [July 6, 2012, 3:20pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024/1 "2012-07-06T15:20:01Z")

</div>

Hi,

I've&nbsp;recently&nbsp;been&nbsp;working&nbsp;on&nbsp;a&nbsp;project&nbsp;that&nbsp;is&nbsp;supposed&nbsp;to&nbsp;be&nbsp;using&nbsp;Spherical&nbsp;Mercator&nbsp;as&nbsp;the&nbsp;internal&nbsp;projection.&nbsp;&nbsp;In&nbsp;this&nbsp;project,&nbsp;I&nbsp;have&nbsp;a&nbsp;graticule&nbsp;layer.&nbsp;&nbsp;However,&nbsp;the&nbsp;graticule&nbsp;only&nbsp;displays&nbsp;in&nbsp;decimal&nbsp;degrees&nbsp;instead&nbsp;of&nbsp;meters&nbsp;and&nbsp;the&nbsp;interval&nbsp;is&nbsp;hardcoded&nbsp;to&nbsp;50&nbsp;degrees&nbsp;no&nbsp;matter&nbsp;what&nbsp;my&nbsp;zoom&nbsp;level.

I&nbsp;read&nbsp;previously&nbsp;in&nbsp;the&nbsp;"Graticule&nbsp;with&nbsp;Google&nbsp;Projection"&nbsp;sample&nbsp;project&nbsp;that&nbsp;the&nbsp;graticule&nbsp;layer&nbsp;is&nbsp;inherently&nbsp;geodetic,&nbsp;and&nbsp;you&nbsp;must&nbsp;set&nbsp;the&nbsp;internal&nbsp;projection&nbsp;of&nbsp;this&nbsp;layer&nbsp;to&nbsp;WGS84&nbsp;string&nbsp;and&nbsp;the&nbsp;external&nbsp;to&nbsp;the&nbsp;desired&nbsp;(Spherical&nbsp;Mercator);&nbsp;however,&nbsp;this&nbsp;still&nbsp;yields&nbsp;a&nbsp;graticule&nbsp;in&nbsp;decimal&nbsp;degrees&nbsp;and&nbsp;at&nbsp;50&nbsp;degrees&nbsp;interval.

How&nbsp;do&nbsp;I&nbsp;display&nbsp;the&nbsp;graticule&nbsp;in&nbsp;meters&nbsp;and&nbsp;to&nbsp;control&nbsp;the&nbsp;interval&nbsp;more&nbsp;sensibly?

Thanks,

Damian&nbsp;A.&nbsp;Hite

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [July 12, 2012, 3:09am UTC](https://community.thinkgeo.com/t/graticule-customization/2024/2 "2012-07-12T03:09:43Z")

</div>

Hi&nbsp;Damian,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Currently,&nbsp;it’s&nbsp;hard&nbsp;to&nbsp;do&nbsp;this,&nbsp;if&nbsp;we&nbsp;overwrite&nbsp;the&nbsp;drawCore&nbsp;method&nbsp;of&nbsp;the&nbsp;GraticuleLayer,&nbsp;that’s&nbsp;a&nbsp;bit&nbsp;complicated,&nbsp;now&nbsp;we&nbsp;are&nbsp;considering&nbsp;public&nbsp;more&nbsp;APIs,&nbsp;so&nbsp;that&nbsp;we&nbsp;can&nbsp;be&nbsp;easy&nbsp;to&nbsp;customize&nbsp;some&nbsp;prameters.&nbsp;We&nbsp;will&nbsp;update&nbsp;the&nbsp;status&nbsp;ASAP.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Best&nbsp;Regards!&nbsp;  
&nbsp;Johnny

---

<div class="post-metadata">

**Author:** ![Damian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@Damian1](https://community.thinkgeo.com/u/Damian1)\
**Post date:** [July 12, 2012, 1:12pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024/3 "2012-07-12T13:12:03Z")

</div>

Hi&nbsp;Johnny,

Okay,&nbsp;so&nbsp;maybe&nbsp;making&nbsp;the&nbsp;labels&nbsp;into&nbsp;meters&nbsp;is&nbsp;difficult,&nbsp;but&nbsp;I&nbsp;am&nbsp;still&nbsp;having&nbsp;some&nbsp;problems&nbsp;just&nbsp;using&nbsp;the&nbsp;graticule&nbsp;in&nbsp;other&nbsp;projections&nbsp;that&nbsp;maybe&nbsp;you&nbsp;could&nbsp;explain&nbsp;or&nbsp;help&nbsp;me&nbsp;to&nbsp;fix.

Attached&nbsp;is&nbsp;a&nbsp;short&nbsp;project.&nbsp;&nbsp;In&nbsp;the&nbsp;form&nbsp;load&nbsp;event,&nbsp;the&nbsp;countries02.shp&nbsp;is&nbsp;loaded&nbsp;and&nbsp;also&nbsp;a&nbsp;graticule&nbsp;adornment&nbsp;layer.&nbsp;&nbsp;For&nbsp;this&nbsp;initial&nbsp;run,&nbsp;the&nbsp;MapUnit&nbsp;is&nbsp;in&nbsp;DecimalDegrees.&nbsp;&nbsp;All&nbsp;displays&nbsp;as&nbsp;expected.&nbsp;&nbsp;When&nbsp;I&nbsp;zoom,&nbsp;the&nbsp;graticule&nbsp;lines&nbsp;show&nbsp;finer&nbsp;spacing.

I&nbsp;have&nbsp;added&nbsp;a&nbsp;button&nbsp;to&nbsp;the&nbsp;form.&nbsp;&nbsp;When&nbsp;you&nbsp;click&nbsp;the&nbsp;button,&nbsp;the&nbsp;MapUnit&nbsp;is&nbsp;changed&nbsp;to&nbsp;Meters&nbsp;and&nbsp;the&nbsp;external&nbsp;projection&nbsp;of&nbsp;the&nbsp;shape&nbsp;and&nbsp;graticule&nbsp;are&nbsp;updated&nbsp;to&nbsp;Spherical&nbsp;Mercator.&nbsp;&nbsp;The&nbsp;shape&nbsp;file&nbsp;looks&nbsp;correct,&nbsp;but&nbsp;the&nbsp;graticule&nbsp;still&nbsp;displays&nbsp;in&nbsp;it's&nbsp;original&nbsp;coordinate&nbsp;space,&nbsp;so&nbsp;you&nbsp;have&nbsp;to&nbsp;zoom&nbsp;in&nbsp;to&nbsp;see&nbsp;it's&nbsp;off&nbsp;the&nbsp;west&nbsp;coast&nbsp;of&nbsp;Africa.&nbsp;&nbsp;Why&nbsp;doesn't&nbsp;the&nbsp;graticule&nbsp;update&nbsp;to&nbsp;be&nbsp;on&nbsp;the&nbsp;Spherical&nbsp;Mercator&nbsp;grid?

If&nbsp;you&nbsp;click&nbsp;the&nbsp;button&nbsp;again,&nbsp;you&nbsp;will&nbsp;go&nbsp;back&nbsp;to&nbsp;the&nbsp;Decimal&nbsp;Degrees&nbsp;unit&nbsp;and&nbsp;all&nbsp;displays&nbsp;and&nbsp;zooms&nbsp;as&nbsp;expected.

In&nbsp;the&nbsp;code,&nbsp;I&nbsp;have&nbsp;3&nbsp;questions&nbsp;surrounding&nbsp;some&nbsp;lines&nbsp;of&nbsp;code&nbsp;where&nbsp;something&nbsp;isn't&nbsp;acting&nbsp;as&nbsp;I&nbsp;expect.&nbsp;&nbsp;If&nbsp;you&nbsp;could&nbsp;answer&nbsp;them,&nbsp;that&nbsp;would&nbsp;be&nbsp;great.

Even&nbsp;better,&nbsp;if&nbsp;you&nbsp;could&nbsp;get&nbsp;this&nbsp;project&nbsp;to&nbsp;work&nbsp;in&nbsp;the&nbsp;Spherical&nbsp;Mercator&nbsp;mode&nbsp;so&nbsp;that&nbsp;the&nbsp;graticule&nbsp;will&nbsp;be&nbsp;the&nbsp;correct&nbsp;extent&nbsp;and&nbsp;the&nbsp;graticule&nbsp;lines&nbsp;update&nbsp;based&nbsp;on&nbsp;the&nbsp;zoom&nbsp;level&nbsp;I&nbsp;would&nbsp;be&nbsp;most&nbsp;happy.

Thanks&nbsp;and&nbsp;Regards,

Damian

[GraticuleVsMapUnit.zip](https://community.thinkgeo.com/uploads/default/original/2X/a/a9f88f0e82b49eacd6d5645ae804e93e225ca239.zip) (39.3 KB)

---

<div class="post-metadata">

**Author:** ![Ben](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ben/32/25720_2.png) [@Ben](https://community.thinkgeo.com/u/Ben)\
**Post date:** [July 16, 2012, 4:08am UTC](https://community.thinkgeo.com/t/graticule-customization/2024/4 "2012-07-16T04:08:18Z")

</div>

&nbsp;Damian,

This&nbsp;issue&nbsp;has&nbsp;been&nbsp;fixed&nbsp;and&nbsp;your&nbsp;sample&nbsp;runs&nbsp;fine&nbsp;now&nbsp;with&nbsp;the&nbsp;lastest&nbsp;code,&nbsp;so&nbsp;please&nbsp;download&nbsp;6.0.64.0&nbsp;(dev&nbsp;branch)&nbsp;or&nbsp;6.0.0.64(release&nbsp;branch)&nbsp;and&nbsp;have&nbsp;another&nbsp;try.

Thanks,

Ben

---

<div class="post-metadata">

**Author:** ![Damian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@Damian1](https://community.thinkgeo.com/u/Damian1)\
**Post date:** [July 16, 2012, 11:01am UTC](https://community.thinkgeo.com/t/graticule-customization/2024/5 "2012-07-16T11:01:33Z")

</div>

Hi&nbsp;Ben,

I've&nbsp;loaded&nbsp;in&nbsp;6.0.0.64&nbsp;and&nbsp;it's&nbsp;still&nbsp;the&nbsp;same&nbsp;as&nbsp;before.&nbsp;&nbsp;When&nbsp;in&nbsp;spherical&nbsp;mercator&nbsp;mode&nbsp;with&nbsp;map&nbsp;unit&nbsp;in&nbsp;meters,&nbsp;the&nbsp;graticule&nbsp;displays&nbsp;as&nbsp;a&nbsp;tiny&nbsp;grid&nbsp;of&nbsp;lines&nbsp;centered&nbsp;around&nbsp;X,&nbsp;Y&nbsp;(0,0).

See&nbsp;screen&nbsp;capture.

Regards,

Damian

---

<div class="post-metadata">

**Author:** ![Ben](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ben/32/25720_2.png) [@Ben](https://community.thinkgeo.com/u/Ben)\
**Post date:** [July 16, 2012, 10:42pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024/6 "2012-07-16T22:42:08Z")

</div>

&nbsp;Damian,

I'm&nbsp;sorry&nbsp;we&nbsp;had&nbsp;some&nbsp;issues&nbsp;in&nbsp;auto&nbsp;build&nbsp;and&nbsp;the&nbsp;changes&nbsp;are&nbsp;not&nbsp;integrated&nbsp;in.&nbsp;Please&nbsp;get&nbsp;today's&nbsp;version&nbsp;then&nbsp;(6.0.0.65)&nbsp;and&nbsp;have&nbsp;another&nbsp;try.&nbsp;Also&nbsp;we&nbsp;simplified&nbsp;your&nbsp;code&nbsp;and&nbsp;you&nbsp;can&nbsp;easily&nbsp;tell&nbsp;what&nbsp;is&nbsp;the&nbsp;minum&nbsp;code&nbsp;you&nbsp;need&nbsp;to&nbsp;implement&nbsp;such&nbsp;feature&nbsp;and&nbsp;what&nbsp;issues&nbsp;there&nbsp;in&nbsp;the&nbsp;original&nbsp;code.&nbsp;Please&nbsp;have&nbsp;a&nbsp;look.&nbsp;

Ben

[GraticuleVsMapUnit0717.zip](https://community.thinkgeo.com/uploads/default/original/2X/e/e2c7d73d489b94bf1395b3effa9a5035dcf7574d.zip) (11.8 KB)

---

<div class="post-metadata">

**Author:** ![Damian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@Damian1](https://community.thinkgeo.com/u/Damian1)\
**Post date:** [July 17, 2012, 4:06pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024/7 "2012-07-17T16:06:12Z")

</div>

Ben,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yes,&nbsp;it’s&nbsp;working&nbsp;now.&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Damian

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [July 17, 2012, 5:46pm UTC](https://community.thinkgeo.com/t/graticule-customization/2024/8 "2012-07-17T17:46:40Z")

</div>

Hello&nbsp;Damian,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;your&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
