10

I am trying to follow this simple tutorial on Sencha Touch http://dev.sencha.com/deploy/touch/getting-started.html

I keep getting the JavaScript error: Uncaught TypeError: Cannot call method 'on' of null

This relates to the Map.geo property which is not getting set correctly. I am using the eact same code as on the link. I have tried putting on another box, in case it was a firewall issue, but get the same error.

  • 8
    Found the answer to this. Turns out that the tutorial is somewhat out of date compared to the latest source code. The following should work: Instead of getLocation:true in your javascript file, replace it with useCurrentLocation:true – Adrian Westlake Feb 22 '11 at 12:32
  • Have some +rep as I was stuck on this too :) – Chris James Mar 01 '11 at 11:11
  • You definitely deserve some rep on that one. Was banging my head just now on it. – stan229 Mar 10 '11 at 16:30
  • 2
    I've actually found this to be a problem with Sencha in general. A lot of their tutorials and documentation is out of date with the current version. Oftentimes, finding what you're looking for is a huge mess. – Munzilla Apr 12 '11 at 20:12
  • Please post the solution as an answer to this question. – brianpeiris Apr 21 '11 at 05:22

1 Answers1

5

In your Application JavaScript File, replace getLocation:true with useCurrentLocation:true.

Karl Laurentius Roos
  • 4,360
  • 1
  • 33
  • 42