Skip to content
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

[Bug Report]: 关于MBaiduMap组件,添加Marker #2125

Closed
daipeng0809 opened this issue Sep 2, 2024 · 1 comment · Fixed by #2126
Closed

[Bug Report]: 关于MBaiduMap组件,添加Marker #2125

daipeng0809 opened this issue Sep 2, 2024 · 1 comment · Fixed by #2126
Labels
component/BaiduMap type/bug Something isn't working
Milestone

Comments

@daipeng0809
Copy link

Masa.Blazor version

1.7.0

Describe the bug

我使用MBaiduMap组件,按照实例子中的方式,添加Marker点,无反应,怎么办?
顺便问一下,Marker能不能自定义图标??
<MBaiduMap Height="540" @ref=_map
DarkThemeId="9828881e7efb0182edb48236a3b53293"
Style="width:90%; left:5%"
Zoom="15" EnableScrollWheelZoom
Center="new(116.403622f,39.918145f)">
</MBaiduMap>

@code {
private MBaiduMap? _map;
private MBaiduMarker? _addExampleMarker;
private async Task AddMarker()
{
if (_addExampleMarker is null)
_addExampleMarker = new()
{
Point = new(116.403874f, 39.911919f),
Title = "天安门",
};
if (await _map.ContainsOverlayAsync(_addExampleMarker))
return;
await _map.AddOverlayAsync(_addExampleMarker);
}
}

Expected Behavior

No response

Steps To Reproduce

No response

Reproduction code

No response

.NET version

No response

What browsers are you seeing the problem on?

No response

Additional context

No response

@daipeng0809 daipeng0809 changed the title [Bug Report]: [Bug Report]: 关于MBaiduMap组件,添加Marker Sep 2, 2024
@capdiem
Copy link
Contributor

capdiem commented Sep 2, 2024

@daipeng0809 添加marker确实报错了,多谢反馈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/BaiduMap type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants