Bing Maps导航栏无法正确加载-Blazor

问题描述

我的Blazor页面之一中有一个必应地图。它可以很好地加载,但是我想我从未注意到导航栏的地图视图下拉列表根本无法正确显示。与典型的下拉行为不同,这些选项是水平定向的,并且“标签”切换从地图的边缘溢出。

Here's a picture of the navigation bar. Can't post pics here yet,sigh.

经过一些挖掘,我在地图选项中的每个NavigationBarMode中复制了错误。 我还注意到,NavigationBarOrientation选项在加载时不适用。加载地图后,控制台中会出现错误

在谷歌搜索后我找不到任何解决方案,所以我希望这里的人可以帮助我,如果他们以前遇到过这种情况。

控制台错误

The script from “https://dev.virtualearth.net/webservices/v1/LoggingService/LoggingService.svc/Log?entry=0&fmt=1&type=3&group=MapControl&name=MVC&version=v8&mkt=en-US&auth=Ah4u3oOOAy5wj5wC9MTsQaR3x78Iu2HgoIFLRQ6PB4IhD3LwwUvJ5CjNdzQKzf-E&jsonp=Microsoft.Maps.NetworkCallbacks.f_logCallbackRequest” was loaded even though its MIME type (“application/json”) is not a valid JavaScript MIME type.

JS中的地图调用

var navigationBarMode = Microsoft.Maps.NavigationBarMode;
this.map = new Microsoft.Maps.Map(document.getElementById('bingmap'),{
    zoom: 9,showSearchBar: true,navigationBarMode: navigationBarMode.square,});

_Host.cshtml

<!--Bing Maps-->
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?key=MyAPIKey'></script>

必应地图组件

@*Bing Map. *@
<div id="bingmap-container">
    <div class="mat-elevation-z5" id="bingmap"></div>
</div>

任何帮助或见识都将非常有用,谢谢。

约翰·贝斯特

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)