I'd like to:
This should be possible, but I have yet to see anyone implement this.
Depending on the availability of GPS on the device and the quality of the mobile/WIFI signals, HTML5 geolocation can be very accurate i.e. to a street level. Hence it can be used to pin point a device's location making it a very useful technology for websites or apps that require the exact user's location to work.
Geolocation sources Mobile devices tend to use triangulation techniques such as GPS (accurate to 10m and only works outside), WiFi and GSM / CDMA cell IDs (accurate to 1000m).
Should be possible. According to this article the HTML5 position object returns the accuracy property in meters.
The google map api has the ability to draw circles given a center point (lat, lng) and a radius in meters.
I am thinking something like this:
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var accuracy = position.coords.accuracy;
var centerPosition = new google.maps.LatLng(latitude, longitude);
var marker = new google.maps.Marker({
position: centerPosition,
map: //your map,
icon: //the dot icon
});
var circle = new google.maps.Circle({
center: centerPosition,
radius: accuracy,
map: //your map,
fillColor: //color,
fillOpacity: //opacity from 0.0 to 1.0,
strokeColor: //stroke color,
strokeOpacity: //opacity from 0.0 to 1.0
});
//set the zoom level to the circle's size
map.fitBounds(circle.getBounds());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With