I need to place more markers every five seconds on Google Maps, but when I place a new marker on the map, the map is reset to default values, e.g. zoom, map scroll, rotation and more. I just need to update marker’s position or to add new one. But I want to save current map position, zoom and rotation. Thank you in advance!
Try to keep the coordinates and zoom level before the addition of markers and restore them after adding markers.
I’ve tried this way but it seems not working.
You need to store the data and re-set it after the marker was placed… what I did in an app of mine was setting the lat and lng to the coordinates of the just created marker immediately afterwards. Because else it would also jump back to the last set location of the map…
This Is what I’ve done as you can see in the picture attached to my previous post
but why wait 2 seconds? 2 seconds is hell of a time in that case… why not do it instantly? Does it still not work ? Because from the blocks I see I would assume it should… If it still does not then this might be a bug just like the webviewer does not return the current URL but rather the last one set
Exactely, I’ve inserted a 2 secs wait to see if It needs time to Place the marker or something similar 'cause without wait block the result Is the same.
It Always reset zoom factor to default value
Then unfortunately I think this is just like I assumed that the blocks return the last manually set value and not the last value of user interaction This would definitely be something that need improvement - also for the webview since currently “get URL” does not return the current URL but rather the last one you set…
Does anybody know if there might be a workaround by working with the objects block just like there is a workaround to be able to place a marker at all?
Does anybody know if there might be a workaround by working with the objects block
Unfortunately, I did not understand what kind of solution you are looking for and what does not work in object blocks
I meant if there might be some chance that there is an object property returning the current zoom, lng, lat just like there is one returning where the map is touched because then we could use that instead and „fix“ this issue for now.
Now I got it. Like you, I am surprised at the situation when the blocks return what was written to them earlier, rather than the current state and property values. Mark told me what they think about it, but a lot of time has passed, and the blocks have not learned how to return the current state. This really leads to the need to create crutches that do not match the user experience.
Has anyone found a workarround for the problem of returning to the original coordinates/zoom?
In my case i work with timers so when one of them is fired, the map goes to its first location…
Any help/idea would be great.
Anytime the map location is updated, use the right component to set your new map location.
I use a slider to control zoom. They can pinch zoom but the slider keeps levels set no matter what.
I don’t really understand how to do it. I am not using the location of the user.
In my case the user can be “playing” with the map, this is moving the map, rotating it or changing the zoom to search another street… But every 2 seconds one timer is fired, so, all those movements that the user made in the map (without necessarily pressing the map) will disapear and the map will be restarted to the original parameters.