IP geolocation Query class
/**
File name: IpLocation.class.php
* IP Geo-Location query class (Master file I'm uploading it.) I upload a test file, and there is a QQWry.Dat this can be downloaded to the pure IP library because there are more than 6M so here do not upload it up.
*
* @author Ma Bingyao
* @version 1.5
* @copyright 2005 coolcode.cn
*/
Class Iplocation {
/**
* QQWry.
Html5 Geolocation instance for obtaining geographic location information, html5geolocation
Html5 provides an API for obtaining the current location of a user through a browser. Based on this feature, you can develop location-based service applications. Before obtaining the geographic location information, the browser will first ask the user if they are willing to share their location information, which can be used only after the user's consent.
Html5
Today, the development of applications, access to geographical location, the first use of H5 geolocation method to obtain a geographical location, the test found that the Android machine can, but the iOS is not, a check data only know: 10.0 Apple version requires protocol for HTTPS to get to geo-location. Then in order to solve this problem, use Baidu Map to obtain, the specific steps and code are as follows:1. Open http://lbsyun.baidu.com/Baidu Map o
The company has a demand, need to get the location of users, so look at the next HTML5 geolocation This new thing, found very useful.After the above code is run, it will pop up first, whether to allow you to get your current location, if you click OK, then you will get the coordinates of your current position, then we can show this coordinate to the map.It is best to use high-gold map, because the coordinates of the high-German map and Google map coor
51815467 Positionoptions: JSON object that listens to device location information Parameters Navigator. geolocation. getcurrentposition ( Function (Position) {alert ( 'Latitude '+ Position. coords. Latitude )}, Function () {Alert ( 'Error' )}, {Enablehighaccuracy: True , // Whether to obtain high-precision longitude and latitude. The default value is false. Timeout: 5000, // Timeout time for obtaining location information. Unit: Millisecond (MS)
Navigator. geolocation example classification: javascript 1601 people read comments (0) collect reports function Browser
[HTML]View plaincopy
Reprinted: http://blog.csdn.net/gohome520/article/details/7338486
Example of navigator. Geolocation
A gadget that displays IP geolocation information under Linux-naliFirst, IntroductionNali, the name is taken from the Chinese "where" pinyin. Nali contains a set of command-line programs whose main function is to attach the IP strings of the output of some network tools to the location information (using the Pure database QQWry.Dat). For example, 74.125.128.104 will become 74.125.128.104[the California Mountain View of the United States Google Inc.].
The Window.navigator object contains information about the visitor's browser, and the Window.navigator object can be written without using the window prefix.Browser supportInternet Explorer 9, Firefox, Chrome, Safari, and Opera support geo-targeting.Note: geo-positioning is more accurate for devices with GPS, such as the IPhoneHTML5 Geo-positioningHTML5 provides the Geolocation property for Window.navigator, which is used to obtain the current user's
11
00
10
The Geohash value for this [4,6] point is now 00
Then cut each of the four small pieces, as follows:
At this point the [4,6] dot is in the upper right area and the value on the right is 11 so that the [4,6] point's Geohash value becomes: 0011
Continue to slice two times:
The resulting Geohash value for the [4,6] point is: 00110100
So we use this value to index, then the point near the map can be converted to the same prefix of the Geohash value.
As we ca
):
01
11
00
10
The Geohash value for this [4,6] point is now 00Then cut each of the four small pieces, as follows:At this point the [4,6] dot is in the upper right area and the value on the right is 11 so that the [4,6] point's Geohash value becomes: 0011Continue to slice two times:The resulting Geohash value for the [4,6] point is: 00110100So we use this value to index, then the point near the map can be converted to the same prefix of the Geo
LBS, which stores the latitude and longitude coordinates of each location, searches for nearby locations and establishes a geographical index to improve query efficiency.
MongoDB geolocation Index,2d and 2dsphere, corresponds to planar and spherical surfaces.
1. Create lbs collection Storage location coordinates
Use Lbs;db.lbs.insert ( { loc:{ type: ' point ', coordinates: [113.332264, 23.156206] }, Name
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup www.google.com5.4. Nali-traceroute# Nali-traceroute www.google.com5.5. Nali-tracepath# Nali-tracepath Www.baidu.com5.6. Nali-ping# nali-
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup www.google.com5.4. Nali-traceroute# Nali-traceroute www.google.com5.5. Nali-tracepath# Nali-tracepath Www.baidu.com5.6. Nali-ping# nali-
"title=" 10.jpg "alt=" Wkiom1vvtavisvxeaamv_hollcq887.jpg "/>In other words, Nali This command, you can attach the geo-information to the standard output IP. Similarly, if you do not like to use Nali-dig, then you can also use dig Ip|nali such commands.VI. AliasIf you think the input nali-xxx trouble, then you can do some alias, for example:# alias Traceroute= ' Nali-traceroute '# alias dig= ' Nali-dig '650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/F2/wKioL1VvtbvwWBDzAAReQal2ryk
to dig |nali)Second, download# wget--no-check-certificate http://qqwry.googlecode.com/files/nali-0.2.tar.gzThird, installation# tar ZXVF nali-0.2.tar.gz# CD nali-0.2#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3.
-mounted clock, in addition to the user's 3D coordinates x, y, and z,Delta T refers to the time difference between the satellite and the receiver as an unknown number, and then the four unknown numbers are parsed using four equations. Therefore, if you want to know where the receiver is, you must be able to receive signals from at least four satellites.
As we can see from the above, GPS is not what I originally thought. The GPS device sends a request to the satellite, and the satellite returns t
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.