So, you call VisualizationUtils.loadVisualizationApi
twice, so the onLoadCallback
will be run twice (I don't know GWT Google Apis, this is a supposition).
onLoadCallback
calls getAvgByRegion
, so that one will get called twice too; and it gets data and in the callback creates a new GeoMap
and adds it to the RootPanel.get("storeDurationDiv")
, so you get two GeoMap
s on the screen.
The other widgets(storeField
, etc.) are created only once, so add
ing them repeatedly is not a problem (except performance-wise), as they'll first be removed from their current parent before being added to the new one (which in this case is the same)