[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