# The input double value is out of range. Parameter name: width

**URL:** <https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296>\
**Category:** WPF\
**Created:** [September 18, 2012, 2:07pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296 "2012-09-18T14:07:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael9](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@Michael9](https://community.thinkgeo.com/u/Michael9)\
**Post date:** [September 18, 2012, 2:07pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/1 "2012-09-18T14:07:27Z")

</div>

&nbsp;I&nbsp;am&nbsp;tryng&nbsp;to&nbsp;access&nbsp;wpfMap&nbsp;Witdh&nbsp;and&nbsp;Heights&nbsp;using&nbsp;HelloWorld\_WPFDesktop&nbsp;example,&nbsp;but&nbsp;both&nbsp;of&nbsp;them&nbsp;are&nbsp;NaN.

Any&nbsp;idea&nbsp;why&nbsp;it&nbsp;is&nbsp;happenning&nbsp;?&nbsp;(I&nbsp;am&nbsp;running&nbsp;latest&nbsp;trial&nbsp;version)

&nbsp;

&nbsp;

` private void wpfMap1_CurrentScaleChanged(object sender, CurrentScaleChangedWpfMapEventArgs e)        {            ZoomLevel zl = wpfMap1.ZoomLevelSet.GetZoomLevel(wpfMap1.CurrentExtent, wpfMap1.Width, wpfMap1.MapUnit);        }`

---

<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:** [September 18, 2012, 3:06pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/2 "2012-09-18T15:06:31Z")

</div>

Hello&nbsp;Michael,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;do&nbsp;you&nbsp;modify&nbsp;anything&nbsp;of&nbsp;that&nbsp;sample?&nbsp;Is&nbsp;that&nbsp;possible&nbsp;you&nbsp;can&nbsp;upload&nbsp;it&nbsp;here?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Michael9](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@Michael9](https://community.thinkgeo.com/u/Michael9)\
**Post date:** [September 18, 2012, 7:29pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/3 "2012-09-18T19:29:05Z")

</div>

&nbsp;Hi&nbsp;Gary,

I&nbsp;only&nbsp;upgraded&nbsp;it&nbsp;to&nbsp;VS2010&nbsp;and&nbsp;added&nbsp;wpfMap1\_CurrentScaleChanged&nbsp;handler.

Plese,&nbsp;look&nbsp;onto&nbsp;attached&nbsp;zip.

Thank&nbsp;you,

Michael

&nbsp;

[HelloWorld\_WPFDesktopZoom.zip](https://community.thinkgeo.com/uploads/default/original/2X/b/bda8edd2402ceaefcfaf1ed4174f23491ed2e466.zip) (32.1 KB)

---

<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:** [September 19, 2012, 7:01pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/4 "2012-09-19T19:01:00Z")

</div>

&nbsp;Hello&nbsp;Michael,

&nbsp;  
&nbsp;The&nbsp;reason&nbsp;is&nbsp;you&nbsp;are&nbsp;using&nbsp;wpfMap1\_CurrentScaleChanged,&nbsp;and&nbsp;in&nbsp;this&nbsp;time,&nbsp;the&nbsp;map&nbsp;does&nbsp;not&nbsp;totally&nbsp;initialized,&nbsp;so&nbsp;you&nbsp;can't&nbsp;get&nbsp;Width&nbsp;and&nbsp;Height.  
&nbsp;  
&nbsp;You&nbsp;can&nbsp;try:  
`void wpfMap1_CurrentExtentChanged(object sender, CurrentExtentChangedWpfMapEventArgs e)         {             ZoomLevel zl = wpfMap1.ZoomLevelSet.GetZoomLevel(wpfMap1.CurrentExtent, wpfMap1.Width, wpfMap1.MapUnit);         }`  
&nbsp;Let&nbsp;us&nbsp;know&nbsp;your&nbsp;queries.  
&nbsp;  
&nbsp;Regards,  
&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Michael9](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@Michael9](https://community.thinkgeo.com/u/Michael9)\
**Post date:** [September 19, 2012, 9:28pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/5 "2012-09-19T21:28:40Z")

</div>

&nbsp;Hi&nbsp;Gary,

&nbsp;

Unfortunately&nbsp;that&nbsp;change&nbsp;did&nbsp;not&nbsp;helped&nbsp;-&nbsp;same&nbsp;error.

Howewer,&nbsp;all&nbsp;working&nbsp;when&nbsp;I&nbsp;am&nbsp;using&nbsp;&nbsp;wpfMap1.ActualWidth

Any&nbsp;idea&nbsp;&nbsp;why&nbsp;?

&nbsp;

Thank&nbsp;you,

&nbsp;

Michael

---

<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:** [September 20, 2012, 5:02pm UTC](https://community.thinkgeo.com/t/the-input-double-value-is-out-of-range-parameter-name-width/3296/6 "2012-09-20T17:02:27Z")

</div>

Hello&nbsp;Machael,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;I&nbsp;made&nbsp;a&nbsp;mistake&nbsp;to&nbsp;paste&nbsp;the&nbsp;code,&nbsp;please&nbsp;use&nbsp;e.MapWidth&nbsp;instead&nbsp;of&nbsp;wpfMap1.Width,&nbsp;the&nbsp;reason&nbsp;is&nbsp;like&nbsp;I&nbsp;said&nbsp;above,&nbsp;the&nbsp;map&nbsp;control&nbsp;does&nbsp;not&nbsp;totally&nbsp;initiative.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
