Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Map annotations and AJAX best practice

Hi, am looking into grabbing a set of map entries from a mySQL database and display the 10 closest ones to the users GPS location. But wanted to enquire as to whether there were any best practice guidelines for AJAX usage?

I have used jQuery mostly in the past, but understand this wont work in the new Titanium app. versions.

If anyone could shed light on best practices that would be great. Or if not, anyone got any personal ideas on good practice for AJAX use in Titanium apps?

— asked April 7th 2010 by Dan Duke
  • ajax
  • android
  • annotation
  • db
  • map
  • mobile
  • mysql
  • win32

6 Answers

  • Accepted Answer

    I'm building an app that will eventually be downloading geolocations from a database to create google map markers. I'm still designing, but I have some references I can point you to.

    Download the Titanium sample application KitchenSink-1-2-x, and look at the file "soap_client_library.js". I have not done any ajax stuff myself yet, but this looks like the place to start from.

    Take a look at the code available here: http://gmapschunker.sourceforge.net/index.html. I'm already using 0.1 degree chunks in my local iPhone DB to good effect. When I start to build the server side DB from many iPhone sources, I'll use the 0.5 degree chunks described.

    — answered April 7th 2010 by Bruce Martin
  • would be interested in this as well.


    — answered April 7th 2010 by danno watts
  • Why jQuery don't work in the new Titanium versions?

    — answered April 7th 2010 by Andrea Sancio
  • Sorry, may not have made sense on the jQuery front there. From what I understand, the mobile apps used to be be very web based (using css and js), but the new version has made it all javascript using the UI so they integrate with the device UI better.

    This can be switched back if needed, but would rather do things properly and as they are meant to be done.

    I am new to Titanium, and so never used the web based mobile version, but this is my understanding.

    — answered April 7th 2010 by Dan Duke
  • Bruce, thanks for that link to the gmapschunker, looks really useful, and should help make it all a lot more responsive.

    Sadly though the docs are limited, and I keep getting the same error. My db is setup, and has the data in it. I also have the api key working. Any ideas on what this means, as I can connect to the DB through terminal fine, but when I use the same settings in the 'googleMapDBChunkerQuery.php' file I get the error below.

    I don't suppose you have any suggestions do you?

    There was an error loading data from the server (error code Invalid Data From Server). Click Here to try again to try again.
    — answered April 7th 2010 by Dan Duke
  • Found the issue, it was to do with my localhost setup, had to disable error reporting a little bit.

    — answered April 8th 2010 by Dan Duke
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.