Maps fitBoundsToMarkers using previous markers

I have a Google Map which is using a server connect for dynamic markers. In the server connect Success action I have dmx-on:success=“maps1.fitBoundsToMarkers()”. This actually sets the bounds to where the markers were before the server connect runs. I’m guessing I need to put this somewhere else, but can’t fathom where.

Thanks.

I’ve just gotten back to trying to get Google Maps to work and this is still an issue. Any ideas?

You could try dmx-on:success.debounce="maps1.fitBoundsToMarkers()". The success event triggers when the server connect finished, but the maps is not yet updated. The debounce should add a small delay before triggering the fitBoundsToMarkers method to allow maps to update first.

That doesn’t work either.