How to Dynamically add (one or more ) marker/pulsing dot in real-time on socket.io event? #1814
-
I want to display marker , when socket.io event calls on any location determined by data coming from socket . For this i've created a socket event like this
and for showing marker a function
where and in return I have written as
But I get problem, The marker is not appended to Map, but rather mark other location whenever other data comes rather making new marker. like below cut.mp4Which didn't works as expected, like above, the marker changes its position whenever new live data comes rather than making one. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you call |
Beta Was this translation helpful? Give feedback.
When you call
setLiveData
you overwrite any existing value. You need to maintain an array of data points if you wish to render multiple markers.