geolocation

HTML5 Geolocation 定位服务 实例

烈酒焚心 提交于 2019-12-07 09:11:05
本例采用html5 Geolocation 定位服务 和 google maps api 3 完成,运行时请确保你的浏览器支持 html5. <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.7&sensor=false"> </script> <script type="text/javascript"> function initialize(position) { var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); // position.coords.latitude 经度 //

mysql update geo point

人走茶凉 提交于 2019-12-07 07:50:51
问题 I have a MySQL table with latitude and longitude values. I want to play around with the spatial stuff in MySQL 5, just to see how it works. However, I'm having a real problem just getting the point data created from existing values. I was trying something like this, but it fails with syntax errors in every format I've tried. Can someone point out the right way to do this? UPDATE locationtable a SET geopoint = GeomFromText( POINT() a.latitude a.longitude ) WHERE 1 I've also tried other

Effective ip->location query

倖福魔咒の 提交于 2019-12-07 06:22:56
问题 I have two tables: one is ip_group_city from ipinfodb.com containing ip_start numbers for determining location of IPs, and other is "visits" with information about web site visitor containing column 'ip'. I need to select top 10 region_code (from ip_group_city) by checking region_code for each IP from "visits" table. Right now I'm loading all IPs from "visits" into an array and using that IP info to query the ip_group_city by: SELECT region_code FROM ip_group_city WHERE ip_start <= INET_ATON

Maximum length of a decimal latitude/longitude Degree?

会有一股神秘感。 提交于 2019-12-07 06:08:57
问题 What is the maximum length (in kilometers or miles - but please specify) that one degree of latitude and longitude can have in the Earth surface? I'm not sure if I'm being clear enough, let me rephrase that. The Earth is not a perfect circle, as we all know, and a change of 1.0 in the latitude / longitude on the equator (or in Ecuador) can mean one distance while the same change at the poles can mean another completely different distance. I'm trying to shrink down the number of results

Calculate distance between my location and a MapKit pin on Swift

泪湿孤枕 提交于 2019-12-07 06:04:41
问题 I need your help, I'm working on an App where I have some pins (locations) and what I want is to get the distance between each one and my location. My code is the following let annotation = MKPointAnnotation() let annotationTwo = MKPointAnnotation() let saintPaulHospitalBC = MKPointAnnotation() override func viewDidLoad() { super.viewDidLoad() mapita.showsUserLocation = true // Mapita is the name of the MapView. annotation.coordinate = CLLocationCoordinate2D(latitude: 25.647399800, longitude:

OrientDB geolocation

落花浮王杯 提交于 2019-12-07 05:59:49
问题 I´m using the OrientDB for NoSQL database, and i dont know how to query in geolocation exactly. I´ve read the specific documentation: OrientDB Functions but does not understand the significance of the values. The distance function: distance() - Computes the distance between two points in the globe using the Haversine algorithm. Coordinates must be as degrees Example: where distance(x, y,52.20472, 0.14056) <= 30 Two questions: What is the X, Y, and the 30 values? Are the values (52.20472, 0

How to set correct Lat and Lng based on current location

为君一笑 提交于 2019-12-07 05:49:42
问题 My goal is to do autocomplete prediction using Google Places API, and now I want to make some kind algorithm that will take current location lat and lng, and make a prediction of places only in 100-200 km diameter. So, at this moment I get user's current location lat and lng, how to set 100-200 km? private void getCurrentLocation() { mLastLocation = LocationServices.FusedLocationApi .getLastLocation(mGoogleApiClient); if (mLastLocation != null) { double latitude = mLastLocation.getLatitude();

Restricting website access by country

ε祈祈猫儿з 提交于 2019-12-07 05:22:29
问题 I am hosting my website using AWS. The website is on 2 ec2 instances, with a load balancer (ELB) balancing traffic between them. Currently, I am using my DNS (Route 53) to restrict the access to the website by using Route 53's geolocation routing: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-geo (The geolocation restriction is just to limit the initial release of my website. It is not for security reasons. Meaning the restriction just needs to

Determine if a point is inside a triangle formed by 3 points with given latitude/longitude

你离开我真会死。 提交于 2019-12-07 03:33:55
问题 I have 3 points ( lat , lon ) that form a triangle.How can i find if a point is inside this triangle? 回答1: The main question is whether you can use a 2D approximation for this (in other words, is your triangle small enough). If so, something simple like barycentric coordinates will work well. 回答2: Java Code for just triangle , that is 3 points. public static boolean pntInTriangle(double px, double py, double x1, double y1, double x2, double y2, double x3, double y3) { double o1 =

Custom message for geolocation

佐手、 提交于 2019-12-07 02:53:32
问题 I am looking for a way in which i can display a custom message when the geolocation script asks for the user to either allow or deny access to their location. At the moment it displays a message asking weather the user wants to allow or deny access to their location. Instead of it saying the default "Allow website.com to access your location" I want to be able to change it to my own text such as "Allow location access to display better results". I will look forward to your responses. 回答1: