geolocation

Geolocation not working in safari

允我心安 提交于 2019-12-24 10:39:29
问题 Im trying to implement the geolocation services to get the latitude and longitude values, but in Safari it just doesnt work. And then in firefox it works, but it doesnt know how to handle errors. I have no idea why. Below is my code. <!DOCTYPE html> <html lang="en"> <head> <title>GPS</title> </head> <body> <strong>Output:</strong> <input type="text" id = "mapLink" value=""> <script type = "text/javascript"> navigator.geolocation.getCurrentPosition(showMap, handle_error); function showMap

How to use a Point or Geometry type in Datamapper (codeigniter)

纵然是瞬间 提交于 2019-12-24 10:27:34
问题 I'm using codeigniter and datamapper to build an API service (on mysql), and part of it involves geolocation - however I can't seem to find a workaround to use the point datatype. If I try to insert GeomFromText, the system treats it as a string. Can anyone help? Cheers, Mark. 回答1: Try CREATE TABLE Points ( ID INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, location POINT NOT NULL, SPATIAL INDEX(location) ) ENGINE= MYISAM In CodeIgniter: $this->db->set("location",'geomfromtext("POINT(30.2 40.3)"

need pointer on GeoPtProperty in app-engine/django forms

帅比萌擦擦* 提交于 2019-12-24 10:27:10
问题 I'm not looking for a bug fix so much as an approach. I'm a newbie with a simple model: classLocation(db.Model): name = db.StringProperty() geoPt = db.GeoPtProperty() ... I use that to make a simple form: class LocationForm(djangoforms.ModelForm): class Meta: model = Location When it renders out, the GeoPt is a single text field. For this form I'd prefer latitude and longitude fields, with validation. Which way to go? Is this a common problem with "complex objects" in django forms? If so, is

Google Maps API GeoLocation not working for mobile

我与影子孤独终老i 提交于 2019-12-24 10:19:55
问题 I'm not really sure why the GeoLocation works on my PC, but not my iPhone ... I've got sensor=true within the script call to the API, but apart from that, I'm at a loss. Here's the entire script: <div id="info"></div> <div id="map_canvas" style="width:908px; height:420px"></div> <input type="text" id="addressInput" size="10"/> <select id="radiusSelect"> <option value="5" selected>5mi</option> <option value="15" selected>15mi</option> <option value="25" selected>25mi</option> <option value=

MS Bot Framework, how to geolocate user on Skype

蓝咒 提交于 2019-12-24 08:28:59
问题 Is there any way to get the location of the Skype user with his/her consent ? In the samples there is an example of EchoLocation Dialog for Facebook messenger. Is something like that possible in Skype? The would ask the user to send the location, this would not happen without consent. Getting the user's IP address would be enough too, I could work out the location from it. 回答1: As of yet, Skype does not yet support sending of location. 回答2: Skype does not let you do that as of now due to

Android: How to find out location provider name from KEY_STATUS_CHANGED broadcast intent sent by LocationManager?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 08:24:04
问题 I try work with NETWORK and GPS location provider simultaneously. In main activity I register location update request for each available provider: for (String provider : m_lm.getProviders(false)) { Intent intent = new Intent(GpsMain.this, GpsTestReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(GpsMain.this,0, intent, 0); m_lm.requestLocationUpdates(provider, 60000, 10, pi); } In my BroadcastReceiver (GpsTestReceiver) do incoming Intent handling: @Override public void onReceive

Leaflet .locate watch option breaks .locate after changing tab Ionic 3

陌路散爱 提交于 2019-12-24 07:25:27
问题 I have one function called loadmap(){} where im creating map.Im loading this function with ionViewDidEnter() { this.loadmap(); } Inside loadmap i have this.map = leaflet.map("map").fitWorld(); thats how i initialize map This is how i remove map when user changes tab. ionViewDidLeave(){ this.map.remove(); } This is my .locate function: var usermarker; this.map.locate({ setView: true, maxZoom: 120, watch:true, enableHighAccuracy:true }).on("locationfound", e => { if (!usermarker) { usermarker =

Getting States and Provinces in .NET

寵の児 提交于 2019-12-24 05:52:40
问题 The following web service will give me all countries. I want to get all states and provinces. How can I do this? http://ws.geonames.org/countryInfo It seems the only way is to register for an API username here http://www.geonames.org/export/web-services.html and then try to make a call to something like http://api.geonames.org/postalCodeSearch?country=COUNTRY_CODE&username=demo where COUNTRY_CODE is a variable I would have to populate by looping through each country. Is there an easier/

Select first and last match by column from a timestamp-ordered table in MySQL

给你一囗甜甜゛ 提交于 2019-12-24 05:45:28
问题 Stackoverflow, I need your help! Say I have a table in MySQL that looks something like this: ------------------------------------------------- OWNER_ID | ENTRY_ID | VEHICLE | TIME | LOCATION ------------------------------------------------- 1|1|123456|2016-01-01 00:00:00|A 1|2|123456|2016-01-01 00:01:00|B 1|3|123456|2016-01-01 00:02:00|C 1|4|123456|2016-01-01 00:03:00|C 1|5|123456|2016-01-01 00:04:00|B 1|6|123456|2016-01-01 00:05:00|A 1|7|123456|2016-01-01 00:06:00|A ... 1|999|123456|2016-01

why the html5 geolocation fails to get results?

久未见 提交于 2019-12-24 05:26:08
问题 On what basis does HTML 5 geolocation work ? Does it guess the location on the basis of IP address ? I guess it doesn't need a GPS enabled device ? I do not have GPS on my laptop. I have been trying to test my location using HTML5 geolocation on w3schools geolocation tester/demo and html5demos but I either get location information unavailable or failed . What could be the reason for this ? Note : I am connected to internet via USB Tethering. 回答1: How exactly the browser does geolocation is up