CS2020:   Web Science, Sytems and Design

Google Maps: sensor parameter

Use of the Google Maps API requires that you indicate whether your application is using a sensor (such as a GPS locator) to determine the user's location.

  • important for mobile devices.
  • Applications must pass a required sensor parameter to the <script> tag when including the Maps API javascript code, indicating whether or not your application is using a sensor device.

Applications that determine the user's location via a sensor must pass sensor=true when loading the Maps API JavaScript.

#
# Example using sensor when loading the Maps JavaScript API
#
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

Note that even if your device does not use a sensing device, you must still pass this parameter, setting its value to false.

 

© Lynne Grewe