"ASP." Based on the IP address Baidu map location

Source: Internet
Author: User

Yesterday has completed an "ASP." Based on the IP return corresponding location information of the small demo, since the location information can be obtained through the IP, it can certainly be obtained by the latitude and longitude of the location of the IP current location, although with the actual address offset is larger, after all, is not GPRS, But still in the city, as follows:

The specific step is to obtain the location information based on the client's IP address, and then obtain the positioning based on the latitude and longitude information in the location information through the Baidu map API.

1. How to obtain location information based on the IP address of the client is clearly stated in the "ASP. NET Advanced" return corresponding location information according to IP .

2. According to the latitude and longitude information in the location information through the Baidu Map API to get the location mask layer and Baidu map pop-up layer simple implementation also explained very clearly.

Here is the Baidu map of the JAvascript API , the API address is: http://developer.baidu.com/map/index.php?title=jspopular , Its map API example address is: http://developer.baidu.com/map/jsdemo.htm

3. Finally, parse the Json data returned by the location information, and use Newtonsoft.json to deserialize it.

4. Detailed code See getiptoadt.zip

Test address:http://www.ycdoit.com/test/getiptoadt.aspx

"ASP." Based on the IP address Baidu map location

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.