location

Google Maps API: Getting coordinates of current location iOS

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 20:16:06
问题 I am currently working with Google Maps API in my project. I am trying to set the default camera/zoom to the users location. I do this: @implementation ViewController{ GMSMapView *mapView_; } @synthesize currentLatitude,currentLongitude; - (void)viewDidLoad { [super viewDidLoad]; mapView_.settings.myLocationButton = YES; mapView_.myLocationEnabled = YES; } - (void)loadView{ CLLocation *myLocation = mapView_.myLocation; GMSMarker *marker = [[GMSMarker alloc] init]; marker.position =

How to find the gps in the android device is correctly working or not?

二次信任 提交于 2019-12-04 19:57:00
I'm developing an android application for mobiles and tablets. I'm using android version 2.2 , API 8. In my application, I want to capture the location co-ordinates via gps and send to server. It's working fine . When I working in my office (near to my office) the gps - co-ordinates captured correctly in android devices But in only one device the co-ordinates captured wrongly. I'm in Alwarpet,chennai,india .But, I run that device it shows " Andra pradesh" or bay of "bengal ".But all other device shows correct location. I think there is a fault in device. But I'm not sure. How to find the gps

How to plot a GPS location on an image being used as a map?

笑着哭i 提交于 2019-12-04 19:41:39
I have images of malls that I need to use as maps for an app I am making. I have the GPS lat/long of the bottom corners of the map and I figured out the distance from the bottom GPS coordinates to what would be the top of the map image. How ever these are not straight up and down linear maps meaning I can't just plot my lat and long all nice and neat. I've tried using various formulas and I'm so close but I can't plot the top lat and long of the top left and right of the map. So far this is what I have: double distanceFromLeftToRightGPS = bottomLeft.distanceTo(bottomRight); double

Android emulator, Finding mock user location coordinates. Having problems

百般思念 提交于 2019-12-04 19:14:39
Hey guys, I'm having trouble trying to find the user's longitude and location as I run my program and set the telnet command for geo fix for the mock location. While the emulator is running, I set the mock coordinates only for the emulator to become unresponsive and have my program fail in detecting the input coordinates. import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.location.LocationProvider; import android.os.Bundle; import android.widget.TextView

Android FusedLocationProviderApi: Incoming intent has no LocationResult or LocationAvailability

不想你离开。 提交于 2019-12-04 18:29:52
问题 I am trying to subscribe to location updates via Google's FusedLocationProviderApi. I want to receive updates in the background, so that I will receive updates even if the app is killed. Following the online documentation as best as I can, I've written the following code. Note: this is being done in an intent service, not on the UI thread, which is why I'm using blocking connect/result methods. private void startLocationServices(String deviceId, int pollingInterval) { Log.i(TAG, "Starting

Codename one GPS provider and current location

十年热恋 提交于 2019-12-04 18:27:39
I am working on an iOS app with codename one . I want to get the current location and send it by SMS. I got this code from Java Android Studio, I don't know how to get the current location and also check if GPS is turned on. I tried below, but without success (I'm not sure how they start the GPS and get the location) LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); boolean enabledGPS = service.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!enabledGPS) { //alert GPS is off } LocationManager locationManager = (LocationManager) getSystemService(Context

Why onActivityResult always return 0, even if ok button is pressed?

好久不见. 提交于 2019-12-04 18:18:58
问题 I want to implement a dialog that ask users to decide if want to turn on location wifi and gps, but onActivityResult it's always return 0 ,even if ok button is pressed, more detail: when wifi and gps are off ,return 0, but both are properly activated (ok button pressed). when gps it is on and wifi it off, return 0 ,but wifi it properly activated (ok button pressed). only when wifi it is on ,and gps it is off, return -1 ,but gps it properly activated (ok button pressed). here my code: public

Return Nearest Place available to Users location using Latitude-Longitude?

↘锁芯ラ 提交于 2019-12-04 18:05:23
I want to implement Nearest Place available to User algorithm in Java or MySQL. I have Stations table in MySQL database which has around 100K records of Stations with Latitude and Longitude . If User gives his latitude and longitude as x and y, then I want to return nearest stations available from User's location. So please suggest me any algorithm available in Java or MySQL . I tried with the following query, but it seems slower in performance - SELECT *,3956*2*ASIN(SQRT(POWER(SIN((user_lat-abs(st.station_lat))*pi()/180/2 ), 2) + COS(user_lat*pi()/180)*COS(abs(st.station_lat) *pi()/180)*POWER

Parse Json array from google maps api in Java

北城余情 提交于 2019-12-04 17:54:23
I get this json array https://maps.googleapis.com/maps/api/geocode/json?address=10115,germany from the Google Maps api. Now I want to parse it in Java and get from the part "location" the "lat" and "lng" but I don´t know how to get it. Here is the code - import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.json.simple.JSONArray;

Why is geosearching/location based searches returning zero results?

徘徊边缘 提交于 2019-12-04 17:48:29
I am trying to use app engine's search API to search locations: https://developers.google.com/appengine/docs/python/search/overview#Performing_Location-Based_Searches The problem is no matter what I do, I get zero results. I set the search lat/lng as the the exact point on a document's GeoPoint property and it still returns zero. I know the regular search is working because if I change the query to be a regular full-text search, it works. Here is an example of my data (this is actually from the example app here: http://www.youtube.com/watch?v=cE6gb5pqr1k ) Full Text Search > stores1 Document