Use APIs provided by Baidu to obtain the traffic routes of two locations in the same city
Code:
Code
1 <Head runat = " Server " > 2 <Title> No title page </title> 3 <Style type = " Text/CSS " > 4 # Allmap { 5 Width: 400px; 6 Height: 400px; 7 Overflow: hidden; 8 } 9 </Style> 10 </Head> 11 <Body> 12 <Form ID = " Form1 " Runat =" Server " > 13 <Div id = " Allmap " Style = " Float: left; " > 14 </Div> 15 <Div id = " Result " Style =" Width: 300px; float: left; " > 16 </Div> 17 </Form> 18 19 <SCRIPT src = " Http://api.map.baidu.com/api? V = 1.3 " Type = " Text/JavaScript " > </SCRIPT> 20 21 <Script language = " Javascript " Type = " Text/JavaScript " > 22 VaR Map = New Bmap. Map ( " Allmap " ); 23 VaR Ponit = New Bmap. Point ( 121.568004 , 31.218032 ); 24 Map. centerandzoom (ponit, 15 ); 25 VaR Transit = New Bmap. transitroute (MAP ,{ 26 Renderoptions: {map: map, panel: " Result " } 27 }); 28 Transit. Search ( " Jin Boyuan " , " People's Square " ); 29 </SCRIPT> 30 31 </Body>