最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

blazor - How do I change a BlazorGoogleMaps GoogleMaps component's MapTypeId programmatically? - Stack Overflow

programmeradmin1浏览0评论

I want to provide a way for the user to change the page's GoogleMaps component's MapTypeId with a few buttons. I am using Blazor WASM. How do I do that?

I'm using MudBlazor components, so I would greatly appreciate an example using that.

I set up my project according to the project's readme, and I was able to create a GoogleMap component with any of the available MapTypeIds, but when I changed it, nothing happened.

I want to provide a way for the user to change the page's GoogleMaps component's MapTypeId with a few buttons. I am using Blazor WASM. How do I do that?

I'm using MudBlazor components, so I would greatly appreciate an example using that.

I set up my project according to the project's readme, and I was able to create a GoogleMap component with any of the available MapTypeIds, but when I changed it, nothing happened.

Share Improve this question asked Mar 12 at 14:51 Olivér RaiszOlivér Raisz 5381 gold badge6 silver badges23 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Based on this answer, I was able to solve this problem. The relevant code part that helped:

await map.InteropObject.SetMapTypeId(MapTypeId.Satellite);
发布评论

评论列表(0)

  1. 暂无评论