[UWP][WP8,1][WinJS] Unable to get the Bing Maps API RRS feed

  • Question

  • I'm developing and application for WP8.1 [WinJS 4.3/ HTML] and now I'm at the part of implementing the map. Unfortunately, I seem to be unable to reference the javascript api (bing ajax)... Seems like implementing this in my pivot item doesn't get the library properly (not at all to be more specific) 

    So I've tried to install the bing maps extension for VS, which gets installed, but I cannot add the reference to the extension in my VS2015 Community.

    So I'm stuck without the library and any map. Any chance there would be an offline version of the bing maps javascript api I could download and reference the same way as WinJS.

    Thank you

    Friday, September 18, 2015 6:35 AM


All replies

  • Hello,

    Have you seen this?

    Bing Maps SDK for Windows 8.1 Store apps

    This topic outlines how to use the Bing Maps AJAX Control 7.0 to develop a Windows Store app using JavaScript.

    Developing a Windows Store app

    With Regards,

    Krunal Parekh

    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 21, 2015 2:37 AM
  • Hi Krunal,

    I've seen all those, especially "Developing a Windows Store App" part, but unfortunately, after install the extension in my VS2015, I cannot add it as a reference in the project, it's simply not there (the appx) !

    for now I've ended up with a webview that calls the AJAX Control 7.0 js api from the internet.

    I'd really like to know how to get that extension up and runnning on my VS2015 !

    Monday, September 21, 2015 8:58 AM
  • Win8.1 does not have a WinJS map control (The Bing Maps WinJS control is only for Windows 8). Instead you can use the Bing Maps V7 JavaScript SDK from the web. Here is some documentation on this map control:

    Here are some resources about cross platform development with Bing Maps using JavaScript:

    Monday, September 21, 2015 4:24 PM
  • Hi Ricky,

    and that's the point. Consider the scenario, it's the WP8.1 application written in HTML5/JS. I'd like to implement the map somehow.

    Referencing the url directly in the application without any webview or frame is not an option because downloading the scripts from internet is prohibited. So that option is out.

    There is a Bing Maps api extension for visual studio 2013/2015 (the link "Developing a Windows Store app" that Krunal has posted"), that should bring the api to the developer as a local resource. Unfortunately, after installing this extension, I cannot add the reference to it as it's not found / recognized, I don't know. I looked into the install directory, and I can see all the js and css and other folders, which looked like the whole API, but once copied into my project and referenced that, it through some errors I couldn't resolve. apparently it must be refrerenced thourfh the extension (just like the WinJS2.1 is referenced when you start a new project from an 8.1 tempalte) THIS would be the correct path, but due to the inability to reference the library this option is out as well.

    So my last option is to use the webview or iframe, but I'm experiencing the issues of the image tiles being blurry as described in other post of mine.

    I'll still go through the links you have posted, even though I've seen them before, maybe I've missed something at the beginning. but again, refreencing a script that sits outside of the application content is prohibited, the extension is unusable in my scenario... 


    Tuesday, September 22, 2015 6:25 AM
  • Look at the video I posted in my previous response. I showed how to do this. You don't download and use the Bing Maps API as a local resource, you always reference the web version. If you are creating a HTML5/JS app in WP8.1 it is using a webview already. You can allow access to the script in the manifest.

    Tuesday, September 22, 2015 2:34 PM
  • I'm still getting this error. 

    "APPHOST9601: Can't Load <>. An app can't load remote web content in the local context."

    In my manifest:

            <Rule Match="https://*.*" Type="include" />
            <Rule Match="" Type="include" />
    <Rule Match="" Type="include" />


    So please tell me what else needs to be in there.

    Regarding the Bing Maps SDK for VS2013 and VS2015 that is available at one of the links mentioned in the first response, why it cannot be packaged and referenced as the WinJS2.1 used to be. And no, I'm not looking for a control, I'm looking for the local Bing API. I'd rather use a local version (and you have said that in that video, it's better because it's local).


    Wednesday, September 23, 2015 1:29 AM
  • Are you creating a WP8.1 Apache Cordova app in VS2015 or a Universal Windows app? The script reference works with Cordova perfectly. For universal apps security prevents this from happening. A way around this is to create a mashup as shown in this code sample:

    Here is an article that goes with this code sample:

    Wednesday, September 23, 2015 2:41 PM
  • So it's clear : I cannot use any packaged version of Bing Maps API in UWP or WP8.1 applications unless it's Cordova based app. As I'm experiencing the not clear map tiles issues or here

    I'd steer clear of Bind Maps or Google Maps if it wasn't the traffic data. 

    Nevertheless, I'm thankful for your patience and that you are trying to help me with this. Now the only thing that is blocking me is the blurry bing map tiles and weird scaling (not mentioning to write everything through the invokeScriptAsync :(  )


    Friday, September 25, 2015 9:22 AM
  • To take care of the blurry tiles se the map option enableHighDpi to true.

    Monday, September 28, 2015 5:42 PM
  • If you go and read through the stackoverflow responses you will find out that setting it to enableHighDpi doesn't help it. it's got to do with scaling within x-ms-webview or something else. just have a look here
    Wednesday, September 30, 2015 6:56 AM
  • I can send you the application solution (Stripped to bare minimum) if you provide me the link or email to send it to so you can see it on your own
    Wednesday, September 30, 2015 6:57 AM
  • The viewport information is what is meant to handle the scaling:

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    Wednesday, September 30, 2015 1:55 PM
  • I have that meta-tag in place since I've started writing the code around the map, so that's not an option (if you'd have looked at the link, it's there). I'm still open to provide you the sample but I'm giving up this completely. Thanks for all your support though.
    Thursday, October 1, 2015 2:57 AM