Can't update marker position with setPosition
See original GitHub issueI am trying to make my App auto update position of markers loading from an API. Everything is fine except that the setPosition function doesn’t move my Markers. Bellow is the last try I made, forcing the coordinates to update by 0.1 each loop:
let pos: ILatLng = {
lat: this.me._x,
lng: this.me._y
}
let opt: MarkerOptions = {
title: 'Testing',
position: pos,
icon: 'blue'
}
this.map.addMarker(opt).then((marker) => {
this.marker = marker;
}, (error) => {
console.log(error);
});
this.interval = setInterval(() => {
pos.lat += 0.01;
pos.lng += 0.01;
if(this.marker !== undefined){
this.marker.setPosition(pos);
}
}, 3000);
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
How to update Google Maps marker position without them ...
When new data arrives, update the markers by that unique id. ... setPosition) { var planeIcon = new google.maps.Marker({ position: myLatlng ...
Read more >Google Maps JavaScript API V3 Reference
AdvancedMarkerViewOptions interface. Properties: collisionBehavior , content , draggable , element , map , position , title , zIndex. Beta PinView class.
Read more >Updating position for a list of markers - GIS Stack Exchange
At the gmaps script, markers are stored on an array, and then I was thinking of taking each point and using the setPoint...
Read more >dynamically change 3 marker position on the fly - YouTube
Your browser can't play this video. ... setCenter marker. setPosition 3 locations in kathmandu music by Nishang Yonjan ...
Read more >moving the marker to current location after data gets updated??
... current location address after moving the marker again if i click on the position data is not updating ... setPosition(place.geometry.location); } map....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@artnicbr
Here is my project https://github.com/shivakumar116/Track-In Once check homepage.ts
@manuvalentim Your issue is resolved ?