--In HTML5, we provide the navigator.geolocation.getCurrentPosition(f1, f2) function. f1 is the function called when positioning is successful, f2 is the function called when positioning fails, and the current geographical location information is used as Actual parameters are passed to the f1 and f2 functions. The f1 function just calls the Google Maps API.
How to display it?
--Need a prompt information and an area to display the map.
On thepage, it looks like this:
1 2 3 4 |
|
The Directive part is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
The above is the relevant knowledge introduced by the editor to you on how to use Google Maps to display the current location in AngularJS. I hope it will be helpful to you.