();
20 | ...
21 | }
22 | ```
23 |
24 | 1) Now you can inject the LocationService into any Blazor page and use it like this:
25 |
26 | ```
27 | @using AspNetMonsters.Blazor.Geolocation
28 | @inject LocationService LocationService
29 | You are here
30 |
31 | Lat: @location?.Latitude
32 | Long: @location?.Longitude
33 | Accuracy: @location?.Accuracy
34 |
35 |
36 | @functions
37 | {
38 | Location location;
39 |
40 | protected override async Task OnInitAsync()
41 | {
42 | location = await LocationService.GetLocationAsync();
43 | }
44 | }
45 | ```
46 |
47 | Success!
48 | 
49 |
--------------------------------------------------------------------------------