map view loading event not firing
On https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Map.MapView.html is a list of the events I can attach to the map view. I want a function to run when the map starts to load, but when I test the app on the android emulator, it doesn't seem to fire the event.
Have I misinterpreted the documentation, or just coded incorrectly? My event code is below.
Thanks for any help,
Dan
mapView.addEventListener('loading',function(evt)
{
Titanium.API.info('Map loading');
// Update local map data
getMapData();
// Grab map data from local DB and display current annotations
});
2 Answers
-
Accepted Answer
We currently don't fire the loading or complete events on Android. I could synthesize loading and complete, but those actions are handled by the native API and it's transparent. You can set the annotations at any time. You don't have to wait for it to be loading.
-
Thanks for that, good to know those don't work, I am trying to get the annotations to update to only show the 10 nearest to map center. I can get this to run when the map is moved though, so there are other events I can use (eg. regionChanged).
Also, just as a thought, would there be a consideration to put an icon next to some of the calls/events in the docs with the android/iphone app (with a cross through them) to show which ones dont yet work on certain platforms, as this could cause hours of wasted time, or is there already a place to quickly check this?