Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Remove old markers ionic 3 firebase

$
0
0

@rafaelmoura wrote:

I’m update position in firebase of user with this code

  ionViewDidLoad() {
    this.getMyPosition();
  }

  getMyPosition() {
    let watch = this.geolocation.watchPosition();
    watch.subscribe((result) => { 
      this.positionTruck = new google.maps.LatLng(result.coords.latitude, result.coords.longitude);
      const mapOptions = {
        zoom: 18,
        center: this.positionTruck,
        disableDefaultUI: true
      }
      this.map = new google.maps.Map(document.getElementById('map'), mapOptions);
      this.truckMarker(this.positionTruck);
      this.markerDumps();
      let truck = { latitude: result.coords.latitude, longitude: result.coords.longitude };
      this.truckService.update(this.truck.key, truck); 
    }) 
  }

but the markers are lagging behind

how to remove this markers ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>