[英]Adding code specific to Windows Phone Internet Explorer
I've been testing out the Google Maps API on various browsers and also different phones/tablets... all is working fine except for when trying it on a Windows Phone. 我已经在各种浏览器以及不同的手机/平板电脑上测试过Google Maps API,除了在Windows Phone上尝试使用时,所有功能都工作正常。 After some research I've found out it's because Google Maps isn't supported on Windows Phones hence the error. 经过一些研究,我发现这是因为Windows Phones不支持Google Maps,因此出现了错误。
My question is how would I go about making it so that it displays an image of the map instead of the map API? 我的问题是我将如何制作它,以使其显示地图图像而不是地图API?
eg. 例如。 for Windows Phone it would display: 对于Windows Phone,它将显示:
<div><img src="map.png"></div>
But for everything else it would display and use the API: 但对于其他所有内容,它将显示并使用API:
<div id="map_canvas"></div>
Many thanks for your help 非常感谢您的帮助
You can check the user agent for IEMobile 您可以检查IEMobile的用户代理
This is the windows phone mobile agent. 这是Windows Phone移动代理。
Or better yet can you not do a boolean check if the map is working so if it fails in any browser then you are covered? 或更妙的是,您是否可以不对布尔值进行布尔检查,以确保该图在任何浏览器中均无法正常运行,那么您会被覆盖吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.