geolocation

How to base64 encode inside of javascript

房东的猫 提交于 2019-11-28 04:33:53
I am trying to implement a simple script on a site that will return base64 encoded information from google's ajax API. This is what I am playing with so far: <html> <head> <script src="http://www.google.com/jsapi?key=ABQIAAAA0duujonFsEX871htGWZBHRS76H0qhS7Lb-D1Gd0Mnaiuid8Z7BQIyz2kMpojKizoyiCQA4yRkKAKug" type="text/javascript"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> jQuery(document).ready(function() { var location = 'Unable to determine your location.'; if (google.loader

Android - How to get estimated drive time from one place to another?

不羁的心 提交于 2019-11-28 04:25:47
I need to find the estimate drive time from one place to another. I've got latitudes and longitudes for both places but I have no idea how to do that. Is there is any API for that. help thanks. yes you get the time and distance value as well as many like direction details in driving, walking etc mode. all you got from the google direction api service check our this links http://code.google.com/apis/maps/documentation/directions/ Yaqub Ahmad Location location1 = new Location(""); location1.setLatitude(lat); location1.setLongitude(long); Location location2 = new Location(""); location2

Is there an easy way to determine which hemisphere a user is in?

本秂侑毒 提交于 2019-11-28 04:17:00
问题 I'm working on a project which includes seasonal content, and we're thinking of determining the user's location to work out what season it is for them. The obvious way of doing this is to Geo-locate their IP, then grab the latitude. > 0 is Northern hemisphere, and < 0 is Southern. I'm happy to go that way - though it seems a bit of a waste to pinpoint an IP to an exact location, just to determine which half of the planet they're on - but I thought I'd throw it out there in case anyone has any

Google's Geocoder returns wrong country, ignoring the region hint

我怕爱的太早我们不能终老 提交于 2019-11-28 04:08:53
I'm using Google's Geocoder to find lat lng coordinates for a given address. var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }); address variable is taken from an input field. I want to search locations only in UK . I thought that specifying 'region': 'uk' should be enough but it's not. When I type in "Boston" it's finding Boston in US and I wanted the one in UK. How to restrict Geocoder

How to get visitor location ( country, state and city ) using ASP.NET

 ̄綄美尐妖づ 提交于 2019-11-28 03:52:10
I want to implement this in ASP.NET. I don't have any idea about how to do so, unfortunately. Michael B. Here how it is done in asp.net Request.ServerVariables("REMOTE_ADDR") Get a copy of IP adress database by location here http://www.maxmind.com/ Shoban Why not use Google Analytics ? You will get more than what you need. Alternatively you can get the client's ip and use service like ip2location to get the location. Check this similar question as well. finding clients location in asp.net page. There are a few free web services out there which provide IP-to-location services. For instance:

How to determine if an IP address belongs to a country

删除回忆录丶 提交于 2019-11-28 03:51:54
How would i determine the country that a spcific IP address is originating from using c#. I need to use this to check if connections originate from a specific country. You can use this SQL data in your project to determine that: IP address geolocation SQL database . Download that data and import it into your database to run checks locally. Or you can use their free API that returns XML containing the country code and country name. You'd make a request to the following URL with the IP address you wanted to check, as seen in this example: http://ipinfodb.com/ip_query_country.php?ip=74.125.45.100

How can I use HTML5 geolocation in angularjs

≯℡__Kan透↙ 提交于 2019-11-28 03:50:23
How can I use HTML5 geolocation in angularjs? I can get it using HTML5; but how can I pass it to angularjs scope in controller? any sample jsfiddle will save my day! you can do something myApp.controller('fooCtrl', function($scope){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position){ $scope.$apply(function(){ $scope.position = position; }); }); } }) you need to do $scope.$apply to trigger the digest cycle when the geolocation arrives and to update all the watchers. I'd suggest abstracting this into a service so your controller doesn't have a dependency on

iOS 6 breaks GeoLocation in webapps (apple-mobile-web-app-capable)

烂漫一生 提交于 2019-11-28 03:35:54
I have an app that does a simple textbook navigator.geoLocation.watchPosition(...) that works great in iOS 5.x both in Safari and as a web app (using apple-mobile-web-app-capable meta tag). However, in iOS6, GeoLocation does not work in the webapp. It still works in safari as expected, but when I run the webapp, it prompts me for location permission, then silently fails. I see the location icon, but no events are thrown from watchLocation. I get no error events or any location events. Has anyone run into this? Any workarounds? It's definitely iOS6 specific and also specific to the apple-mobile

IllegalArgumentException thrown by requestLocationUpdate()

懵懂的女人 提交于 2019-11-28 03:15:06
问题 We recently tested our application against android API level 14 and 15. We started development targeting minimal SKD Version 8 and excluding tablets (3.x). With 2.x everything works well but when running the app on a 4.x droid it crashes at the point we're obtaining user's location. FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create service java.lang.IllegalArgumentException: provider=network at android.app.ActivityThread.handleCreateService(ActivityThread.java:2263) at

Detecting whether a GPS coordinate falls within a polygon on a map

蹲街弑〆低调 提交于 2019-11-28 03:04:40
As stated in the title, the goal is to have a way for detecting whether a given GPS coordinate falls inside a polygon or not. The polygon itself can be either convex or concave. It's defined as a set of edge vectors and a known point within that polygon. Each edge vector is further defined by four coordinates which are the latitudes and longitudes of respective tip points and a bearing relative to the starting point. There are a couple of questions similar to this one here on StackOverflow but they describe the solution only in general terms and for a 2D plane, whereas I am looking for an