# Custom Overlays Not Rendering After Upgrade to MVC Edition 8

**URL:** <https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313>\
**Category:** MVC\
**Created:** [June 26, 2015, 7:35am UTC](https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313 "2015-06-26T07:35:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael12](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@Michael12](https://community.thinkgeo.com/u/Michael12)\
**Post date:** [June 26, 2015, 7:35am UTC](https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313/1 "2015-06-26T07:35:35Z")

</div>

Hello,  
  
We&nbsp;just&nbsp;upgraded&nbsp;from&nbsp;MVC&nbsp;Edition&nbsp;version&nbsp;7.0&nbsp;to&nbsp;version&nbsp;8.0.336.0&nbsp;to&nbsp;correct&nbsp;an&nbsp;issue&nbsp;we&nbsp;were&nbsp;having&nbsp;with&nbsp;the&nbsp;deployment.&nbsp;Since&nbsp;the&nbsp;upgrade&nbsp;our&nbsp;Overlays&nbsp;containing&nbsp;our&nbsp;layers&nbsp;are&nbsp;not&nbsp;rendering&nbsp;at&nbsp;all&nbsp;if&nbsp;the&nbsp;IsVisible&nbsp;property&nbsp;is&nbsp;set&nbsp;to&nbsp;false&nbsp;when&nbsp;the&nbsp;map&nbsp;is&nbsp;created&nbsp;in&nbsp;the&nbsp;controller.&nbsp;Furthermore,&nbsp;toggling&nbsp;the&nbsp;visibility&nbsp;in&nbsp;the&nbsp;OverlaySwitcher&nbsp;does&nbsp;not&nbsp;do&nbsp;anything,&nbsp;even&nbsp;the&nbsp;though&nbsp;the&nbsp;properties&nbsp;on&nbsp;the&nbsp;javascript&nbsp;objects&nbsp;for&nbsp;the&nbsp;layers&nbsp;are&nbsp;being&nbsp;changed.&nbsp;If&nbsp;the&nbsp;Overlays’&nbsp;IsVisible&nbsp;properties&nbsp;are&nbsp;set&nbsp;to&nbsp;true,&nbsp;the&nbsp;Overlays&nbsp;work&nbsp;properly.&nbsp;Meanwhile,&nbsp;the&nbsp;HighLightOverlay&nbsp;behaves&nbsp;properly&nbsp;and&nbsp;and&nbsp;functions&nbsp;according&nbsp;to&nbsp;the&nbsp;IsVisible&nbsp;property,&nbsp;which&nbsp;is&nbsp;&nbsp;good&nbsp;as&nbsp;it&nbsp;did&nbsp;not&nbsp;do&nbsp;this&nbsp;in&nbsp;version&nbsp;7.0.

---

<div class="post-metadata">

**Author:** ![Troy](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://community.thinkgeo.com/u/Troy)\
**Post date:** [June 28, 2015, 9:31pm UTC](https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313/2 "2015-06-28T21:31:50Z")

</div>

Hi&nbsp;Michael,  
  
  
  
As&nbsp;you&nbsp;mentioned,&nbsp;the&nbsp;OverlaySwitcher&nbsp;changes&nbsp;the&nbsp;client&nbsp;side&nbsp;layer&nbsp;visibility,&nbsp;however,&nbsp;the&nbsp;CustomOverlays&nbsp;are&nbsp;drawn&nbsp;from&nbsp;server&nbsp;side&nbsp;and&nbsp;the&nbsp;server&nbsp;side&nbsp;Overlays&nbsp;visibility&nbsp;still&nbsp;keep&nbsp;the&nbsp;original&nbsp;status.&nbsp;So,&nbsp;we&nbsp;also&nbsp;need&nbsp;to&nbsp;change&nbsp;the&nbsp;server&nbsp;side&nbsp;status&nbsp;by&nbsp;an&nbsp;Ajax&nbsp;call.&nbsp;Please&nbsp;following&nbsp;the&nbsp;below&nbsp;codes:

> `OnMapCreated = ``function`&nbsp;`(map) {`  
> `           ``for`&nbsp;`(``var`&nbsp;`i = 0; i < map.layers.length; i++) {`  
> `                ``var`&nbsp;`layer = map.layers;`  
> `                ``if`&nbsp;`(layer && layer.initVisibility == ``false``) {`  
> `                     ``layer.events.register(``“visibilitychanged”``, layer, ``function`&nbsp;`(layer) {`  
> `                         ``Map1.ajaxCallAction(``’@(ViewContext.RouteData.Values[“Controller”].ToString())’``, ``‘ChangeOverlayVisibility’``, { id: layer.object.id, visibility: layer.object.visibility },`  
> `                        ``function`&nbsp;`() {`  
> `                            ``Map1.redrawLayer(layer.object.id)`  
> `                        ``});`  
> `                ``})`  
> `                ``}`  
> `            ``}`  
> `}`

  
Please&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;any&nbsp;questions.  
  
  
  
Thanks,  
  
  
  
Troy

---

<div class="post-metadata">

**Author:** ![Michael12](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/ec9cab/32.png) [@Michael12](https://community.thinkgeo.com/u/Michael12)\
**Post date:** [June 29, 2015, 6:07am UTC](https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313/3 "2015-06-29T06:07:19Z")

</div>

Thanks.&nbsp;This&nbsp;is&nbsp;working&nbsp;properly&nbsp;now.&nbsp;Did&nbsp;something&nbsp;change&nbsp;between&nbsp;version&nbsp;7&nbsp;and&nbsp;8&nbsp;that&nbsp;caused&nbsp;this&nbsp;to&nbsp;be&nbsp;necessary&nbsp;to&nbsp;do?

---

<div class="post-metadata">

**Author:** ![Troy](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://community.thinkgeo.com/u/Troy)\
**Post date:** [June 29, 2015, 8:51pm UTC](https://community.thinkgeo.com/t/custom-overlays-not-rendering-after-upgrade-to-mvc-edition-8/4313/4 "2015-06-29T20:51:00Z")

</div>

Michael,  
  
  
  
At&nbsp;this&nbsp;part,&nbsp;No,&nbsp;the&nbsp;v8&nbsp;still&nbsp;kept&nbsp;the&nbsp;same&nbsp;as&nbsp;v7.&nbsp;Just&nbsp;let&nbsp;you&nbsp;know,&nbsp;if&nbsp;we&nbsp;make&nbsp;all&nbsp;the&nbsp;overlays&nbsp;as&nbsp;visibility&nbsp;by&nbsp;default&nbsp;in&nbsp;the&nbsp;server&nbsp;side,&nbsp;then&nbsp;we&nbsp;don’t&nbsp;need&nbsp;the&nbsp;above&nbsp;codes.  
  
  
  
Thanks,  
  
  
  
Troy
