location

Getting location of a direction of current location in Android

孤者浪人 提交于 2019-12-12 01:47:46
问题 I want to implement a function that calculates locations' list (longitudes and latitudes) through a direction of my phone. The result can be a rectengular shape which is pointing the corners as locations. First how can i find the device current direction which means which direction the back camera points ? Then how can i obtain a list of location information through this direction ? Thank you 回答1: From the documentation of Google Maps Android API, the location data available to an Android

How to get gps Location with an iPod Touch (4th gen)

人走茶凉 提交于 2019-12-12 01:33:35
问题 I guess the answer has already been posted, but I am a lazzy boy :p . Seriously I am working on an iPhone Application which have to blit a map and use the current user gps location to locate the user on the map. The problem is that with iPhone (v1), and all iPod version there is no gps device, so is it possible to get the current gps location of the user (using google map api, with internet ... or something else) ? I would like to know the current gps user location without user gps device

Swift fit annotations

三世轮回 提交于 2019-12-12 01:27:05
问题 I have a few locations in parse which I'm query-ing. It shows all annotations but it only zoom the last one. How can I find max and min latitudes and longitudes and make them fit ? There is plenty of these on stackoverflow but they're almost all in objective-c. 回答1: The examples in Objective-C are still essentially valid since the underlying SDK/API is still the same -- just being called using a different language (and there's always the documentation). To show all annotations, there are

Getting Location Updates frequently in Service

北城余情 提交于 2019-12-12 01:03:48
问题 I am developing an android app, Getting location updates frequently by service. My code is this MainActivity.java import android.app.Activity; import android.content.Intent; import android.location.LocationManager; import android.os.Bundle; import android.provider.Settings; import android.view.Menu; import android.view.View; import android.widget.CompoundButton; import android.widget.Switch; public class MainActivity extends Activity implements CompoundButton.OnCheckedChangeListener{

distanceTo(map.getMyLoctation() ) returns null

家住魔仙堡 提交于 2019-12-12 00:45:46
问题 I am new to android and I am using Location manager associated with LocationListener and google maps API v2 and I am trying to get the distance between user''s current Location and another location , but I always get null pointer on map.getMyLocation() . here is my code : LocationManager locManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); MyLocationListener locListener = new MyLocationListener(this); jager =(Button)findViewById(R.id.button1); rotebuhlplatz =(Button

Location Services not working in iOS 8

拜拜、爱过 提交于 2019-12-12 00:35:03
问题 My app that worked fine on iOS 7 doesn't work with the iOS 8 SDK. CLLocationManager doesn't return a location, and I don't see my app under Settings -> Location Services either. I did a Google search on the issue, but nothing came up. What could be wrong? 回答1: I ended up solving my own problem. Apparently in iOS 8 SDK, requestAlwaysAuthorization (for background location) or requestWhenInUseAuthorization (location only when foreground) call on CLLocationManager is needed before starting

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

Fastest Way to Find Distance Between Two Lat/Long Points

淺唱寂寞╮ 提交于 2019-12-12 00:15:57
问题 I currently have just under a million locations in a mysql database all with longitude and latitude information. I am trying to find the distance between one point and many other points via a query. It's not as fast as I want it to be especially with 100+ hits a second. Is there a faster query or possibly a faster system other than mysql for this? I'm using this query: SELECT name, ( 3959 * acos( cos( radians(42.290763) ) * cos( radians( locations.lat ) ) * cos( radians(locations.lng) -

CLLocationManager startUpdatingLocation() doesn't work when called in background

旧街凉风 提交于 2019-12-11 23:57:22
问题 I have a particular use case where I want to be able to start location updates when the app is already in the background. Specifically, I want to be able to press a button on my Pebble watchapp, and that causes my companion iOS app to begin location updates. I am able to successfully start the location updates from my Pebble only if the iOS app is either in the foreground or has just entered the background within the past few seconds (like 5?). After a few seconds has passed with the app in

Mark a location by location google maps v3

我的未来我决定 提交于 2019-12-11 22:46:42
问题 I want to provide a feature like user will provide a city,state and country. Then my aim is to mark the location provided by the user on the google maps. My code is: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)"> <meta name="dcterms.created" content="Tue, 08 Jan 2013 05:31:17 GMT"> <meta name="description" content=""> <meta name="keywords" content=""> <title></title> <?php // get and breakdown the