# MapEngine.Draw()

**URL:** <https://community.thinkgeo.com/t/mapengine-draw/7161>\
**Category:** Services\
**Created:** [September 8, 2011, 9:37am UTC](https://community.thinkgeo.com/t/mapengine-draw/7161 "2011-09-08T09:37:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [September 8, 2011, 9:37am UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/1 "2011-09-08T09:37:21Z")

</div>

Hello,

I'm&nbsp;simply&nbsp;wondering&nbsp;if&nbsp;when&nbsp;using&nbsp;the&nbsp;MapEngine.Draw(layer)&nbsp;function,&nbsp;&nbsp;labels&nbsp;are&nbsp;accounted&nbsp;for&nbsp;on&nbsp;other&nbsp;layers&nbsp;in&nbsp;the&nbsp;same&nbsp;engine,&nbsp;as&nbsp;they&nbsp;are&nbsp;with&nbsp;MapEngine.DrawStaticLayers,&nbsp;etc.&nbsp;Specifically,&nbsp;I'm&nbsp;wondering&nbsp;if&nbsp;labels&nbsp;will&nbsp;overlap,&nbsp;even&nbsp;if&nbsp;the&nbsp;TextStyles&nbsp;are&nbsp;set&nbsp;to&nbsp;not&nbsp;allow&nbsp;overlapping.&nbsp;I&nbsp;hope&nbsp;that's&nbsp;clear&nbsp;enough,&nbsp;it's&nbsp;sort&nbsp;of&nbsp;a&nbsp;convoluted&nbsp;question...&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;help!

-Dustin

---

<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:** [September 8, 2011, 1:26pm UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/2 "2011-09-08T13:26:01Z")

</div>

Dustin,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;questions!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Before&nbsp;answer&nbsp;your&nbsp;questions&nbsp;I&nbsp;need&nbsp;to&nbsp;confirm&nbsp;with&nbsp;your&nbsp;question,&nbsp;did&nbsp;you&nbsp;mean&nbsp;that&nbsp;you&nbsp;want&nbsp;to&nbsp;implement&nbsp;the&nbsp;labels&nbsp;are&nbsp;not&nbsp;allow&nbsp;overlapping&nbsp;for&nbsp;several&nbsp;layers?&nbsp;If&nbsp;that,&nbsp;first&nbsp;I&nbsp;need&nbsp;to&nbsp;tell&nbsp;you&nbsp;the&nbsp;overlapping&nbsp;property&nbsp;is&nbsp;just&nbsp;for&nbsp;the&nbsp;labels&nbsp;of&nbsp;one&nbsp;layer,&nbsp;so&nbsp;the&nbsp;overlapping&nbsp;property&nbsp;just&nbsp;affects&nbsp;to&nbsp;all&nbsp;labels&nbsp;on&nbsp;one&nbsp;layer,&nbsp;if&nbsp;you&nbsp;have&nbsp;many&nbsp;layers&nbsp;with&nbsp;labels,&nbsp;we&nbsp;cannot&nbsp;ensure&nbsp;all&nbsp;labels&nbsp;on&nbsp;all&nbsp;layers&nbsp;are&nbsp;not&nbsp;overlapped.&nbsp;The&nbsp;overlapping&nbsp;property&nbsp;is&nbsp;just&nbsp;for&nbsp;one&nbsp;layer’s&nbsp;labels.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;to&nbsp;be&nbsp;implemented&nbsp;your&nbsp;requirements,&nbsp;I&nbsp;suggest&nbsp;you&nbsp;to&nbsp;do:&nbsp;  
&nbsp;&nbsp;  
&nbsp;1,&nbsp;When&nbsp;initializing&nbsp;the&nbsp;layers,&nbsp;please&nbsp;void&nbsp;the&nbsp;overlap&nbsp;issue&nbsp;as&nbsp;possible.&nbsp;  
&nbsp;2,&nbsp;Set&nbsp;the&nbsp;property&nbsp;of&nbsp;text&nbsp;style&nbsp;for&nbsp;each&nbsp;layer&nbsp;according&nbsp;to&nbsp;different&nbsp;zoomlevels.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;the&nbsp;methods&nbsp;can&nbsp;help&nbsp;you&nbsp;to&nbsp;avoid&nbsp;the&nbsp;overlap&nbsp;issues&nbsp;for&nbsp;all&nbsp;labels&nbsp;on&nbsp;all&nbsp;layers&nbsp;as&nbsp;possible,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Scott,

---

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [September 8, 2011, 2:31pm UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/3 "2011-09-08T14:31:41Z")

</div>

Hi&nbsp;Scott,

Thank&nbsp;you&nbsp;for&nbsp;the&nbsp;quick&nbsp;response!&nbsp;I&nbsp;now&nbsp;understand&nbsp;that&nbsp;the&nbsp;overlap&nbsp;property&nbsp;is&nbsp;just&nbsp;for&nbsp;one&nbsp;layer.&nbsp;However,&nbsp;I&nbsp;am&nbsp;confused&nbsp;about&nbsp;one&nbsp;thing.&nbsp;In&nbsp;the&nbsp;DrawCore&nbsp;method&nbsp;of&nbsp;a&nbsp;layer,&nbsp;there&nbsp;is&nbsp;a&nbsp;parameter&nbsp;for&nbsp;'AllLabelingCandidates'&nbsp;(I&nbsp;can't&nbsp;remember&nbsp;the&nbsp;actual&nbsp;name&nbsp;of&nbsp;the&nbsp;parameter,&nbsp;but&nbsp;it's&nbsp;something&nbsp;to&nbsp;that&nbsp;effect)&nbsp;that&nbsp;is&nbsp;supposed&nbsp;to&nbsp;ensure&nbsp;the&nbsp;'best&nbsp;placement'&nbsp;of&nbsp;labels&nbsp;on&nbsp;multiple&nbsp;layers,&nbsp;to&nbsp;minimize&nbsp;them&nbsp;running&nbsp;together&nbsp;or&nbsp;overlapping.&nbsp;I&nbsp;guess&nbsp;I'm&nbsp;just&nbsp;wondering&nbsp;that&nbsp;if&nbsp;the&nbsp;layers&nbsp;are&nbsp;drawn&nbsp;seperatley,&nbsp;does&nbsp;this&nbsp;collection&nbsp;remain&nbsp;intact&nbsp;between&nbsp;layers,&nbsp;or&nbsp;is&nbsp;it&nbsp;cleared&nbsp;out&nbsp;before&nbsp;each&nbsp;layer&nbsp;is&nbsp;drawn?&nbsp;Thanks&nbsp;again!

-Dustin

---

<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:** [September 9, 2011, 1:54pm UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/4 "2011-09-09T13:54:45Z")

</div>

Dustin,&nbsp;  
&nbsp;&nbsp;  
&nbsp;The&nbsp;AllLabelingCandiates&nbsp;represent&nbsp;all&nbsp;labels&nbsp;in&nbsp;all&nbsp;layers,&nbsp;this&nbsp;collection&nbsp;remain&nbsp;intact&nbsp;between&nbsp;layers&nbsp;when&nbsp;drawing,&nbsp;actually,&nbsp;you&nbsp;can&nbsp;judge&nbsp;the&nbsp;relationships&nbsp;such&nbsp;as&nbsp;overlap&nbsp;for&nbsp;this&nbsp;collection.&nbsp;Also&nbsp;I&nbsp;didn’t&nbsp;suggest&nbsp;you&nbsp;to&nbsp;do&nbsp;that,&nbsp;the&nbsp;correct&nbsp;logic&nbsp;is&nbsp;that&nbsp;the&nbsp;overlap&nbsp;property&nbsp;is&nbsp;set&nbsp;for&nbsp;each&nbsp;layer’s&nbsp;text&nbsp;style,&nbsp;so&nbsp;it&nbsp;just&nbsp;affects&nbsp;to&nbsp;one&nbsp;layer.&nbsp;Please&nbsp;avoid&nbsp;this&nbsp;situation&nbsp;and&nbsp;adjust&nbsp;all&nbsp;labels&nbsp;to&nbsp;display&nbsp;according&nbsp;to&nbsp;different&nbsp;zoomlevels.&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;implement&nbsp;it&nbsp;by&nbsp;overriding&nbsp;the&nbsp;DrawCore&nbsp;method,&nbsp;the&nbsp;logic&nbsp;is&nbsp;complex&nbsp;should&nbsp;cost&nbsp;many&nbsp;times&nbsp;to&nbsp;code&nbsp;and&nbsp;test&nbsp;the&nbsp;results.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Scott,

---

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [September 12, 2011, 11:00am UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/5 "2011-09-12T11:00:44Z")

</div>

Scott&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;response!&nbsp;That’s&nbsp;pretty&nbsp;much&nbsp;was&nbsp;I&nbsp;was&nbsp;expecting&nbsp;you&nbsp;to&nbsp;say,&nbsp;I&nbsp;just&nbsp;wanted&nbsp;to&nbsp;be&nbsp;sure.&nbsp;&nbsp;  
&nbsp;-Dustin

---

<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 13, 2011, 7:54am UTC](https://community.thinkgeo.com/t/mapengine-draw/7161/6 "2011-09-13T07:54:39Z")

</div>

Dustin,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;don’t&nbsp;be&nbsp;hesitate&nbsp;to&nbsp;tell&nbsp;us.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
