# ZoomLevel issue

**URL:** <https://community.thinkgeo.com/t/zoomlevel-issue/10643>\
**Category:** ThinkGeo UI for Desktop\
**Created:** [June 23, 2025, 2:40pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643 "2025-06-23T14:40:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 23, 2025, 2:40pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/1 "2025-06-23T14:40:27Z")

</div>

Hi Team,

I am facing the following issue when the zoomlevel is set to Level 3 which is custom =\>147647947.5

```auto
System.InvalidOperationException: latitude or longitude exceeded limits
   at ThinkGeo.Core.Overlay.<DrawAsync>d__77.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<DrawOverlayAsync>d__369.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<DrawOverlaysAsync>d__364.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<DrawAsyncCore>d__302.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<DrawAsync>d__301.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<RefreshAsync>d__288.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<RefreshAsync>d__287.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ThinkGeo.Core.MapViewBase.<ZoomStoryboard_Completed>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

```

I am using ThinkGeo version 14.2.6

Can some one please help here?

Thanks,  
Jayshree

---

<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:** [June 23, 2025, 3:55pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/2 "2025-06-23T15:55:18Z")

</div>

Hi Jayshree,

The exception is from the reprojection. Can you check your code and make sure the projection is consistent with your data? Can you send over your code snippet regarding the layer/projection configuration?

Thanks,  
Ben

---

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 24, 2025, 10:04am UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/3 "2025-06-24T10:04:41Z")

</div>

Hi Ben,

I am using the following projection,

InternalProjection =\> 27700  
ExternalProjection =\> 3857

Shape =\> -724626.700055006,863325.948658728,1347611.70005501,-189425.948658728  
Shape =\> {0,673900,622985,0}

Thanks,  
Jayshree

---

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 24, 2025, 11:22am UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/4 "2025-06-24T11:22:06Z")

</div>

More information,

 ![image](https://community.thinkgeo.com/uploads/default/original/3X/6/4/64ac843389870e07c99a7a3eee75cb72f5bb7827.png)

shape =\> -29618123.0525023,16173294.2177723,0

 ![image](https://community.thinkgeo.com/uploads/default/original/3X/e/2/e2d5236779cfc405ba86cde906b13b07ca2a6ccd.png)

---

<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:** [June 24, 2025, 1:45pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/5 "2025-06-24T13:45:38Z")

</div>

Hi Jayshree,

I cannot recreate your issue. I tried the following code with your data and they all return correctly.

```
 var converted1 = ProjectionConverter.Convert(27700, 3857, new PointShape(-724626.700055006, 863325.948658728)); 
 var converted2 = ProjectionConverter.Convert(27700, 3857, new PointShape(1347611.70005501, -189425.948658728));
 var vertices1 = new Vertex[] { new Vertex(-724626.700055006, 863325.948658728), new Vertex(1347611.70005501, -189425.948658728) };
 var converted3 = ProjectionConverter.Convert(27700, 3857, new Feature(new LineShape(vertices1)));

 var converted4 = ProjectionConverter.Convert(27700, 3857, new PointShape(0, 673900));
 var converted5 = ProjectionConverter.Convert(27700, 3857, new PointShape(622985, 0));
 var vertices2 = new Vertex[] { new Vertex(0, 673900), new Vertex(622985, 0) };
 var converted6 = ProjectionConverter.Convert(27700, 3857, new Feature(new LineShape(vertices2)));

```

Here is a trick for you to debug, you can replace your ProjectionConverter with your own custom class:

```
class MyProjectionConverter : ProjectionConverter
{
    protected override Collection<Vertex> ConvertToExternalProjectionCore(IEnumerable<Vertex> verticies)
    {
        return base.ConvertToExternalProjectionCore(verticies);
    }
}

```

Then whenever it throws an exception, you can get the vertices which causes the exception. Send over those vertices to us and we can dig in.

Thanks,  
Ben

---

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 24, 2025, 1:47pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/6 "2025-06-24T13:47:32Z")

</div>

shape =\> -29618123.0525023,16173294.2177723,0

Have u tried with this vertices??

---

<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:** [June 24, 2025, 2:33pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/7 "2025-06-24T14:33:56Z")

</div>

Yes, did you try it on your side?

![image](https://community.thinkgeo.com/uploads/default/optimized/3X/f/f/ff8c55a88050e75c48ce306ed6be963da60c561b_2_690x28.png)

---

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 24, 2025, 4:10pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/8 "2025-06-24T16:10:09Z")

</div>

Hi Ben,

Sorry for the confusion, I am using following

var projectionConverter = new ProjectionConverter(internalProjection, externalProjection);  
projectionConverter.Open();  
projectionConverter.ConvertToExternalProjection(shape) \<== this is the line which is causing error

inputs :  
shape =\> -24579533.175198,13840383.2507416,0  
internalProjection =\>3857  
externalProjection =\> 27700

Could you please help here?

Thanks,  
Jayshree

---

<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:** [June 24, 2025, 6:51pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/9 "2025-06-24T18:51:38Z")

</div>

Hi Jayshree,

The x value `-24579533.175198` lies outside the “valid zone” supported by the built-in `ProjectionConverter` , so it cannot handle that coordinate. For a more robust transformation you can use GDAL’s converter:

1. Install the ThinkGeo.Gdal Nuget package

2. Use this code:

**Note:** EPSG 27700 is defined only for Great Britain. Converting coordinates far outside that region may produce inaccurate or misleading results.

Thanks,  
Ben

---

<div class="post-metadata">

**Author:** ![Jayshree](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jayshree](https://community.thinkgeo.com/u/Jayshree)\
**Post date:** [June 25, 2025, 9:41am UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/10 "2025-06-25T09:41:59Z")

</div>

Thanks Ben!!!  
Appreciate your help on this.

---

<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:** [June 25, 2025, 3:05pm UTC](https://community.thinkgeo.com/t/zoomlevel-issue/10643/11 "2025-06-25T15:05:32Z")

</div>

My Pleasure, Jayshree!
