Question related to culture code in Bing Map

Yejin Choi__ 20 Reputation points
2024-02-05T02:35:34.3433333+00:00

Hello! I am using api (https://learn.microsoft.com/en-us/bingmaps/rest-services/directly-accessing-the-bing-maps-tiles) that accesses tiles directly from BingMap. As the document says, I am using like this -> https://ecn.{subdomain}.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=14226&mkt={culture}&shading=hill

My question is that a specific culture doesn't seem to work. In the culture code, there is ko which means Korea. However, when I request https://ecn.t0.tiles.virtualearth.net/tiles/r300.jpeg?g=14226&mkt=ko&shading=hi , the tile comes out in English. After running with ja(japen), some tiles do not show images at all.(Example: https://ecn.t0.tiles.virtualearth.net/tiles/r12133200010.jpeg?g=14226&mkt=ja&shading=hill) If you don't support the culture code you entered, there are times when tile comes out in English, and sometimes the image doesn't come out at all.Basically, if it is a culture written in the culture code docs, I think it should support all tiles.Am I misunderstanding or using the app wrong? Thank you.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
589 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 15,311 Reputation points Microsoft Employee
    2024-02-05T17:25:50.0566667+00:00

    A couple of issues/notes:

    • It looks like you are likely using Road as the map type rather than RoadOnDemand. Road is an old, deprecated, static road map layer that's there for legacy reasons and shouldn't be used. RoadOnDemand dynamically adds the labels and has a lot more support for cultures.
    • When requesting the imagery metadata, set the culture parameter, this will add the mkt parameter to the map tile URL for you (this will clean/verify the culture code for you). So your imagery metadata URL should look like this: https://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&culture=ko&uriScheme=https&key={YourBingMapsKey}

    Note that I added &uriScheme=https as you should only ever use https in new apps. Which will return a response like this:

    {     "authenticationResultCode": "ValidCredentials",
        "brandLogoUri": "https://dev.virtualearth.net/Branding/logo_powered_by.png",
        "copyright": "Copyright © 2024 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
        "resourceSets": [
            {
                "estimatedTotal": 1,
                "resources": [
                    {
                        "__type": "ImageryMetadata:http://schemas.microsoft.com/search/local/ws/rest/v1",
                        "imageHeight": 256,
                        "imageUrl": "https://{subdomain}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{quadkey}?mkt=ko&it=G,L&shading=hill&og=2390&n=z",
                        "imageUrlSubdomains": [
                            "t0",
                            "t1",
                            "t2",
                            "t3"
                        ],
                        "imageWidth": 256,
                        "imageryProviders": null,
                        "vintageEnd": null,
                        "vintageStart": null,
                        "zoomMax": 21,
                        "zoomMin": 1
                    }
                ]
            }
        ],
        "statusCode": 200,
        "statusDescription": "OK",
        "traceId": "b62d8ac6bc55332be0aa5c42dea77a89|MWH0032BF0|0.0.0.1"
    }
    

    And then once you add a subdomain (t0,t1,t2,t3) and your quadley value (300) your tile request will look like this:

    https://t0.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/300?mkt=ko&it=G,L&shading=hill&og=2390&n=z

    And the tile will look like this:

    enter image description here

    All that said, it should also be noted that not all cultures are supported at all zoom levels in all parts of the world. So if you tried to get a Korean map of a streets in the USA, not all labels may be translated, if any.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful