Thursday 2 February 2012

Mapview problems

Today I had a few issues regarding mapviews within Appcelerator. The mapview is an object that can be placed within a window or any other view. In this case I was adding it to a view, but the view was set to hidden by default when the app launched.

The mapview itself gets fed coordinates though a piece of geolocation code but the map simply wasnt loading.

After a lot of messing about I found that if the view that contained the mapview was visible it worked just fine. It seams as though Appcelerator not only hides the object, but isolates it from all processes occurring when its not visible.

I then realised whilst my layout was basicaly a selection of views that you could toggle hidden or visible using buttons the mapview could easily be placed on its own. When I did this the problem again resolved its self and now works as required.

So it appears a map will not function of the map is placed within a view that is hidden whilst the goelocation sequence is running. But a mapview on its own without a parent view will work just fine even if you set...
visible: false

It took me quite a while to debug this issue, and its one I sure hope I don't run into in the future.

Mack.



No comments:

Post a Comment