2017-07-07 203 views
0

我想让android后退按钮得到一个回退,并删除掉落的标记有没有任何可能的方式来做到这一点?如何移除丢弃的地图标记?

public AddMarker(){ 
    let image = '/assets/img/rsz_marker.png'; 
    let marker = new google.maps.Marker({  
    map: this.map, 
    animation: google.maps.Animation.DROP, 
    position: this.map.getCenter() 
    , icon: image 
    }); 
    } 
    platform.registerBackButtonAction(() => { 
     if (this.nav.canGoBack()) { 
     this.nav.pop(); 
     } else { 
     //*remove marker? 
     } 
    }); 

回答

相关问题