The author recently do taxi-related projects, need to use the map, for Tencent map of the small white level introductory tutorial is less, especially run through the map demo several steps to write down, for the new reference. A brief introduction, Tencent map sample Demo has basic map, positioning, map interaction, map transformation, annotation, graph drawing, route planning, retrieval and other functions. In the basic map, there are functional modules for displaying maps, map types, indoor maps, overseas maps, various modes of switching, and offline maps.

First, register an account

Registered address: lbs.qq.com

Click the link to enter the official website of Tencent Location Service and complete the account registration information.Enter the console from the avatar icon in the upper right corner,Get the key, which we’ll use later, the specific information is shown in the figure below:

Download SDK and Demo project

The top layer of the official website has the column of “Development Document”. This article takes Android as an example, select the link of “Android Map SDK”, and see the following figure for specific operations:In the new page opened, we choose 3D map SDK, 3D map interface should be richer than 2D map, the vision is more cool.

3. Fill in the key

As described in the official documentation, you can just fill in the key in the Androidmanifest.xml configuration file, but it doesn’t work very well.Add the key to the local.properties directory of the project root directory.

4. Specify the package

On the console, fill in the package name of the application. For Android, it is package Name and for iOS, it is Bundle Identifier. The specific operation steps are shown in figure:

Five, installation procedures

Install the Android application and run it, you can see the map, as shown in the picture:In Tencent map sample demo, select the first basic map, you can begin to explore the map function. The following screenshots are Tencent map sample, overseas map, display map, map type four basic function interface, of course, there are many other content, you can practice by yourself.Note: If the key or package name is not specified correctly, a message indicating that the key verification fails will always be displayed when the above page is displayed.

Author: Data-mining