title: where to put enableHighAccuracy and other settings for geolocation
body: <p>I have the following code which gets the geo location and posts it, then displays a button in div.  This works on desktops but does not work in android a common issue as mentioned on this site.  Recommendations are to add </p>
  
  <pre><code> {frequency:5000, maximumAge: 0, timeout: 100, enableHighAccuracy:true} 
  </code></pre>
  
  <p>to the code below somewhere, I've tried a few places just stops it working, where do I put these values please? </p>
  
  <p> </p>
  
  <pre><code>function getCoordPosition() { 
  
  if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(
  function (position) {
      $.ajax({
          type: "POST",
          url: "{{path('login_log_location')}}",
             data: {
              latitude: position.coords.latitude,
              longitude: position.coords.longitude
          },
          success: function () {
              $("#divputinarea").html("{{path('login_log_yourarea')}}"&gt;
             &lt;button class="btn btn-large btn-primary"&gt;
             Find &lt;/button&gt;');
            }
  
             });   
         });
      }  
  
  }
  </code></pre>
  
  <p></p>
  
  <p>After advice below I tried the following, it works without the { maximumAge: 0,timeout: 100,enableHighAccuracy:true} if I add it I get error 'argument 2 of geolocation.getCurrentPosition not callable" </p>
  
  <p> </p>
  
  <pre><code> function getCoordPosition() { 
  
    if (navigator.geolocation) {
  
    function getPosition(position) {
  
      $.post("{{path('login_log_location')}}",  {  
       latitude:position.coords.latitude,
       longitude:position.coords.longitude })
       .done(function(data)  {
       $("#divputinarea").html('&lt;form method=post action="
  {{path('login_log_yourarea')}}"&gt;&lt;button class="btn btn-large   
  btn-primary"&gt;Find your nearest matches&lt;/button&gt;');
  
   });
  
        }
  
  navigator.geolocation.getCurrentPosition(getPosition, {  
  maximumAge: 0,timeout: 100,enableHighAccuracy:true} ); 
  
    }  
  
    }
  
   &lt;/script&gt; 
  </code></pre>