为HTML,CSS,JS中的Windows PHONE 8.1地图API [英] Map APIs for windows PHONE 8.1 in HTML, CSS, JS

查看:173
本文介绍了为HTML,CSS,JS中的Windows PHONE 8.1地图API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有类似的问题(


I am aware there is a similar question (Map APIs not working for windows phone in HTML), but I don't have enough reputation to comment so I am having to ask my own question.

I have successfully added bing maps to my windows 8.1 store app (HTML, JS, CSS), but when trying to add the reference in visual studio (the maps SDK) to windows phone 8.1 the option isnt available to me. I went through the answer to the question asked previously and in the examples there is a windows store app (fine!), a mobile web app and a C# example. So I tried the mobile web version but just adding this link

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en-gb"></script> 

obviously gives the error that you cant add a remote script as a local one (something along those lines)

So I tried just copying the code from the url above and saving locally but that gave me the error about script trying to inject dynamic content. Now I am at a bit of a loose end as to what to try next...any suggestions/links to helpful content will be greatly appreciated!

I should mention, I have seen a lot of documentation on adding the maps and that they are included within the windows phone 8.1 sdk so you dont need the bing maps sdk BUT these were mostly xaml, is there a way to access the sdk via js?

解决方案

Actually you can add the bing APi for Win8.1 to WP8.1, just hack the bing map APi dll and set the file to Visual Studio and add th bing reference like this

 <!-- Bing Maps references -->
<script type="text/javascript" src="/Bing.Maps.JavaScript/js/veapicore.js"></script>
<script type="text/javascript" src="/Bing.Maps.JavaScript/js/veapiModules.js"></script>

then work normally as you work with Win8.1, see my project. by the way add a code to verify connection status, cause this map work only if the connection exits (if you will add some pushpin manually it can work with no connection)

Fair Of Sfax WP

这篇关于为HTML,CSS,JS中的Windows PHONE 8.1地图API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆