The magic of MKT parameters in Bing Maps

Source: Internet
Author: User

 

When I wrote this article, I thought of a poem: no intention of inserting Liu into the shade. Although I used to know the usefulness of the MKT parameter, it was used to display different language versions, but I never thought of adding this parameter to the Bing map API development and expected results.

Many of my friends asked me how to display a satellite map on the Bing map. Because the Chinese Bing map does not support satellite maps, the Bing Maps global platform does not support Chinese and the Map Quality in China is poor. Yesterday, when I answered a colleague's question, I accidentally found the simplest way. Open the source code of a bing map example and find the following line of code:

<SCRIPT type = "text/JavaScript" src = "http://dev.ditu.live.com/mapcontrol/mapcontrol.ashx? V = 6.1 "> </SCRIPT>. If no modification is made, we can see the following results:

Now we add the MKT = en-US parameter to the map control URL above, that is:

<SCRIPT type = "text/JavaScript" src = "http://dev.ditu.live.com/mapcontrol/mapcontrol.ashx? V = 6.1 & MKT = en-us "> </SCRIPT>. Run this example to get the following results:

Have you seen the difference? The two examples show map of China, but the map toolbar has changed! After the MKT parameter is added, the toolbar becomes the same as the Bing Maps global platform !! Click the aerial tab to see if the satellite map is correctly displayed. Unfortunately, the map area is black, which means no satellite map can be displayed. But it doesn't matter. We can click the 3D tab to display the 3D map effect and satellite map! This means that we can also use the 3D map API to load 3D building models on the Chinese map platform. In the next lecture, I will introduce how to load self-made 3D models on the Bing map. Of course, some friends say that I want to display a satellite map when I click the aerial label. Indeed, the black area of the map area is poor for the user experience. Bing map also provides a solution. First, we can shield the toolbar provided by Microsoft by default and rewrite the toolbar function by ourselves. First, we can display Chinese labels instead of English words such as aerial and Bird's Eye. Second, we can control that users can click the aerial label to view the satellite map only after clicking the 3D label. If you think this method is not good enough, I have to tell you another way. Microsoft provides the map. addtilelayer () method, which overlays user-defined layers on the Bing map. For more information, see http://msdn.microsoft.com/en-us/library/bb429629.aspx. The first input parameter in this method is a vetilesourcespecification class. This class has a property of vetilesourcespecification. tilesource, which is used to point to the location of the map tile. Therefore, as long as you know the URL of the Bing map tile, the satellite image can be superimposed on the road map as a custom layer. However, Microsoft may change the tile URL at any time, so this method is not reliable. Microsoft partners can contact me to sign NDA to use this solution. My email: acnchen@hotmail.com. An interactive SDK is provided at http://www.microsoft.com/maps/isdk/ajax /.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.