Javascript 单张标记更新
嗨,我有个关于angular 5的传单标记的问题, 标记值是动态的,我只需要绘制最后的结果。 请问我怎么做? 这里有人有同样的问题吗 var标记;markers=new L.LayerGroup().addTo(myfrugalmap);让timer=TimerObservable.create(0,10000);this.subscription=timer.subscribe(t=>{this.MyService.Localize().subscribe(result=>{this.positions=result;let xpo=this.positions.x;let ypo=this.positions.y;let mar=L.marker([xpo,ypo],{icon:greenIcon})mar.addTo(markers)});markers.clearLayers();})Javascript 单张标记更新,javascript,leaflet,angular-leaflet-directive,Javascript,Leaflet,Angular Leaflet Directive,嗨,我有个关于angular 5的传单标记的问题, 标记值是动态的,我只需要绘制最后的结果。 请问我怎么做? 这里有人有同样的问题吗 var标记;markers=new L.LayerGroup().addTo(myfrugalmap);让timer=TimerObservable.create(0,10000);this.subscription=timer.subscribe(t=>{this.MyService.Localize().subscribe(result=>{this.posi
结果(没有(markers.clearLayers))我在地图上有10秒钟的新位置,我需要删除旧位置请提供更多信息和/或代码示例。让我们看看你到目前为止都做了些什么。很难用你所给的来识别问题;markers=new L.LayerGroup().addTo(myfrugalmap);让timer=TimerObservable.create(0,10000);this.subscription=timer.subscripte(t=>{this.MyService.Localize().subscripte(result=>{this.positions=result;let xpo=this.positions.x;let ypo=this.positions.y;let mar=L.marker([xpo,ypo],{icon:greenIcon})mar.addTo(markers)});markers.clearLayers();})结果(没有(markers.clearLayers)),我有10秒钟的时间在地图上找到新的位置,我需要删除旧的位置。你怎么看?@YASSIRELHOUSNI请不要在评论中发布这个,编辑你的帖子。