Blog Gonzo
For quite some time looking for work yourself the lion the witch and the wardrobe on which to try to implement the lion the witch and the wardrobe different NEWT. And as required by good practice, I found the playing field in addressing their own needs. The thing is that since I use Foursquare tried two different apps for Symbian, but both had the same disadvantage - not working without the GPS receiver of the phone to work. The problem is that the GPS receiver of my phone is experiencing great difficulties in finding the lion the witch and the wardrobe the satellites if there is no Internet connection, but I still pull subscriptions, including data channel. So in my case or has GPS (when I'm outside), the lion the witch and the wardrobe or has the Internet (where the place where you are, offering WiFi). So the solution is GeoLocation API
Although not part of the specification of HTML5, GeoLocation API is often mentioned the lion the witch and the wardrobe together with it is a natural part of NEWT. Allows us through little JavaScript to determine the user's location. I opened one a page demonstrating the capabilities of GeoLocation and was amazed at the accuracy - the point on the map was 100-200 meters from home. Enough for my needs.
Let's see how it numbers: if (navigator.geolocation) {navigator.geolocation.getCurrentPosition (function (position) {/ / we have the user's location: position.coord.lat and position.coords.lon}, function (error) {/ / error in determining the location});} else {/ / Browser does not support GeoLocation API}
You can count that will successfully identify the location the lion the witch and the wardrobe of the user as long as it uses a fairly recent version of Firefox, Safari, Chrome or Opera. But for me it is interesting if it works on my cell phone. My parachute opened when I installed Opera Mobile 10.1, and the owners of an iPhone the lion the witch and the wardrobe or Android phone can be localized without the need to install additional software. The only peculiarity is that some devices require Android 2.1 included GPS receiver, although not rely on it (I tried with Globul Q1 SE). How does GeoLocation?
Okay, but how the browser determines the location without GPS, you ask? Browsers use several methods by which determine the location depending on the available GPS and network devices.
Where available GPS, mobile phone browsers can use the data from it to determine with great accuracy the location of the user. This approach works on phones with Android OS and iPhone, but the WebKit browser on my Nokia 5800 does not support GeoLocation API, although the phone has GPS.
When no GPS, or it can not located, the browser used other methods. The first possibility is using information from the GSM network - cells have a known location, and through calculation based on the signal strength of the different cells, the lion the witch and the wardrobe the location can be determined with sufficient accuracy. This is actually one of the functions of A-GPS devices embedded in mobile phones. The other is downloading the almanac with the location of the satellites over the Internet, which speeds up the establishment of the location.
When this method is not available, there is another way to determine the lion the witch and the wardrobe the location with sufficient precision. There are various companies that go around the streets with cars and collect the signal strength of different WiFi networks. Then you can easily reverse the order to establish the location of a device in the list of visible the lion the witch and the wardrobe networks and their power. This is the main method used Opera and Firefox, both browser makes a request to a Google service for this. Opera for this is easily the lion the witch and the wardrobe understood - the first thing the browser prompt you before returning the result to the location, whether you agree with the terms of Google the lion the witch and the wardrobe for this service. For Firefox understood it until I followed requests from browsers by extension the lion the witch and the wardrobe TemperData.
And the last possible method to locate is using GeoIP. This is the most accurate method - in the best location would be to the nearest town or neighborhood (if?), Which are a few kilometers to tens of kilometers. And in the worst case GeoIP database can position the user in a different country or continent. For more details on methods of API-it
But back to JavaScript and GeoLocation the lion the witch and the wardrobe API. In the above examples show how broadly the method getCurrentPosition. This method returns the current position of the browser, taking three arguments. The first is the callback function the lion the witch and the wardrobe to execute when you successfully locate and which accepts as a parameter an object describing the location. The second parameter is the callback function to be executed in the event of an error and takes as a parameter an object that describes it. The third parameter that I missed in the example, is the object that passes various settings to the method. Second and third arguments can be omitted.
For quite some time looking for work yourself the lion the witch and the wardrobe on which to try to implement the lion the witch and the wardrobe different NEWT. And as required by good practice, I found the playing field in addressing their own needs. The thing is that since I use Foursquare tried two different apps for Symbian, but both had the same disadvantage - not working without the GPS receiver of the phone to work. The problem is that the GPS receiver of my phone is experiencing great difficulties in finding the lion the witch and the wardrobe the satellites if there is no Internet connection, but I still pull subscriptions, including data channel. So in my case or has GPS (when I'm outside), the lion the witch and the wardrobe or has the Internet (where the place where you are, offering WiFi). So the solution is GeoLocation API
Although not part of the specification of HTML5, GeoLocation API is often mentioned the lion the witch and the wardrobe together with it is a natural part of NEWT. Allows us through little JavaScript to determine the user's location. I opened one a page demonstrating the capabilities of GeoLocation and was amazed at the accuracy - the point on the map was 100-200 meters from home. Enough for my needs.
Let's see how it numbers: if (navigator.geolocation) {navigator.geolocation.getCurrentPosition (function (position) {/ / we have the user's location: position.coord.lat and position.coords.lon}, function (error) {/ / error in determining the location});} else {/ / Browser does not support GeoLocation API}
You can count that will successfully identify the location the lion the witch and the wardrobe of the user as long as it uses a fairly recent version of Firefox, Safari, Chrome or Opera. But for me it is interesting if it works on my cell phone. My parachute opened when I installed Opera Mobile 10.1, and the owners of an iPhone the lion the witch and the wardrobe or Android phone can be localized without the need to install additional software. The only peculiarity is that some devices require Android 2.1 included GPS receiver, although not rely on it (I tried with Globul Q1 SE). How does GeoLocation?
Okay, but how the browser determines the location without GPS, you ask? Browsers use several methods by which determine the location depending on the available GPS and network devices.
Where available GPS, mobile phone browsers can use the data from it to determine with great accuracy the location of the user. This approach works on phones with Android OS and iPhone, but the WebKit browser on my Nokia 5800 does not support GeoLocation API, although the phone has GPS.
When no GPS, or it can not located, the browser used other methods. The first possibility is using information from the GSM network - cells have a known location, and through calculation based on the signal strength of the different cells, the lion the witch and the wardrobe the location can be determined with sufficient accuracy. This is actually one of the functions of A-GPS devices embedded in mobile phones. The other is downloading the almanac with the location of the satellites over the Internet, which speeds up the establishment of the location.
When this method is not available, there is another way to determine the lion the witch and the wardrobe the location with sufficient precision. There are various companies that go around the streets with cars and collect the signal strength of different WiFi networks. Then you can easily reverse the order to establish the location of a device in the list of visible the lion the witch and the wardrobe networks and their power. This is the main method used Opera and Firefox, both browser makes a request to a Google service for this. Opera for this is easily the lion the witch and the wardrobe understood - the first thing the browser prompt you before returning the result to the location, whether you agree with the terms of Google the lion the witch and the wardrobe for this service. For Firefox understood it until I followed requests from browsers by extension the lion the witch and the wardrobe TemperData.
And the last possible method to locate is using GeoIP. This is the most accurate method - in the best location would be to the nearest town or neighborhood (if?), Which are a few kilometers to tens of kilometers. And in the worst case GeoIP database can position the user in a different country or continent. For more details on methods of API-it
But back to JavaScript and GeoLocation the lion the witch and the wardrobe API. In the above examples show how broadly the method getCurrentPosition. This method returns the current position of the browser, taking three arguments. The first is the callback function the lion the witch and the wardrobe to execute when you successfully locate and which accepts as a parameter an object describing the location. The second parameter is the callback function to be executed in the event of an error and takes as a parameter an object that describes it. The third parameter that I missed in the example, is the object that passes various settings to the method. Second and third arguments can be omitted.
No comments:
Post a Comment