-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting Blazor.Geolocation working with GA Blazor #14
Comments
#1 Yes that solved teh service issue for me.
Working other issues now. |
#4 Got it all working now by copying location.js to wwwroot (Note that is where to put it)
🥇 Thanks Brian |
djaus2
added a commit
to djaus2/Blazor.Geolocation
that referenced
this issue
Jun 27, 2020
Addresses issues in Issue AspNetMonsters#14
Open
Nb: I've pushed these changes to the ReadMe to the repository, as above. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Howdy Gents,
I really, really wanted to use B.G, but ran into a slew of problems when trying to get it to work with VS16.9.3, and Core 3.0, Server Side Blazor. You guys are doing great work, there is no way I was going to get into your stuff and change it, so I've created an app with workarounds on all of the issues, and it successfully uses B.G to find location. My app can be found at https://github.com/bdnts/BlazorGeo and is accessible to all.
Issue #1: Location Services as a Singleton -- In the release I am using, IJSRuntime is already registered as Scoped.
Workaround #1: Registered LocationService as Scoped. Running multiple browsers against the same app, each connection having its own service is probably not a bad idea.
Issue #2: OnInitAsync is deprecated.
Workaround #2: Change to OnInitializedAsync.
Issue #3: NullReferenceException. No matter what I did, just could not get this work during initialization.
Workaround #3: I change the logic to get location on a button click instead of during initialization. I commented out the old code and created GetMyLocation() to replace it.
Issue #4: Can't find Location.js. There is a missing step about adding <script src="Location.js"></script> to _Host.cshtml, but still could not find the script.
Workaround #4: I created a local Location.js file, and copied the contents from B.G source tree into the local file.
Bada boom Bada bang, it works! Works really well. I deployed the app to Azure, drove around town on some errands, refreshed wherever I went. It's great! I'll be looking for updates, and will do what I can to help out.
Cheers
Brian
The text was updated successfully, but these errors were encountered: