[ASP. NET advanced] Baidu map location based on IP addresses, asp. netip

Source: Internet
Author: User

[ASP. NET advanced] Baidu map location based on IP addresses, asp. netip

Yesterday, a [ASP. NET advanced] returns a small Demo of the corresponding location information based on the IP address. Since the location information can be obtained through the IP address, the current location of the IP can be obtained through the longitude and latitude of the location information, although the offset from the actual address is large, it is not GPRS, but it is still in this city, as follows:

 

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

1. How to obtain location information based on the Client IP address is clearly described in [ASP. NET advanced] Return location information based on the IP address.

2. You can use the Baidu map API to obtain the positioning mask layer and the Baidu map pop-up layer based on the longitude and latitude information in the location information.

Here is the use of Baidu map JavaScript API, its API address is: http://developer.baidu.com/map/index.php? Its map API example address is: http://developer.baidu.com/map/jsdemo.htm

3. parse the JSON data returned by the location information by using Newtonsoft. Json deserialization.

4. For detailed code, see getIpToAdT.zip.

 

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

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.