Tuesday, 15 March 2011

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


I am trying to update the current location on map view. I get the current location in the controller:

  var updateclose location = function updatenumber (e) {Ti.API.info ("update the current location on the map"); $ .map.setLocation ({latitude: e.coords.latitude, longitude: e.coords.longitude, latitude delta: 1, underline delta: 1}); }  

But the problem is that the map view has not yet been created while running the code at this time, so it can not update the current location. Can anyone suggest some technique to solve this problem? Thanks!

Are not you making maps in the same controller? If you just put the code after the map code, but it is clear, then I will assume that you have thought about it.

When you make a map, do not set the coro in existing user quotes?

The worst scenario is, if you want to call an updated current location call after 500 milliseconds, you can use the set timemeter (, timer MS) to call the function after a certain time . This is not ideal.


No comments:

Post a Comment