google maps - Titanium Alloy - How to run procedure after screen created -


i'm trying update current location on map view. current location in controller:

var updatecurrentlocation = function updatecurrentlocation(e){ ti.api.info("update current location on map");  $.map.setlocation({     latitude: e.coords.latitude,     longitude: e.coords.longitude,     latitudedelta: 1,     longitudedelta: 1 }); } 

but problem @ time code run, map view has not been created yet, cannot update current location. can 1 suggest technique solve problem? thank you!

are not creating map in same controller? if place code after map code, obvious assume have thought of that.

why not set coords current user coords when create map?

worst case scenario, can use settimer(, timer ms) call function after set amount of time if wanted call updatecurrentlocation function after 500 milliseconds. not ideal.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -