PDA

View Full Version : Map Shows Palo Alto for 1 second while reverse geocoding an address



mobile207
13 Sep 2011, 5:25 AM
I have an issue where I need to reverse geocode an address to get lat/lng pairs for my map (it selects addresses from a MySql database, in which I do not have lat/lng pairs stored) While the geocoding is going on my panel loads the preload mask as it should but beneath it the default Palo Alto view for around a second. I'm guessing it has to do with the order I am doing things?

Is there any way to hide everything beneath the loading mask until my actual map is ready?

mobile207
13 Sep 2011, 5:27 AM
items: [{ title: 'Map', layout: 'fit', xtype: 'map', mapOptions: { zoom: 13, panControl: false, zoomControl: true, mapTypeControl: false, scaleControl: false, streetViewControl: false, overviewMapControl: false, visible: false, backgroundColor: 'f4f2f1' }, listeners: { maprender: function(comp, map) { geocoder = new google.maps.Geocoder(); var geocoderRequest = { address: item.attributes.record.data.listing_address + ' ' + item.attributes.record.data.listing_city + ' ' + item.attributes.record.data.listing_zip } var map; MapMask.show(); geocoder.geocode(geocoderRequest, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); MapMask.hide(); setTimeout(function() { var marker = new google.maps.Marker({ position: results[0].geometry.location, map: map, mapTypeId : google.maps.MapTypeId.ROADMAP, animation: google.maps.Animation.DROP }); }, 1900); } else { alert("Geocode was not successful for the following reason: " + status + ' Google Maps cannot locate:' + geocoderRequest.address); } }); } }
}]

}