How can i get Bing map Url from Bing Map Object RRS feed

  • Question

  • i have constructed bingmap in my page but i want to export it to pdf.

    i am using bingmap imagery service using below url

    i want to get bing map request url that i already constructed in my current page and i am exporting same map to pdf

    or i want to get mtoption in from of string representation so i can pass it to in form of post data 

    Friday, July 14, 2017 8:33 AM


All replies

  • Not sure what you are asking.

    If you want to use the Bing Maps REST services in JavaScript, it is pretty easy to do and there are several samples of this here:

    If you are using the interactive map control (i.e V8) and want to generate an image of the map, then that will likely be a lot of work. The REST services only supports pushpins and routes, not all the features of V8 such as polygons and heatmaps. The only way to export an image of the V8 map is to take a screenshot, or use a tool that is designed for rendering webpages and capturing screenshots.

    [Blog] [twitter] [LinkedIn]

    Friday, July 14, 2017 4:56 PM
  • Thanks Ricky for reply

    i am manually constructing url using below code i am able to achive 80 %

    i want to pass push pin font and map font also not coming properly can you give me the details on this

        var lat = _dlgMessageBox2Map.getCenter().latitude  //Latitude range 30 - 40 degrees
        var lon = _dlgMessageBox2Map.getCenter().longitude  //Longitude range -90 - -100 degrees
        var MapZoomLevel = _dlgMessageBox2Map.getZoom();

        var MapTypeValue = _dlgMessageBox2Map.getMapTypeId() ;
        var MapType;

        if (MapTypeValue == 'a')
            MapType = 'AerialWithLabels';
        else if (MapTypeValue == 'r')
            MapType = 'road';
        else if (MapTypeValue == 'x')
            MapType = 'streetside';

        var MapWidth = _dlgMessageBox2Map.getWidth();
        var MapHeight = _dlgMessageBox2Map.getHeight();

        request = '' + MapType + '/' + lat + '%2C' + lon + '/' + MapZoomLevel + '?mapSize=' + MapWidth + ',' + MapHeight + '&navigationBarMode=compact&NavigationBarOrientation=horizontal&format=jpeg&key=' + bingMapsKey;

        //Generate mock data
        var pushpins = [];

        var j;
        for (var i = 0; i < pins.length; i++) 
            pushpins.push('pp=' + GetRandomCoordinate(i) + ';125;' + j);

        var postData = pushpins.join('&');
            CallPostService(request, postData, 'image/png', function (r) {
                //document.getElementById('outputDiv').innerHTML = '<img src="' + r + '"/>';
                imagedata = r;

            _mapContent = imagedata;


    Tuesday, July 25, 2017 9:18 AM
  • There is no option for pushpin or map font. However, I recommend using the RoadOnDemand map type with the REST services as that is what the V8 control uses for the base maps. 

    [Blog] [twitter] [LinkedIn]

    Tuesday, July 25, 2017 7:36 PM
  • Thanks Ricky,

    i have one more question does REST services support streetside maptype.

    i am able to get Road and AerialWithLabels map type but i am unable to get Streetside.


    Monday, July 31, 2017 11:26 AM
  • No. This is not documented as a supported type:

    [Blog] [twitter] [LinkedIn]

    Monday, July 31, 2017 12:56 PM
  • Thanks Ricky

    please find below pictures there font issue please suggest me to solve this with Bing Map Rest service




    Wednesday, August 2, 2017 8:26 AM
  • This is to be expected. The V8 control uses vector labels and renders them differently than the REST services. 

    [Blog] [twitter] [LinkedIn]

    Wednesday, August 2, 2017 3:18 PM
  • Can i pass image size(not map size) with the Bing Map Rest Service Request . means i want to get map image with my specified size i.e. Length and Width.


    Thursday, August 17, 2017 10:26 AM
  • The map size you pass in will be the size of the image returned. I understand what you are asking though, and that requires the map to use decimal zoom levels and integer zoom levels which is not supported by the REST services.

    If you want to generate an image of your map, there is an experimental code sample that shows how to do this here:

    [Blog] [twitter] [LinkedIn]

    Thursday, August 17, 2017 7:17 PM