122

The Google Places API requests have a sensor parameter? How does this parameter affect the results?

0

3 Answers 3

174

Edit: The sensor parameter is no longer required, and will now be ignored if it's used.

The parameter doesn't impact the results. It's a parameter that Google is required to collect for Google's data providers who charge differently based on whether the request uses a sensor or not.

see Google docs

7
  • 8
    Really? Could you please provide some link, where this is written. I have not found this anywhere. (Also wondering why the price is different and what is cheaper:)
    – TN.
    Dec 25, 2011 at 21:16
  • 72
    It's not in the documentation. I work on the Google Maps API team.
    – Mano Marks
    Jan 3, 2012 at 16:15
  • 2
    @ManoMarks I was wondering if I should set the sensor=true always if the device has a GPS sensor it uses to get the user position or if I should only use it if that location is the actual found GPS location? I'm building an app where we show a map with users location but the user might drag the map and we do a georequest based on the new location. In this case should I start with setting sensor=true and then switch to use sensor=false? Sep 19, 2012 at 20:58
  • 6
    @PeterTheill If you're using a sensor at all to detect someone's location, then use sensor=true, even if they drag away from the map. If you instantiate a map that does not use the sensor to detect the location, then set it to false
    – Mano Marks
    Sep 20, 2012 at 22:17
  • 1
21

The Google Maps docs have been updated and as of June 2014 and the &sensor parameter is no longer required for JavaScript or Web Service API calls. The parameter will now be ignored if passed along with any request.

docs - https://developers.google.com/maps/documentation/javascript/tutorial

0
13

Just to be more clear. If your script tag looks like this:

<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script>

Then you should change it to the following to remove this warning:

<script src='//maps.googleapis.com/maps/api/js'></script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.