BlazorGoogleMaps
BlazorGoogleMaps copied to clipboard
AdvancedMarkerView.
Hi,
Can you please implement AdvancedMarkerView as well?
https://developers.google.com/maps/documentation/javascript/advanced-markers/html-markers#maps_advanced_markers_html-javascript
Regards,
Vishal
Sorry but i am out of time. Only minor changes fixes.
I am trying to implement, if I will be success, shall I create PR?
awesome. Any method which suits you. Here some similar issues https://github.com/rungwiroon/BlazorGoogleMaps/issues/83 https://github.com/rungwiroon/BlazorGoogleMaps/issues/62
Thanks, I have success for implementing AdvancedMarkerView but need beta version of google map. Will explore more possibilities and will create check-in once all well tested.
@vishalsmart any progress on this?
@alelom @valentasm1 AdvancedMarkerView is still in Beta. Instead I have used RichMarker to achieve HTML markers. If @valentasm1 agrees, I can bit optimize my implementation and create PR to merge including richmarker https://github.com/googlearchive/js-rich-marker
I am in progress migrating from json.net to system.text.json. Need some testing and adding some atributes. Most of work is done. I will finish next sunday. After that you could make PR :). I will put reminder and will write here update.
Everything looks working on migration to system.text.json, just need some testing and will release next week https://github.com/rungwiroon/BlazorGoogleMaps/tree/system.text.json_migration
I tested and looks improved performance. I'm going to create PR for RichMarker in day or two.
Awesome :).
@valentasm1 what about PR? :)
I never promised PR. I think you refering @vishalsmart
@valentasm1 , can you push it as a draft at least?
I never promised PR. I think you refering @vishalsmart he said he will be ready in 2d (April 2023 :) )
I never promised PR. I think you refering @vishalsmart he said he will be ready in 2d (April 2023 :) )
yes i'm tagging him
@vishalsmart how are you? what about PR?)
I like this part from article Advanced Markers can load up to 66% faster than our traditional markers, and provide faster panning and zooming. https://cloud.google.com/blog/products/maps-platform/announcing-highly-customizable-higher-performance-markers
Just did quick draft. Doesnt look that it could be very complicated to implement from here. https://github.com/rungwiroon/BlazorGoogleMaps/releases/tag/3.2.0
I managed to add this part, and so far it looks like a standard marker, I was working on adding the content parameter to the advanced maker, and this is where things got missy
There is huge chance that you need to write exception in js file. There are already couple exception to some actions.
i want to help , been working on this all day today
Sorry but if i need to guide you is such cases i could implement it faster. I dont have much free time. @Nickztar have you any thoughts about AdvancedMarkerView
@coeur85 Would recommend going to the google docs, the error also says that the problem is that content
is not a Node. Node is a HTMLElement (like a div or w/e).
https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.content
Not sure how its currently handled in our library but we would have to send a reference to a htmlElement or do something about that. Might have a look tomorrow to see if I can help figure it out.
Maybe you could allow the user to pass a ElementReference
for content. That should be a Node when recieved by JS.
https://blazor-university.com/javascript-interop/calling-javascript-from-dotnet/passing-html-element-references/
@Nickztar it should a dom object like a div true, so I tried to pass as on object from JS function but got the same error
Well from what I can see you are just passing the string ´await CreateDiv(innerHTML)´? We would have to have something that overrides the call to CreateAdvancedMarker
and calls that method (which sounds like a bad idea). You should probably just change Content to be a ElementReference
and have the user call their own CreateDiv method which returns a ElementReference
.
Wrong thinking. Content must by node since all params is serialized before passing to google maps passing reference is impossible. https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.content
Need some workaround like here https://github.com/rungwiroon/BlazorGoogleMaps/blob/master/GoogleMapsComponents/wwwroot/js/objectManager.js#L603
A ElementReference is serializable though? Alteast when passing to JS. Should be possible without a workaround. I will try tomorrow. 😄
sure you don't need my help
Tomorrow never comes :). I brute force and added just string property. Then do check in js. @Nickztar I tried to play ElementReference but unable to make it work. Even tho, if it could work then need to create separate ElementReference since gmaps dont duplicate if you pass same node. https://github.com/rungwiroon/BlazorGoogleMaps/releases/tag/3.2.1 https://github.com/rungwiroon/BlazorGoogleMaps/blob/master/ServerSideDemo/Pages/AdvancedMarkerViewPage.razor Guy need opinion if it work. Maybe it super duper slow.
Oh I have completely forgotten about it. This solution looks fine, maybe i'll get some more time soon and can try to do the elementReference. The "non-duplication" thing sounds like a feature to me, could save us from having to update the marker if it works as I think.
I guess a good solution might be to make Content a OneOf<string, ElementReference> but this should be fine until (if?) we figure it out 👍🏼