简体   繁体   中英

How to keep the google map markers after I change from one view to another on Ionic?

How to keep the google map markers after I change from one view to another on Ionic? After I change from one view to another all the markers are gone, and the map stays clean.

I'm using Ionic framework and I have a google map div:

<ion-view view-title="{{navTitle}}">
  <ion-content>
    <div class="map-container">
        <div id="map"></div>
    </div>
    <div class="control-panel">
        <a class="button multi-line" ng-href="#/app/search" target="_self" href="#/app/search">
            <span>PESQUISAR</span>
            <span>VIAGEM</span>
        </a>
        <a class="button multi-line" ng-href="#/app/browse" target="_self" href="#/app/browse">
            <span>VER TODAS</span>
            <span>AS LINHAS</span>
        </a>
    </div>
  </ion-content>
</ion-view>

The problem was that i was overwriting the map object with another one. It wasn't a ionic thing at all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM