Multi-Point walking path connection in Baidu Map

Source: Internet
Author: User

Recently, Baidu map needs to be used in combination. The need is to establish a walking link between multiple points on the map. Baidu provides a walking path between two points and coordinate points along the map; the preliminary idea is to first draw the walking path of each point, then get the coordinate information set of the line, and then re-draw the complete line through another line interface of Baidu map;

If you are not familiar with Baidu map APIs, refer to http://developer.51cto.com/art/201110/298662.htmfor details;

Baidu map API developer address: http://developer.baidu.com/map/jshome.htm

 

1. Implement the required functions by combining the following two Baidu instances;

1: two walking examples: http://developer.baidu.com/map/jsdemo.htm#i6_1

<HTML> 

 

2: Line instance: http://developer.baidu.com/map/jsdemo.htm#c1_5

<Head> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/> <meta name =" viewport "content =" Initial-scale = 1.0, user-scalable = No "/> <style type =" text/CSS "> body, HTML, # allmap {width: 100%; Height: 100%; overflow: hidden; margin: 0 ;}</style> <SCRIPT type = "text/JavaScript" src = "http://api.map.baidu.com/api? V = 2.0 & aK = your key "> </SCRIPT> <title> line </title> 

 

2. connect to an instance through a multi-point walking path (the complete code is as follows, with corresponding instructions. The instance defines three points)

<HTML xmlns = "http://www.w3.org/1999/xhtml"> 

The left side is the three-point Link Map displayed by the walking interface. The start and end points are identified between the two points. Therefore, if there are multiple points on the map, a marker indicating the start and end points appears; on the right is the modified map;

 

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.