I am using the Eclipse plugin and have a difficult time integrating the
Geolocational API with my existing project. I would like to see a tutorial
that includes setting up the project and importing the API correctly.
I have downloaded the API but found it a bit difficult integrating with my
app too. Can you tell me which name should I inherit in Main.gwt.xml. What
I am looking for is something on the line of
<inherits name="com.google.code.gwt.Geolocation"/>. Looking forward to your
reply.
Aha!
I forgot to document that part! Will amend to wiki pages with that. Thanks!
@bguit, thanks but I found the following "<inherits
name="com.google.code.gwt.geolocation.Html5Geolocation" />" in the
HelloGeolocation samples.
Good project!
It's excellent code segment to help us understanding Geolocation API.
However, in your example, we could only obtain Latitude and Long Latitude
information in OnSuccess method. How about to obtain both value out
Callback function, for example, to bind in GWT UI components say Label or
textbox? Thanks for your advice.
@reidlai The actual Javascript API to obtain geolocation data is
asynchronous; this means we *have* to use callback methods to get the data,
there is no way around that. If you need that, you should 'pre-fetch' the
location, and in the `onSuccess()` method construct and bind the widgets
with the data, just like you would do using GWT's RPC.
Has anyone attempted using the GeographicalArea object. It seems to be
returning values much greater than expected for getDistance method...This
seems to be unrelated to the UnitType parameter.
for those still facing issues getting this working
it's not your gwt.xml file
it's your PROJECTNAMEHERE.gwt.xml file
and "add the jar file to your class path" means
http://stackoverflow.com/questions/179024/adding-a-jar-to-an-eclipse-java-library