Start a new topic

Get the current location

For a "poll" app: is it possible to send along the location (lat/long) in the request?


1 person has this question

You might be able to resolve the location from the IP on your service. I don't think the device has a GPS reciever.

You don't need a GPS receiver to get the location, Google does this pretty well. ;) Usually the device which you use to set up the apps, does have a location enabled, so perhaps I could use that (same as the built-in Weather app)? Thing is: I can't see how... ?

PS: the LaMetric team isn't very active here, are they? :( C'mon guys, support the devs! :)


The phone you use to set up the LaMetric device probably gets the location from its built-in location services, but I doubt the LaMetric cloud service would send that data along as part of the data request for security reasons. Perhaps they'll update their app model in the future to allow apps to request certain permissions (like location). For now you might be able to use the requesting IP against a GeoIP database in your own cloud service. That is assuming that update requests are made by the LaMetric device itself, and not by their cloud service.

Ok, fair enough. Thanks for the answers, I'll go the GeoIP route then!


You'll have to confirm that the request comes directly from the client device, otherwise you'll just get the location of the LaMetric datacenter.

Bringing this topic back up, I'd like to see support for an option type where the user can automatically determine their current location, similarly to how the weather app works.

My thought was that it could use the phone's location provider (GPS, wifi, however the user's phone is set up) to get their latitude and longitude and append that to the poll request. Either that, or it could display a map where the user can drop a pin, and the lat / long is obtained from that.

Right now I've just added two number options, lat and long, and would like the user to fill that out, but 1) It's cumbersome and 2) On Android (possibly on iOS) you can't enter more than 3 digits in the box, and no period, so you've got an accuracy 56km in the worst case.

So +1 for having an option type that would let users pick a location from a map or automatically determine their location.

1 person likes this
Login or Signup to post a comment