File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Google maps current location

 
Louise Hill
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm attempting to develop a basic app on XDK (cross platform) and all I want it to do for now is find the current user's location on the map. I'm using the basis of a map which currently is hard coded to locate to Sydney. I have tried different things such as declaring lat as position.coords.latitude and the same for longitude but any time i place them in instead of hard coding, no map even prints to the screen. Find my code below. Any help would be much appreciated.

 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I can see from the documentation at getCurrentPosition Method, you have to pass a function which accepts a parameter to the method. The parameter, naturally enough, represents the current location. Your "initialize" method doesn't do that, and therefore you can't write code which uses that location parameter.

 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To find the user's current location, you'll need to use the geolocation API.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic