rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
331 stars 105 forks source link

Identifier 'blazorGoogleMapsDateFormat' has already been declared. #223

Closed Curlack closed 1 year ago

Curlack commented 1 year ago

I'm getting the following error when running the ClientSideDemo project: namespace_bug

I think we should move all of the javascript into its own namespace e.g. window.blazorGoogleMaps as to not pollute the global namespace or have "bleeding" into the javascript of other packages.

valentasm1 commented 1 year ago

Does latest 2.4.2 nuget solve issue? https://www.nuget.org/packages/BlazorGoogleMaps/2.4.2

Curlack commented 1 year ago

No, it didn't. I was using the latest code when I encountered these issues.

valentasm1 commented 1 year ago

Please make PR then.

Curlack commented 1 year ago

Ok now I'm leaving my comfort zone. I'll make the PR, just need to "quickly" learn it :) Also not sure when to use PR or what I've done now. Just to confirm I understand what I've done now: Did I make a fork and requested a merge into the master branch?

Curlack commented 1 year ago

I think I got it. These tools doing things for us in the background...lol. I did it previously, just didn't know it. PR on the way. Thanks.

valentasm1 commented 1 year ago

I am bad person to suggest something. Honesty i did maybe 1-2 PR on github. Maybe make PR just for most important pats since i saw you did quite a a lot changes in commit

Curlack commented 1 year ago

I did it! Victory! :D

Curlack commented 1 year ago

The changes to objectManager.js looks vicious, in short, I only move the entire script into blazorGoogleMaps object that is returned by IIFE (immediately invoked function expression). I did this so we can encapsulate private members. Then I moved the directionService handler (previously known as googleMapDirectionServiceFunctions.route) into its own object (for neatness's sake, wasn't really required). Hopefully doesn't cause too much headache with the conflicts. If it wasn't changed between last time and now, maybe just replacing would be easier. Anyway, hope this helps.