[英]Bing maps v8 not loading for IE11
I'm doing a pretty standard loading of a map, like: 我正在做一个非常标准的地图加载,如:
map = new Microsoft.Maps.Map(document.getElementById('map_canvas'));
In Chrome it works fine, but in IE11, I get an exception in the map code: 在Chrome中它工作正常,但在IE11中,我在地图代码中得到一个例外:
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'matchMedia' 0x800a01b6 - JavaScript运行时错误:对象不支持属性或方法'matchMedia'
The line within the Bing maps code is: Bing地图代码中的行是:
return window.matchMedia("(-ms-high-contrast:active)").matches
The window variable is defined, but if I examine it matchMedia is undefined. 窗口变量已定义,但如果我检查它,则matchMedia未定义。
The entire stack trace is: 整个堆栈跟踪是:
Unhandled exception at line 1, column 9149 in https://www.bing.com/rms/MapCoreBundle/jc,nj/81a88ae6/9adb7eaf.js?bu=rms+answers+MapsSDK+AnonymousBegin*MapCore.en*MapCoreBegin*LabelOptions*LocalStorageCache*Gimme*GimmeWrapper*evPromise*ExternalPromise*StaticPromise*CookiesHelper*LruCache*Point*Rectangle*NAARectangle*ResourceManager*Units*Anchor*Size*Binding*ChangeMagnitude*EventBinding*Observable*ObservableObject*ObservableObjectChangedArgs*ObservableCollection*Debug*DelayLoadedObject*JSEvent*Dispatcher*WorkDispatcher*Iterator*ElementSizeHelper*GimmeExt*GimmeTransition*Helper*PerfState*ClientPerf*LoggingWrapper*LoggerConstants*Network*ThrottledEventInvoker*ObjectPool*StaticObjectPool*FixedSizeObjectPool*OrderedDictionary*PooledImage*Url*MapCoreMiddle*AltitudeReference*TransformCurve*GraphType*CurveKey*Curve*Color*CurveVector4*CurveColor*Vector4*CurveTangent*DiscreteRange*DiscreteRangeCollectionSpline*MapLayer*AutoScaling*PointLabelPlacementPreference*PolygonFillPreference*VerticalAlignment*CopyrightProvider*CopyrightProviderService*EntityState*MinZoomFraming*GeometryType*HitTestability*HorizontalAlignment*MapModeType*ViewChangeCause*MapFrameManager*LayerFrameManager*GoalCounter*FrameEventAggregator*DataMonitor*MapFrameData*LayerFrameData*Clipper*CompositePrimitiveSet*DataLoader*Differ*FixedPrimitiveSet*PrimitiveSubset*Overlay*OverlayAlignment*ImageryMapLayer*SimpleSceneContributor*VectorMapLayer*BasicMapAnimation*MapViewAnimator*BoundsAccumulator*CombinedLayerCollection*ConstrainViewArgs*LatLonCrs*LocationRect*Matrix2D*MapInstrumentationManager*Map*MapHelper*MapMath*MapLocation*MapType*MapTypeChangeArgs*MapTypeCollection*MapTypeId*MapView*MapEventForPrimitiveOverlay*MapQuadrant*PrimitiveOverlayHelper*OverlayBehavior*GeometryGeneralizer*SimplePointPrimitive*SimpleLinePrimitive*SimpleAreaPrimitive*MoveableSimplePointPrimitive*TargetViewChangeArgs*VectorMath*ViewChangeArgs*ZoomLevel*ZoomAroundLocationAnimator*ZoomEventArgs*OverviewMapMode*MapAuthentication*PublicApi*InternalApi*AnonymousEnd
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'matchMedia'
Thanks for any help! 谢谢你的帮助!
Internet Explorer 11 should support matchMedia . Internet Explorer 11应支持matchMedia 。 Therefore, the most likely cause is that the document is being parsed in a non full standard mode . 因此,最可能的原因是文档正在以非完整标准模式进行解析。 Probably because you did not specify a doctype at the top of your HTML, eg: 可能是因为您未在HTML顶部指定doctype,例如:
<!DOCTYPE html>
As the topmost HTML line. 作为最顶层的HTML行。
Another possibility is that you are declaring that the browser should use a compatibility mode, for instance by use of the http-equiv="X-UA-Compatible"
meta tag. 另一种可能性是您声明浏览器应该使用兼容模式,例如使用http-equiv="X-UA-Compatible"
元标记。 If this tag is present, try removing it. 如果此标记存在,请尝试删除它。 If it isn't present, try adding 如果不存在,请尝试添加
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
to ensure that IE is using the latest mode it can. 确保IE正在使用最新模式。 Read more here. 在这里阅读更多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.