title: Geolocation is not working on Android webview
body: <p>I have geolocation on my website - I can get location with javascript but I can not get location using web view on android devices. I use the same site but it does not work.</p>
  
  <p>my site : <a href="https://www.ardakazanci.thecompletewebhosting.com/petsHelper/paylasim.php" rel="nofollow noreferrer">https://www.ardakazanci.thecompletewebhosting.com/petsHelper/paylasim.php</a></p>
  
  <p>my android code : </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  
  
  
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              WebView webview = (WebView) findViewById(R.id.webview);
              webview.getSettings().setJavaScriptEnabled(true);
              webview.loadUrl("https://www.ardakazanci.thecompletewebhosting.com/petsHelper/paylasim.php");
          }
      }
  </code></pre>
  
  <p>It works fine on the web. Does not work with WebView. Thank you. </p>
  
  <p>Error: </p>
  
  <p>the geolocation service failed </p>
  
  <p>My javascript code - paylasim.php </p>
  
  <pre><code>&lt;script&gt;
          // Note: This example requires that you consent to location sharing when
          // prompted by your browser. If you see the error "The Geolocation service
          // failed.", it means you probably did not give permission for the browser to
          // locate you.
  
          function initMap() {
  
  
              var outputlat = document.getElementById('latitude'); // Enlemi tutsun
              var outputlng = document.getElementById('longitude'); // Boylamı tutsun
  
  
              var map = new google.maps.Map(document.getElementById('map'), {
                  center: {lat: -34.397, lng: 150.644},
                  zoom: 15
              });
              var infoWindow = new google.maps.InfoWindow({map: map});
  
  
              // HTML 5 ile geo location olayının sağlanması
  
              if (navigator.geolocation) {
                  navigator.geolocation.getCurrentPosition(function (position) {
  
                      outputlat.value = position.coords.latitude;
  
                      outputlng.value = position.coords.longitude;
  
                      var pos = {
                          lat: position.coords.latitude,
                          lng: position.coords.longitude
                      };
  
                      infoWindow.setPosition(pos);
                      infoWindow.setContent('Lokasyon bulundu.');
                      map.setCenter(pos);
                  }, function () {
                      handleLocationError(true, infoWindow, map.getCenter());
                  });
              } else {
                  // Eğer browser desteklemiyor ise
                  handleLocationError(false, infoWindow, map.getCenter());
              }
          }
  
          function handleLocationError(browserHasGeolocation, infoWindow, pos) {
              infoWindow.setPosition(pos);
              infoWindow.setContent(browserHasGeolocation ?
                  'Error: The Geolocation service failed.' :
                  'Error: Your browser doesn\'t support geolocation.');
          }
      &lt;/script&gt;
  </code></pre>