-1

I have a Google map with different markers and the markers are shown if the user with the lat and lng are online.

So but now I want that if a user goes offline or online that his marker appears/disappears from the map. The On/Off function is handled with firestore.

So I know when a user goes on/off and it works with a page reload, but how can I handle it without a page reload.

If you need some code let me know! Thanks.

Lukas
  • 573
  • 2
  • 8
  • 19
  • Possible duplicate of [Remove a marker from a GoogleMap](https://stackoverflow.com/questions/13692398/remove-a-marker-from-a-googlemap) – Devon_C_Miller Nov 05 '18 at 21:36

1 Answers1

1

Create a timer in your javascript code that auto refreshes your collection of markers. Upon refreshing go through your collection of markers that you kept from your first creation and mark them as visible or not visible.

Bill Blankenship
  • 3,316
  • 6
  • 43
  • 73
  • thanks, and how will look the timer, I can't really imagen me how it will looks and how it will work without page reload, do have any examples? – Lukas Oct 25 '18 at 13:38
  • I think I found a solution which will compare to your answer:: https://risan.io/track-user-location-google-maps.html – Lukas Oct 25 '18 at 13:43