Using FNCMaps with pleasure, I'm facing to difficulty about detecting when Maps is fully redraw including markers. I didn't find an event enabling that.
Goal is to display a wait animation until the map is fully ready preventing user's interaction with map
What's the best way to process that?
Have you tried using the OnMapInitialized event?
OnMapInitialized is fired with map object is built, so in fact when my app is initialized
but not more later
There are currently no events available apart from OnMapInitialized to indicate the map has finished loading. We'll have to investigate if additional events can be added in a future version.
waiting for next solution, I improved behavior by using BeginUpdate... EndUpdate.
It's really efficient, accelerating the refresh of all elements with map,but not perfect yet.
It is indeed highly recommended to always use BeginUpdate/EndUpdate, this will heavily improve the performance of the map.
Hi Sylvain and Bart
Thanks for Q&A, I am also in need of an event like this. I am adding several hundred polylines, circles and markers to a GoogleMap using VCL FNC Maps. I would like to refresh the positions of markers multiple times each second, but when I try to do this the FNCMaps really slows down, with other events failing to trigger. I would like to wait until FNCMaps is ready before I ask it to make more changes.
Also, can you recommend how many changes to objects I should put between a .BeginUpdate and .EndUpdate? I am currently updating many multiple markers (sometimes hundreds of them) between the begin and end. Is it good practice to batch them like this, or separate them and update them one at a time?
You can use BeginUpdate & EndUpdate once, and put all updates inside. There is currently no event for detecting if the map is idle, or when polylines/circles are done drawing. We'll investigate.
I have experimented with grouping my map object changes between a single BeginUpdate and EndUpdate, and also tried grouping them into several batches, doing the updates one ofter the other.
Putting ALL changes between a single BeginUpdate and EndUpdate gave me the best performance, as you suggest.
The Map update slowed down considerably when I used several batches of updates. So my suggestion is that if anyone is making many object updates at once is to put them all between a single BeginUpdate and EndUpdate as Pieter suggests.
It works well now, my map refresh is working at 10 fps, with many hundred objects moving smoothly around the map. And I don't need to use a 'detect end of redraw'.
I confirm, Map BeginUpdate / EndUpdate works fine even if I'm not using so many markers (less than one hundred max), and so, on Android and iOS application.
Working as, since Feb 2022 without issue about user experience (thanks TMS Team )
Do FNC Maps already have event for markers/polylines/circles etc. are done drawing?
I need to detect if drawing is finished and let user to make interaction with the form including the FNC Maps object.
Unfortunately there are currently no events available when markers/polylines are done drawing. Please note that this is a limitation of the mapping service which we have no control over.
We'll have to investigate if this feature can be added in a future version.