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