geolocation

LatLng and distance between returning incorrect values on newer phones

佐手、 提交于 2019-12-12 02:06:42
问题 My app works great on my old HTC One M7 in terms of calculating distance. However, on my wife's HTC One M8 and on my new Sony Xperia Z3, the distance it calculates is off. It's telling me that I've gone further than I really have. I've noticed this more when I'm hiking or running. If I'm skiing, it seems to be more accurate. I'm guessing that speed has something to do with it (if I'm going faster, the calculations are more accurate). I'm calling a method to update my total distance on every

Geolocation Simulation Debug Dropdown in Xcode 4

只愿长相守 提交于 2019-12-12 01:59:34
问题 There is supposedly a dropdown that lets you simulate several different geolocational coordinates in Xcode4 at runtime, feeding straight to the simulator... Where is this menu / how do you access it? 回答1: You will find this menu under Debug in the iOS Simulator. 来源: https://stackoverflow.com/questions/6774814/geolocation-simulation-debug-dropdown-in-xcode-4

Adding custom icon and marker data together using Mapbox

对着背影说爱祢 提交于 2019-12-12 01:59:30
问题 I am new to mapbox and I have a simple question. I have made a feature layer and a list of custom icons. How do I add the two together? My feature layer is formatted as below: L.mapbox.featureLayer({ "type": "Feature", "geometry": { "coordinates": [ '.$long.','.$lat.' ], "type": "Point" }, "properties": { "title": "'.$business_name.'", "description": "'.$address_1.', '.$address_2.', '.$address_3 .', '.$postcode .'" } }).addTo(map); And example of my custom marker is below var accomodation = L

How to use Google Location service API to get location updates even in background?

非 Y 不嫁゛ 提交于 2019-12-12 01:45:33
问题 First of all this is not a duplicate of any other question on the site. I've seen location updates using Service and Google API both. Here is the link which uses the service to get location updates This is the link which uses Google API for the same. This works perfectly. I've tried both, but in case of service, it is not working. But the 1st link's code is working perfectly fine, and gives location updates correctly. But I think It can't get update when the app is in background. I want that

PhoneGap geolocator using WiFi instead of GPS

牧云@^-^@ 提交于 2019-12-12 01:28:05
问题 I am trying to implement geolocation on a PhoneGap App running on Android. For some reason the locator only returns accurate distances when connected WiFi (i.e. it prefers coarse over fine). My GPS is of course enabled. Note that at one point the app tried using GPS (I saw the locator blinker come up) but it kept timing out; upon restarting the device, it went back to only using WiFi. Attached is my code: function testGeo(){ navigator.geolocation.getCurrentPosition(function(position){ $('

Getting longitude and latitude values faster

非 Y 不嫁゛ 提交于 2019-12-12 01:16:22
问题 I am developing an application in android and I want to get the latitude and longitude of the android mobile. My code for getting latitude and longitude is giving values after some time. And sometimes, it doesn't give values at all. Can anyone help me what can be done! 回答1: You need to add this code for getting te current location. make sure you give all the permissions Location Manager location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if(location!=null) {

How to show location on a map taking longitude and latitude values from XML [duplicate]

戏子无情 提交于 2019-12-12 00:43:29
问题 This question already has answers here : multiple markers on google maps from xml file (2 answers) Closed 4 years ago . This is an XML entry and it takes geolocation from PHP form. I want to display those values as a map in HTML: <entries> <entry> <name>Anny</name> <email>anny1@hotmail.com</email> <place>Fridays</place> <comment>Very Good</comment> <food>Jack Daniels Burger</food> <kitchen>American</kitchen> <rating>5</rating> <latitude>34.7618259</latitude> <longitude>33.0283905</longitude>

Javascript GeoLocation is not working on Chrome

China☆狼群 提交于 2019-12-12 00:36:45
问题 I'm trying to take the geolocation of the User and then do a query. In Mozilla Firefox it works fine also in Safari.... but in Chrome it doesnt work at all. window.onload = function(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(function(position){ var latitude = position.coords.latitude, longitude = position.coords.longitude; console.log(latitude + " " + longitude); },handleError); function handleError(error){ //Handle Errors switch(error.code) { case error.PERMISSION

Android lastKnownLocation returns null

自作多情 提交于 2019-12-12 00:29:26
问题 I've got this problem I don't see anything wrong in the code but getLastKnownLocation returns null every time . any ideas ? public class LocationDemo2Activity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); EditText et1 = (EditText) findViewById(R.id.editText1); LocationManager manager = (LocationManager) this.getSystemService(Context.LOCATION

SQL query to pull locations based on distance from lat/lng, in LINQ2SQL?

帅比萌擦擦* 提交于 2019-12-11 23:39:45
问题 I want to perform a query (to pull locations within a given distance from a specified lat/lng) against a MS SQL 2008 Server, no geo field types: SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20; This is the haversine formula described here. I'd like to call the query, probably setup as a stored procedure,