我想让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?
}
});发布于 2017-07-10 10:18:15
要从地图中移除标记,可使用调用setMap()接口
marker.setMap(null)传入null以将标记设置为null
有关更多信息,请参阅https://developers.google.com/maps/documentation/javascript/examples/marker-remove
https://stackoverflow.com/questions/44969248
复制相似问题