Need to specify that the method only returns correct value after the map is loaded, eg after the "complete" event is fired.