Asp.net calls 51 DITU API

Source: Internet
Author: User
Code
<% @ Page Language = " C # " Autoeventwireup = " True " Codefile = " Default3.aspx. CS " Inherits = " Default3 "   %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Html Xmlns = "Http://www.w3.org/1999/xhtml"   >
< Head Runat = "Server" >
< Title > 51 Map </ Title >
< Script Type = "Text/JavaScript" SRC = "Http://api.51ditu.com/js/maps.js" > </ Script >
< Script Type = "Text/JavaScript" SRC = "Http://api.51ditu.com/js/ezmarker.js" > </ Script >  
</ Head >
< Body >
< Form ID = "Form1" Runat = "Server" >
Longitude: < Input Runat = "Server" Type = "Text" ID = "X" Name = "X"   />
Latitude: < Input Runat = "Server" Type = "Text" ID = "Y" Name = "Y"   />
Scale level: < Input Runat = "Server" Type = "Text" ID = "Z" Name = "Z"   />
< Div ID = "Mymap" Style = "Position: relative; width: 400px; Height: 300px ;" >
</ Div >
< Script Type = "Text/JavaScript" >
VaR Maps =   New Ltmaps ( " Mymap " );
Maps. citynameandzoom ( " Chongqing " , 5 );
// Add scaling Control
VaR Control =   New Ltsmallmapcontrol ();
Maps. addcontrol (control );
// Add a drop-down box zoom-in control
VaR Control =   New Ltzoomincontrol ();
Maps. addcontrol (control );
// Add a tag
VaR Marker1 =   New Ltmarker ( New Ltpoint ( 11636224 , 3991040 ));
VaR Marker2 =   New Ltmarker ( New Ltpoint ( 11641152 , 3992640 ));
Maps. addoverlay (marker1 );
Maps. addoverlay (marker2 );
// Add a tag
VaR Point =   New Ltpoint ( 11640969 , 3989945 ); //
VaR Marker =   New Ltmarker (point );
Maps. addoverlay (Marker );
VaR Infowin =   New Ltinfowindow (Marker );
Infowin. setlabel ( " <A href = 'HTTP: // www.51ditu.com 'target =' _ blank '> http://www.51ditu.com </a> " );
Maps. addoverlay (infowin );
// Keyboard Operation Support
Maps. handlekeyboard ();
// Scroll wheel support
Maps. handlemousescroll ();
// Implement the setmap method of the system
Function Setmap (point, zoom)
{
Document. getelementbyid ( " X " ). Value = Point. getlongpolling ();

Document. getelementbyid ("Y"). Value=Point. getlatitude ();

Document. getelementbyid ("Z"). Value=Zoom;

}
VaR EZ = New Ltezmarker ( " Ezmarker " );
EZ. setdefaultview ( " Chongqing " , 10 ); // The map is located in Chongqing by default.
EZ. setplacelist ( True ); // Display the map search control on the map
EZ. setsearch ( True , " Chongqing " ); // Display the search control on the map and specify the default search City as Chongqing.
Ltevent. addlistener (EZ, " Mark " , Setmap ); // "Mark" indicates an event.
</ Script >  
</ Form >
</ Body >
</ Html >

Related Article

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.