# Intervention in the functions that are performed in a moment of scale change or view change, before reading data from the database for the map in view of elongated drawing period

**URL:** <https://community.thinkgeo.com/t/intervention-in-the-functions-that-are-performed-in-a-moment-of-scale-change-or-view-change-before-reading-data-from-the-database-for-the-map-in-view-of-elongated-drawing-period/497>\
**Category:** WinForms\
**Created:** [June 24, 2009, 4:16am UTC](https://community.thinkgeo.com/t/intervention-in-the-functions-that-are-performed-in-a-moment-of-scale-change-or-view-change-before-reading-data-from-the-database-for-the-map-in-view-of-elongated-drawing-period/497 "2009-06-24T04:16:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wesolowski](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/w/90db22/32.png) [@wesolowski](https://community.thinkgeo.com/u/wesolowski)\
**Post date:** [June 24, 2009, 4:16am UTC](https://community.thinkgeo.com/t/intervention-in-the-functions-that-are-performed-in-a-moment-of-scale-change-or-view-change-before-reading-data-from-the-database-for-the-map-in-view-of-elongated-drawing-period/497/1 "2009-06-24T04:16:55Z")

</div>

&nbsp;

I&nbsp;want&nbsp;to&nbsp;to&nbsp;draw&nbsp;few&nbsp;countries&nbsp;as&nbsp;a&nbsp;part&nbsp;of&nbsp;Europe&nbsp;on&nbsp;the&nbsp;map.

Every&nbsp;time&nbsp;when&nbsp;current&nbsp;zoom(scale)&nbsp;or&nbsp;extent&nbsp;&nbsp;is&nbsp;changing/changed,&nbsp;before&nbsp;any&nbsp;data&nbsp;for&nbsp;map&nbsp;will&nbsp;be&nbsp;read,&nbsp;the&nbsp;time&nbsp;is&nbsp;wasting.

I&nbsp;want&nbsp;to&nbsp;know&nbsp;what&nbsp;is&nbsp;doing&nbsp;at&nbsp;this&nbsp;time,&nbsp;maybe&nbsp;some&nbsp;functions&nbsp;execute&nbsp;can&nbsp;be&nbsp;skipped&nbsp;before&nbsp;the&nbsp;map&nbsp;will&nbsp;be&nbsp;drawn.&nbsp;

Reading&nbsp;my&nbsp;data&nbsp;from&nbsp;database&nbsp;is&nbsp;quickly&nbsp;(less&nbsp;than&nbsp;1sec&nbsp;.)&nbsp;and&nbsp;I&nbsp;have&nbsp;my&nbsp;own&nbsp;cache&nbsp;from&nbsp;database&nbsp;side.&nbsp;Average&nbsp;count&nbsp;of&nbsp;points&nbsp;to&nbsp;draw&nbsp;is&nbsp;3000.&nbsp;The&nbsp;best&nbsp;performance&nbsp;for&nbsp;WinformsMap&nbsp;is&nbsp;set&nbsp;of&nbsp;maximal&nbsp;500&nbsp;points.

Simpliefy&nbsp;points&nbsp;to&nbsp;draw&nbsp;by&nbsp;using&nbsp;yours&nbsp;algorythms&nbsp;will&nbsp;take&nbsp;time&nbsp;as&nbsp;well.

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [June 24, 2009, 4:29am UTC](https://community.thinkgeo.com/t/intervention-in-the-functions-that-are-performed-in-a-moment-of-scale-change-or-view-change-before-reading-data-from-the-database-for-the-map-in-view-of-elongated-drawing-period/497/2 "2009-06-24T04:29:33Z")

</div>

Pawel,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;interests&nbsp;in&nbsp;MapSutie&nbsp;Desktop&nbsp;Edtion!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Currently,&nbsp;every&nbsp;time&nbsp;the&nbsp;CurrentExtent&nbsp;Changed&nbsp;(Zoom,&nbsp;Scale&nbsp;changed)&nbsp;the&nbsp;map&nbsp;will&nbsp;be&nbsp;redraw,&nbsp;but&nbsp;it&nbsp;will&nbsp;wait&nbsp;some&nbsp;time(less&nbsp;than&nbsp;800&nbsp;ms)&nbsp;before&nbsp;going&nbsp;to&nbsp;draw&nbsp;directly.&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;algorithm&nbsp;would&nbsp;be&nbsp;very&nbsp;useful&nbsp;when&nbsp;you&nbsp;add&nbsp;huge&nbsp;data&nbsp;with&nbsp;many&nbsp;layers,&nbsp;because&nbsp;each&nbsp;operation&nbsp;will&nbsp;take&nbsp;much&nbsp;time&nbsp;to&nbsp;draw,&nbsp;so&nbsp;during&nbsp;the&nbsp;“wasting&nbsp;time”&nbsp;before&nbsp;really&nbsp;drawing,&nbsp;you&nbsp;can&nbsp;give&nbsp;up&nbsp;the&nbsp;just-did&nbsp;operation&nbsp;and&nbsp;do&nbsp;another&nbsp;Extent&nbsp;changed.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;I&nbsp;make&nbsp;myself&nbsp;clear&nbsp;enough.&nbsp;Of&nbsp;course,&nbsp;this&nbsp;will&nbsp;be&nbsp;some&nbsp;stupid&nbsp;if&nbsp;the&nbsp;data&nbsp;is&nbsp;very&nbsp;small&nbsp;just&nbsp;like&nbsp;only&nbsp;one&nbsp;simple&nbsp;world&nbsp;layer&nbsp;is&nbsp;added,&nbsp;we&nbsp;are&nbsp;also&nbsp;considering&nbsp;to&nbsp;let&nbsp;user&nbsp;can&nbsp;control&nbsp;the&nbsp;time&nbsp;elapsed&nbsp;before&nbsp;drawing.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;for&nbsp;the&nbsp;inconvenience.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;problems&nbsp;just&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;
