# Ng-show/ng-hide performance problem with Google Map

**URL:** <https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629>\
**Category:** ionic-v1\
**Created:** [January 13, 2015, 10:48pm UTC](https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629 "2015-01-13T22:48:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodneyjoyce](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rodneyjoyce](https://forum.ionicframework.com/u/rodneyjoyce)\
**Post date:** [January 13, 2015, 10:48pm UTC](https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629/1 "2015-01-13T22:48:22Z")

</div>

I have a detail page with some links on it and a Google map (using [http://angular-ui.github.io/angular-google-maps/#!/](http://angular-ui.github.io/angular-google-maps/#!/))

One of the links has an ng-show on it like this:

The problem is that when the detail page loads, the ng-show is only run after the Map has finished rendering. So an item is visible when it should not be and then about 3 seconds later it disappears when the map has finished rendering.

I have tried adding an ng-cloak to it but this made no difference. ng-hide (and the inverse) also makes no difference.

```
        <a ng-show="gameAd.Telephone" href="tel:{{gameAd.Telephone}}" ng-click="callTelephone()" class="item item-icon-left assertive">
            <i class="icon ion-ios7-telephone"></i> Call {{gameAd.HostDisplayName}} on {{gameAd.Telephone}}
        </a>
        <div class="item" data-tap-disabled="true">
            <ui-gmap-google-map id="GameDetailMap" draggable="true" options="map.options" control="map.control" center="map.center" zoom="map.zoom">
                <ui-gmap-layer type="TrafficLayer" show="map.showTraffic"></ui-gmap-layer>
                <ui-gmap-marker coords="marker.coords" idkey="marker.id" >
                    <!--<marker-label content="marker.title" anchor="10 -8" class="marker-labels"></marker-label>-->
                </ui-gmap-marker>
            </ui-gmap-google-map>
        </div>
```

---

<div class="post-metadata">

**Author:** ![rodneyjoyce](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rodneyjoyce](https://forum.ionicframework.com/u/rodneyjoyce)\
**Post date:** [January 18, 2015, 10:47am UTC](https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629/2 "2015-01-18T10:47:37Z")

</div>

Any theories on this?

---

<div class="post-metadata">

**Author:** ![MichaelSzabo](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@MichaelSzabo](https://forum.ionicframework.com/u/MichaelSzabo)\
**Post date:** [March 3, 2015, 6:25am UTC](https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629/3 "2015-03-03T06:25:20Z")

</div>

I’m encountering a similar thing. I’ve been browsing the forums as I’m not sure what to call it or what the issue is. It could be an Angular issue but it could also be some sort of Ionic caching problem. Seems to be an issue since upgrading from beta 8 to 14 and related Angular update. Caching was causing problems with my app because data wasn’t being shown as updated so I put in “cache:” false for all states in routes.js where the screen wasn’t static. I have also put in $ionicConfigProvider.views.maxCache(0); in app.js however it still seems to be doing the transitions.

If the screen transitioning to was the last screen that I accessed, the screen loads quickly with what looks like all possible content on the screen briefly then it looks like all ng-hide/ng-show are evaluated correctly then the page appears as expected. I’ve tried the same (ng-cloak & ng-hide) but they all do the same thing.

If it is not the last screen that I accessed, it slides across from either the right to the left or the left to the right (which I believe might be cache transition animations?) I’m yet to find what the rule is as to which direction they slide as it seems to be inconsistent.

This is not an issue on my laptop, however is on physical and simulator iOS devices. I don’t have an Android device to test with so not sure about that.

---

<div class="post-metadata">

**Author:** ![MichaelSzabo](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@MichaelSzabo](https://forum.ionicframework.com/u/MichaelSzabo)\
**Post date:** [March 13, 2015, 1:09am UTC](https://forum.ionicframework.com/t/ng-show-ng-hide-performance-problem-with-google-map/15629/4 "2015-03-13T01:09:17Z")

</div>

This is discussed over here and the fix in there worked for me.

> **[Beta 14 ng-hide/show](http://forum.ionicframework.com/t/beta-14-ng-hide-show/14270)**
>
> In the new version of beta 14. I get my elements which were previously hidden in a view with ng-hide/show. Now show when navigating. Then will be hidden after the view is finally loaded. It is the weirdest thing. All views I have do this....
