# Redraw during Popup?

**URL:** <https://community.thinkgeo.com/t/redraw-during-popup/4921>\
**Category:** WebForms\
**Created:** [August 6, 2009, 10:42pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921 "2009-08-06T22:42:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 6, 2009, 10:42pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/1 "2009-08-06T22:42:08Z")

</div>

I&nbsp;have&nbsp;a&nbsp;problem&nbsp;with&nbsp;intermintent&nbsp;redraw&nbsp;of&nbsp;the&nbsp;map&nbsp;during&nbsp;a&nbsp;MapClick&nbsp;event&nbsp;that&nbsp;generates&nbsp;a&nbsp;popup.

it&nbsp;is&nbsp;pretty&nbsp;disturbing&nbsp;for&nbsp;the&nbsp;viewer,&nbsp;is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;get&nbsp;rid&nbsp;of&nbsp;it?

&nbsp;

&nbsp;  
  
  
`    Protected Sub Map1_Click(ByVal sender As Object, ByVal e As ThinkGeo.MapSuite.WebEdition.MapClickedEventArgs) Handles Map1.Click        ' get the click position.        Dim clickWorldPosition As PointShape = e.Position        ' convert to screen point.        Dim clickScreenPoint As ScreenPointF = Map1.ToScreenCoordinate(clickWorldPosition)......                Dim popup As CloudPopup                If Map1.Popups.Count = 0 Then            popup = New CloudPopup("Popup", e.Position, String.Empty, 200, 80, True, True)                    popup.IsVisible = True                    Map1.Popups.Add(popup)                Else                    popup = DirectCast(Map1.Popups("Popup"), CloudPopup)            popup.Position = e.Position            popup.IsVisible = True                End If                popup.ContentHtml = GetPopupContent(selectedFeatures)    End Sub`

---

<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:** [August 9, 2009, 9:51pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/2 "2009-08-09T21:51:35Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Did&nbsp;you&nbsp;put&nbsp;the&nbsp;map&nbsp;within&nbsp;an&nbsp;UpdatePanel?&nbsp;It&nbsp;will&nbsp;not&nbsp;have&nbsp;any&nbsp;flicker&nbsp;if&nbsp;it&nbsp;is&nbsp;in.&nbsp;Please&nbsp;have&nbsp;a&nbsp;look&nbsp;at&nbsp;the&nbsp;sample&nbsp;GettingStarted-\>AddAMarker&nbsp;for&nbsp;detail.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Bai

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 10, 2009, 11:52am UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/3 "2009-08-10T11:52:26Z")

</div>

Yes&nbsp;I&nbsp;have&nbsp;it&nbsp;in&nbsp;Update&nbsp;Panel.&nbsp;  
&nbsp;It&nbsp;still&nbsp;redraws&nbsp;the&nbsp;map.&nbsp;  
&nbsp;Could&nbsp;it&nbsp;be&nbsp;because&nbsp;I&nbsp;am&nbsp;using&nbsp;the&nbsp;GoogleMapsLayer?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Also,&nbsp;the&nbsp;Popup&nbsp;takes&nbsp;quite&nbsp;a&nbsp;while&nbsp;to&nbsp;render&nbsp;(\>2seconds).&nbsp;The&nbsp;contents&nbsp;of&nbsp;the&nbsp;popup&nbsp;displays&nbsp;immediatelly,&nbsp;but&nbsp;on&nbsp;trasparent&nbsp;background&nbsp;and&nbsp;then&nbsp;the&nbsp;popup&nbsp;draws&nbsp;around&nbsp;it&nbsp;2&nbsp;seconds&nbsp;later.&nbsp;Looks&nbsp;wierd.&nbsp;Any&nbsp;way&nbsp;to&nbsp;prevent&nbsp;that?&nbsp;

---

<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:** [August 11, 2009, 1:34am UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/4 "2009-08-11T01:34:54Z")

</div>

Jakub,

It&nbsp;should&nbsp;work&nbsp;fine&nbsp;even&nbsp;with&nbsp;GoogleMapLayer.&nbsp;Please&nbsp;have&nbsp;a&nbsp;look&nbsp;at&nbsp;the&nbsp;attached&nbsp;sample&nbsp;where&nbsp;you&nbsp;can&nbsp;find&nbsp;after&nbsp;putting&nbsp;the&nbsp;map&nbsp;within&nbsp;an&nbsp;undate&nbsp;panel,&nbsp;the&nbsp;map&nbsp;doesn't&nbsp;have&nbsp;any&nbsp;flicker&nbsp;when&nbsp;adding&nbsp;a&nbsp;popup.

Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;issues.

Thanks,

Ben

[1025-TestGoogleMap.zip](https://community.thinkgeo.com/uploads/default/original/2X/6/68c27b71a45805a3db208c1023c475e4993b4548.zip) (17.6 KB)

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 11, 2009, 10:47am UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/5 "2009-08-11T10:47:31Z")

</div>

Yes,&nbsp;it&nbsp;works&nbsp;fine&nbsp;like&nbsp;that&nbsp;with&nbsp;no&nbsp;data.&nbsp;but&nbsp;when&nbsp;there&nbsp;are&nbsp;two&nbsp;shapefiles&nbsp;(50&nbsp;polygons&nbsp;each)&nbsp;and&nbsp;several&nbsp;thousand&nbsp;markers&nbsp;on&nbsp;InMemoryFeatureLayer&nbsp;the&nbsp;map&nbsp;redraws&nbsp;on&nbsp;the&nbsp;first&nbsp;Map\_Click&nbsp;event.&nbsp;&nbsp;  
&nbsp;Also,&nbsp;as&nbsp;mentioned&nbsp;the&nbsp;Popup&nbsp;takes&nbsp;a&nbsp;&nbsp;long&nbsp;time&nbsp;to&nbsp;render,&nbsp;any&nbsp;way&nbsp;to&nbsp;speed&nbsp;it&nbsp;up?&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 12, 2009, 12:46pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/6 "2009-08-12T12:46:13Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Could&nbsp;you&nbsp;provide&nbsp;us&nbsp;what’s&nbsp;the&nbsp;content&nbsp;html&nbsp;of&nbsp;popup&nbsp;did&nbsp;you&nbsp;add?&nbsp;Is&nbsp;it&nbsp;Iframe&nbsp;or&nbsp;something?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard&nbsp;

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 12, 2009, 8:55pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/7 "2009-08-12T20:55:28Z")

</div>

No&nbsp;iframe.&nbsp;The&nbsp;contents&nbsp;is&nbsp;pretty&nbsp;simple&nbsp;just&nbsp;three&nbsp;rows.

But&nbsp;it&nbsp;is&nbsp;not&nbsp;the&nbsp;content.&nbsp;That&nbsp;shows&nbsp;up&nbsp;immediatelly,&nbsp;it&nbsp;is&nbsp;the&nbsp;popup&nbsp;backround&nbsp;(yellow&nbsp;box)&nbsp;that&nbsp;takes&nbsp;forever&nbsp;to&nbsp;draw.

&nbsp;

`  Private Shared Function GetPopupContentPlume(ByVal features As Collection(Of Feature)) As String        Dim content As String = ""        Dim message As New StringBuilder()        Dim messageInPopup As String = ""                message.AppendFormat("Plume")        message.AppendFormat("<li>Plume ID : {0}</li>", features(0).ColumnValues("GWTPLU_ID").Trim())        message.AppendFormat("<li>Haz Site : {0}</li>", features(0).ColumnValues("HAZSITE_ID").Trim())        message.AppendFormat("<li>Plume : {0}</li>", features(0).ColumnValues("PLUME_D").Trim())        messageInPopup = [String].Format("{0}", message.ToString())        content = messageInPopup               Return content    End Function`

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 13, 2009, 3:33pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/8 "2009-08-13T15:33:33Z")

</div>

Jakub,  
  
  
  
The&nbsp;code&nbsp;is&nbsp;exactly&nbsp;right,&nbsp;but&nbsp;I&nbsp;cannot&nbsp;figure&nbsp;out&nbsp;the&nbsp;problem.&nbsp;  
  
Sorry,&nbsp;I&nbsp;need&nbsp;more&nbsp;information&nbsp;about&nbsp;this.&nbsp;  
  
  
  
1,&nbsp;What&nbsp;type&nbsp;of&nbsp;GeoPopup&nbsp;do&nbsp;you&nbsp;use?  
  
2,&nbsp;How&nbsp;many&nbsp;Popups&nbsp;in&nbsp;your&nbsp;map&nbsp;in&nbsp;one&nbsp;viewport?  
  
3,&nbsp;Could&nbsp;you&nbsp;send&nbsp;me&nbsp;some&nbsp;screenshot&nbsp;about&nbsp;the&nbsp;yellow&nbsp;box?  
  
4,&nbsp;If&nbsp;it's&nbsp;possible,&nbsp;please&nbsp;send&nbsp;me&nbsp;a&nbsp;quick&nbsp;sample&nbsp;for&nbsp;me&nbsp;to&nbsp;recreate&nbsp;it.  
  
  
  
We&nbsp;have&nbsp;an&nbsp;online&nbsp;sample&nbsp;which&nbsp;shows&nbsp;the&nbsp;popup&nbsp;background&nbsp;and&nbsp;content&nbsp;at&nbsp;the&nbsp;same&nbsp;time:  
  
[websamples.thinkgeo.com/webe...icked.aspx](http://websamples.thinkgeo.com/webeditionsamples/Samples/GettingStarted/FindTheFeatureTheUserClicked.aspx)  
  
  
  
Looking&nbsp;forward&nbsp;your&nbsp;feedback.  
  
  
  
Thanks,  
  
Howard

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 14, 2009, 2:13pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/9 "2009-08-14T14:13:10Z")

</div>

Hi,

here&nbsp;are&nbsp;your&nbsp;answers

1.&nbsp;Not&nbsp;sure&nbsp;what&nbsp;type&nbsp;of&nbsp;popup.&nbsp;I&nbsp;just&nbsp;took&nbsp;your&nbsp;sample&nbsp;code&nbsp;and&nbsp;used&nbsp;it.&nbsp;I&nbsp;guess&nbsp;it&nbsp;is&nbsp;a&nbsp;cloud&nbsp;popup.&nbsp;are&nbsp;there&nbsp;any&nbsp;other?&nbsp;This&nbsp;is&nbsp;the&nbsp;declaration:&nbsp;Dim&nbsp;popup&nbsp;as&nbsp;CloudPopup

2.&nbsp;I&nbsp;always&nbsp;have&nbsp;only&nbsp;one&nbsp;popup&nbsp;in&nbsp;the&nbsp;viewport.&nbsp;the&nbsp;redraw&nbsp;and&nbsp;slowness&nbsp;manifests&nbsp;only&nbsp;on&nbsp;the&nbsp;first&nbsp;popup&nbsp;anyway.

3.&nbsp;Screenshot&nbsp;below&nbsp;-&nbsp;the&nbsp;left&nbsp;screen&nbsp;was&nbsp;captured&nbsp;about&nbsp;a&nbsp;second&nbsp;after&nbsp;the&nbsp;shapefile&nbsp;was&nbsp;clicked.&nbsp;You&nbsp;can&nbsp;see&nbsp;that&nbsp;the&nbsp;data&nbsp;from&nbsp;the&nbsp;shapefile&nbsp;is&nbsp;already&nbsp;retrieved&nbsp;and&nbsp;displayed,&nbsp;but&nbsp;the&nbsp;map&nbsp;is&nbsp;redrawing&nbsp;and&nbsp;then&nbsp;the&nbsp;popup&nbsp;background&nbsp;will&nbsp;come&nbsp;another&nbsp;second&nbsp;after&nbsp;the&nbsp;redraw&nbsp;completed.&nbsp;Way&nbsp;too&nbsp;long.

4.&nbsp;not&nbsp;sure&nbsp;if&nbsp;i&nbsp;can&nbsp;condense&nbsp;it&nbsp;into&nbsp;a&nbsp;short&nbsp;sample.&nbsp;It&nbsp;is&nbsp;hooked&nbsp;up&nbsp;the&nbsp;SQL&nbsp;and&nbsp;shapefile&nbsp;data.

I&nbsp;started&nbsp;from&nbsp;the&nbsp;sample&nbsp;that&nbsp;you&nbsp;mentioned.

&nbsp;

 ![](https://community.thinkgeo.com/uploads/default/original/2X/c/cb7bfa9439193edfe3084b6a058fab45c89f48c2.jpg)

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 14, 2009, 3:03pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/10 "2009-08-14T15:03:53Z")

</div>

Hi&nbsp;Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;already&nbsp;know&nbsp;what&nbsp;you&nbsp;exactly&nbsp;mean.&nbsp;You&nbsp;are&nbsp;using&nbsp;CloudPopup.&nbsp;We&nbsp;also&nbsp;have&nbsp;CustomPopup&nbsp;which&nbsp;background&nbsp;can&nbsp;be&nbsp;transparent&nbsp;and&nbsp;its&nbsp;border&nbsp;is&nbsp;rectangle.&nbsp;You&nbsp;can&nbsp;make&nbsp;your&nbsp;own&nbsp;graphic&nbsp;as&nbsp;its&nbsp;background.&nbsp;But&nbsp;the&nbsp;disadvantage&nbsp;is&nbsp;that&nbsp;we&nbsp;don’t&nbsp;response&nbsp;for&nbsp;the&nbsp;style&nbsp;any&nbsp;more.&nbsp;For&nbsp;example&nbsp;the&nbsp;arrow&nbsp;and&nbsp;the&nbsp;round&nbsp;corner.&nbsp;It’s&nbsp;not&nbsp;easy&nbsp;to&nbsp;implement&nbsp;a&nbsp;popup&nbsp;like&nbsp;our&nbsp;current&nbsp;CloudPopup.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;the&nbsp;popup&nbsp;shows&nbsp;slow&nbsp;because&nbsp;your&nbsp;web&nbsp;browser&nbsp;is&nbsp;busy&nbsp;on&nbsp;requesting&nbsp;images&nbsp;and&nbsp;delay&nbsp;the&nbsp;background&nbsp;of&nbsp;the&nbsp;popup.&nbsp;My&nbsp;solution&nbsp;is&nbsp;make&nbsp;the&nbsp;background&nbsp;image&nbsp;file&nbsp;length&nbsp;smaller&nbsp;so&nbsp;that&nbsp;the&nbsp;browser&nbsp;can&nbsp;download&nbsp;it&nbsp;fastly.&nbsp;The&nbsp;method&nbsp;is&nbsp;lower&nbsp;quality&nbsp;of&nbsp;the&nbsp;file&nbsp;which&nbsp;you&nbsp;can&nbsp;find&nbsp;at&nbsp;“[Installed&nbsp;Sample]\theme\default\img\cloud\_popup\_relative.gif”.&nbsp;Currently&nbsp;it’s&nbsp;16.2K.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Another&nbsp;solution&nbsp;is&nbsp;more&nbsp;advanced.&nbsp;To&nbsp;show&nbsp;the&nbsp;popup&nbsp;without&nbsp;content&nbsp;html&nbsp;first.&nbsp;Use&nbsp;JavaScript&nbsp;to&nbsp;fill&nbsp;the&nbsp;html&nbsp;content&nbsp;asynchronizely.&nbsp;Hope&nbsp;you&nbsp;understand&nbsp;what&nbsp;I&nbsp;mean.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 16, 2009, 9:41pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/11 "2009-08-16T21:41:01Z")

</div>

But&nbsp;that&nbsp;is&nbsp;what&nbsp;i&nbsp;am&nbsp;trying&nbsp;to&nbsp;prevent&nbsp;in&nbsp;the&nbsp;first&nbsp;place.&nbsp;The&nbsp;refresh&nbsp;of&nbsp;the&nbsp;base&nbsp;map&nbsp;(and&nbsp;reloading&nbsp;the&nbsp;images).&nbsp;The&nbsp;map&nbsp;is&nbsp;completely&nbsp;loaded&nbsp;before&nbsp;the&nbsp;Map\_Click&nbsp;event&nbsp;and&nbsp;and&nbsp;it&nbsp;reloads&nbsp;on&nbsp;the&nbsp;first&nbsp;click&nbsp;ONLY,&nbsp;although&nbsp;it&nbsp;is&nbsp;in&nbsp;the&nbsp;update&nbsp;panel.&nbsp;&nbsp;  
&nbsp;On&nbsp;the&nbsp;mapclick&nbsp;it&nbsp;should&nbsp;only&nbsp;load&nbsp;the&nbsp;data&nbsp;(which&nbsp;it&nbsp;does&nbsp;fast)&nbsp;and&nbsp;a&nbsp;simple&nbsp;popup&nbsp;background&nbsp;image&nbsp;(much&nbsp;smaller&nbsp;size&nbsp;that&nbsp;the&nbsp;data&nbsp;retrieved),&nbsp;yet&nbsp;it&nbsp;takes&nbsp;long&nbsp;time.&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 17, 2009, 3:37pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/12 "2009-08-17T15:37:26Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;agree&nbsp;with&nbsp;you&nbsp;that&nbsp;2&nbsp;seconds&nbsp;takes&nbsp;too&nbsp;much&nbsp;time&nbsp;on&nbsp;the&nbsp;popup.&nbsp;I&nbsp;think&nbsp;your&nbsp;situation&nbsp;is&nbsp;general&nbsp;from&nbsp;the&nbsp;code&nbsp;you&nbsp;send&nbsp;to&nbsp;me.&nbsp;How&nbsp;do&nbsp;you&nbsp;think&nbsp;the&nbsp;speed&nbsp;in&nbsp;our&nbsp;online&nbsp;sample?&nbsp;Is&nbsp;it&nbsp;fast&nbsp;or&nbsp;not?&nbsp;If&nbsp;your&nbsp;situation&nbsp;is&nbsp;special,&nbsp;could&nbsp;you&nbsp;send&nbsp;me&nbsp;a&nbsp;sample&nbsp;to&nbsp;see&nbsp;how&nbsp;it&nbsp;works.&nbsp;Because&nbsp;as&nbsp;I&nbsp;tested,&nbsp;the&nbsp;popup&nbsp;is&nbsp;just&nbsp;a&nbsp;little&nbsp;slow&nbsp;(0.5&nbsp;second&nbsp;delay)&nbsp;than&nbsp;the&nbsp;text&nbsp;loading.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Our&nbsp;map&nbsp;control&nbsp;mains&nbsp;many&nbsp;client&nbsp;states&nbsp;which&nbsp;needs&nbsp;to&nbsp;be&nbsp;synchronize&nbsp;to&nbsp;the&nbsp;server&nbsp;side.&nbsp;Even&nbsp;if&nbsp;you&nbsp;put&nbsp;it&nbsp;in&nbsp;the&nbsp;update&nbsp;panel,&nbsp;it&nbsp;only&nbsp;reduces&nbsp;the&nbsp;size&nbsp;to&nbsp;transfer&nbsp;which&nbsp;is&nbsp;outside&nbsp;the&nbsp;update&nbsp;panel&nbsp;but&nbsp;it&nbsp;cannot&nbsp;reduce&nbsp;the&nbsp;map&nbsp;control’s&nbsp;it&nbsp;self.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;if&nbsp;you&nbsp;can&nbsp;answer&nbsp;me&nbsp;the&nbsp;question&nbsp;above&nbsp;and&nbsp;send&nbsp;me&nbsp;some&nbsp;sample&nbsp;which&nbsp;2&nbsp;seconds&nbsp;delay.&nbsp;It&nbsp;will&nbsp;be&nbsp;great&nbsp;for&nbsp;me&nbsp;the&nbsp;figure&nbsp;out&nbsp;this&nbsp;issue.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 18, 2009, 1:45pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/13 "2009-08-18T13:45:38Z")

</div>

Your&nbsp;sample&nbsp;deals&nbsp;with&nbsp;the&nbsp;static&nbsp;layers&nbsp;and&nbsp;GoogleOverlay&nbsp;map.&nbsp;My&nbsp;app&nbsp;is&nbsp;working&nbsp;with&nbsp;the&nbsp;Google&nbsp;map&nbsp;in&nbsp;the&nbsp;LayerOverlay,&nbsp;because&nbsp;you&nbsp;told&nbsp;me&nbsp;that&nbsp;is&nbsp;the&nbsp;only&nbsp;way&nbsp;to&nbsp;get&nbsp;it&nbsp;printed&nbsp;in&nbsp;the&nbsp;PDF.&nbsp;  
&nbsp;that&nbsp;is&nbsp;where&nbsp;the&nbsp;speed&nbsp;problem&nbsp;is&nbsp;in&nbsp;my&nbsp;opinion.&nbsp;The&nbsp;map&nbsp;was&nbsp;not&nbsp;redrawing&nbsp;during&nbsp;MapClick&nbsp;until&nbsp;i&nbsp;switched&nbsp;it&nbsp;to&nbsp;the&nbsp;LayerOverlay.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 18, 2009, 2:10pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/14 "2009-08-18T14:10:55Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;see.&nbsp;So&nbsp;you&nbsp;change&nbsp;the&nbsp;GoogleOverlay&nbsp;to&nbsp;GoogleMapsLayer&nbsp;for&nbsp;printing&nbsp;into&nbsp;PDF.&nbsp;Now&nbsp;I&nbsp;have&nbsp;another&nbsp;idea&nbsp;for&nbsp;you&nbsp;that&nbsp;you&nbsp;can&nbsp;change&nbsp;back&nbsp;using&nbsp;GoogleOverlay&nbsp;and&nbsp;also&nbsp;can&nbsp;be&nbsp;printed.&nbsp;I&nbsp;think&nbsp;it’s&nbsp;just&nbsp;a&nbsp;trick&nbsp;which&nbsp;is&nbsp;maintaining&nbsp;a&nbsp;LayerOverlay&nbsp;that&nbsp;contains&nbsp;the&nbsp;googleMapsLayer&nbsp;and&nbsp;the&nbsp;other&nbsp;layers.&nbsp;But&nbsp;it&nbsp;doesn’t&nbsp;actually&nbsp;draw&nbsp;on&nbsp;the&nbsp;map.&nbsp;When&nbsp;click&nbsp;to&nbsp;print&nbsp;the&nbsp;map&nbsp;to&nbsp;PDF,&nbsp;we&nbsp;use&nbsp;the&nbsp;temporary&nbsp;LayerOverlay&nbsp;to&nbsp;print&nbsp;instead&nbsp;of&nbsp;the&nbsp;GoogleOverlay.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Hope&nbsp;it&nbsp;makes&nbsp;sense.&nbsp;Please&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;there&nbsp;is&nbsp;any&nbsp;misunderstanding.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 18, 2009, 4:27pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/15 "2009-08-18T16:27:04Z")

</div>

Does&nbsp;not&nbsp;make&nbsp;sense&nbsp;:)&nbsp;  
&nbsp;Can&nbsp;you&nbsp;elaborate.&nbsp;  
&nbsp;My&nbsp;understanding&nbsp;was&nbsp;that&nbsp;I&nbsp;can&nbsp;either&nbsp;load&nbsp;the&nbsp;base&nbsp;layer&nbsp;into&nbsp;a&nbsp;GoogleOvelray&nbsp;(does&nbsp;not&nbsp;print&nbsp;to&nbsp;PDF)&nbsp;or&nbsp;Layer&nbsp;overlay&nbsp;(prints&nbsp;to&nbsp;PDF)&nbsp;&nbsp;  
&nbsp;As&nbsp;I&nbsp;need&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;print&nbsp;to&nbsp;PDf&nbsp;I&nbsp;recoded&nbsp;everything&nbsp;to&nbsp;work&nbsp;with&nbsp;layer&nbsp;overlays.&nbsp;  
&nbsp;what&nbsp;is&nbsp;the&nbsp;trick?&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 19, 2009, 11:29am UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/16 "2009-08-19T11:29:22Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Let&nbsp;me&nbsp;clarify&nbsp;this.&nbsp;&nbsp;  
&nbsp;1. If&nbsp;you&nbsp;don’t&nbsp;need&nbsp;print,&nbsp;does&nbsp;GoogleOverlay&nbsp;satisfy&nbsp;your&nbsp;requirement?&nbsp;  
&nbsp;2. If&nbsp;you&nbsp;don’t&nbsp;display&nbsp;the&nbsp;map,&nbsp;does&nbsp;GoogleMapsLayer&nbsp;satisfy&nbsp;your&nbsp;print&nbsp;requirement?&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;both&nbsp;of&nbsp;the&nbsp;conditions&nbsp;are&nbsp;fine,&nbsp;my&nbsp;trick&nbsp;can&nbsp;implement&nbsp;your&nbsp;requirement&nbsp;by&nbsp;the&nbsp;following&nbsp;steps.&nbsp;  
&nbsp;1. Add&nbsp;GoogleOverlay&nbsp;for&nbsp;displaying&nbsp;on&nbsp;the&nbsp;map&nbsp;as&nbsp;our&nbsp;normal&nbsp;use.&nbsp;  
&nbsp;2. Click&nbsp;print&nbsp;button.&nbsp;&nbsp;  
&nbsp;3. Create&nbsp;a&nbsp;new&nbsp;GoogleMapsLayer&nbsp;and&nbsp;a&nbsp;LayerOverlay&nbsp;  
&nbsp;4. Remove&nbsp;the&nbsp;GoogleOverlay&nbsp;from&nbsp;map.&nbsp;  
&nbsp;5. Add&nbsp;the&nbsp;new&nbsp;LayerOverlay&nbsp;into&nbsp;the&nbsp;map.&nbsp;  
&nbsp;6. Print.&nbsp;  
&nbsp;7. After&nbsp;print&nbsp;completed,&nbsp;re-add&nbsp;the&nbsp;GoogleOverlay&nbsp;back&nbsp;and&nbsp;remove&nbsp;the&nbsp;LayerOverlay.&nbsp;  
&nbsp;&nbsp;  
&nbsp;In&nbsp;my&nbsp;option,&nbsp;GoogleOverlay&nbsp;is&nbsp;faster&nbsp;than&nbsp;GoogleMapsLayer&nbsp;and&nbsp;there&nbsp;is&nbsp;only&nbsp;one&nbsp;logo.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;there&nbsp;is&nbsp;any&nbsp;misunderstanding&nbsp;please&nbsp;point&nbsp;out.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard&nbsp;

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 19, 2009, 12:34pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/17 "2009-08-19T12:34:08Z")

</div>

That&nbsp;could&nbsp;work.&nbsp;  
&nbsp;Lots&nbsp;of&nbsp;swapping&nbsp;of&nbsp;overlays.&nbsp;I’ll&nbsp;see&nbsp;how&nbsp;fast&nbsp;it&nbsp;is.&nbsp;  
&nbsp;thanks

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 19, 2009, 1:11pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/18 "2009-08-19T13:11:30Z")

</div>

Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yes,&nbsp;I&nbsp;think&nbsp;it&nbsp;may&nbsp;confuse&nbsp;many&nbsp;people.&nbsp;And&nbsp;we&nbsp;are&nbsp;lacking&nbsp;of&nbsp;documentations&nbsp;of&nbsp;these&nbsp;APIs.&nbsp;Currently,&nbsp;we&nbsp;have&nbsp;code&nbsp;community&nbsp;which&nbsp;may&nbsp;add&nbsp;more&nbsp;and&nbsp;more&nbsp;customize&nbsp;projects;&nbsp;it’ll&nbsp;be&nbsp;easier&nbsp;for&nbsp;us&nbsp;to&nbsp;find&nbsp;our&nbsp;solutions&nbsp;in&nbsp;the&nbsp;future.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;Please&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;questions.&nbsp;  
&nbsp;Howard

---

<div class="post-metadata">

**Author:** ![Jakub](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jakub](https://community.thinkgeo.com/u/Jakub)\
**Post date:** [August 19, 2009, 10:09pm UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/19 "2009-08-19T22:09:10Z")

</div>

It&nbsp;worked,&nbsp;kind&nbsp;of.&nbsp;  
&nbsp;Since&nbsp;I&nbsp;added&nbsp;just&nbsp;the&nbsp;Google&nbsp;LayerOverlay&nbsp;to&nbsp;existing&nbsp;overlays&nbsp;in&nbsp;the&nbsp;PDF\_ButtonClick&nbsp;it&nbsp;ended&nbsp;up&nbsp;on&nbsp;top&nbsp;of&nbsp;all&nbsp;other&nbsp;overlays,&nbsp;covering&nbsp;them.&nbsp;  
&nbsp;Is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;add&nbsp;it&nbsp;to&nbsp;the&nbsp;bottom?&nbsp;Or&nbsp;restack&nbsp;the&nbsp;ovelays.&nbsp;I&nbsp;would&nbsp;hate&nbsp;to&nbsp;have&nbsp;to&nbsp;remove&nbsp;all&nbsp;of&nbsp;them&nbsp;and&nbsp;re-add&nbsp;them&nbsp;as&nbsp;they&nbsp;are&nbsp;loaded&nbsp;from&nbsp;the&nbsp;database&nbsp;and&nbsp;shapefiles&nbsp;so&nbsp;performane&nbsp;would&nbsp;suffer.&nbsp;  
&nbsp;thanks&nbsp;  
&nbsp;jakub&nbsp;

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [August 20, 2009, 10:22am UTC](https://community.thinkgeo.com/t/redraw-during-popup/4921/20 "2009-08-20T10:22:46Z")

</div>

Hi&nbsp;Jakub,&nbsp;  
&nbsp;&nbsp;  
&nbsp;LayerOverlay.Layers&nbsp;and&nbsp;Map.CustomOverlays&nbsp;are&nbsp;both&nbsp;collections.&nbsp;I&nbsp;think&nbsp;you&nbsp;can&nbsp;try&nbsp;to&nbsp;use&nbsp;Insert&nbsp;method&nbsp;to&nbsp;insert&nbsp;the&nbsp;layer&nbsp;or&nbsp;overlay&nbsp;in&nbsp;the&nbsp;bottom.&nbsp;For&nbsp;example:&nbsp;  
&nbsp;Map1.CustomOverlays.Insert(0,&nbsp;overlay);&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard&nbsp;

[Next page](https://community.thinkgeo.com/t/redraw-during-popup/4921.md?page=2)
