location

How to call functions on the stage in JavaFX's controller file

穿精又带淫゛_ 提交于 2019-11-30 12:43:09
I am using javafx along with fxml , so I use the controller for the real coding . I need to do a few operations on the stage, such as getting its x- or y-axis position. I have tried stage.getX() & stage.getY , but they don't work(the stage name is high-lited as the error). How do I use such functions in my controller? I tried doing this in my main file: public int locationX = stage.getX(); and public double locationX = stage.getX(); But it doesn't work, instead makes the whole program one big error. So how do I get to do such functions in my controller file? Do I need to import something or do

Finding City and Zip Code for a Location

删除回忆录丶 提交于 2019-11-30 12:36:37
问题 Given a latitude and longitude, what is the easiest way to find the name of the city and the US zip code of that location. (This is similar to https://stackoverflow.com/questions/23572/latitude-longitude-database, except I want to convert in the opposite direction.) Related question: Get street address at lat/long pair 回答1: This is the web service to call. http://developer.yahoo.com/search/local/V2/localSearch.html This site has ok web services, but not exactly what you're asking for here.

Change Location Mode to High Accuracy Programmatically Android

♀尐吖头ヾ 提交于 2019-11-30 12:30:50
问题 Is it possible to get the information on the location mode which the user has selected among the three modes under the location settings options i.e 1.Hight Accuracy 2.Battery Saving 3.GPS Only I want to programmatically check if user has selected High Accuracy mode if not then enable it automatically. Is it possible ? Please advice. 回答1: It is possible to get the device's current location mode since API level 19 (Kitkat) : public int getLocationMode(Context context) { return Settings.Secure

CakePHP query closest latitude longitude from database

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 12:21:34
In a CakePHP (v3) application, how can I retrieve the closest results based on passed lat lng values? I'd like to have them back as native CakePHP entities, so something like this: public function closest($lat, $lng) { $sightings = //records within given lat lng $this->set(compact('sightings')); $this->set('_serialize', ['sightings']); } I know this SQL works: SELECT *, ( 3959 * acos( cos( radians(50.7) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(-1.8) ) + sin( radians(50.7) ) * sin( radians( latitude ) ) ) ) AS distance FROM sightings HAVING distance < 10 ORDER BY

Android : Location.distanceTo not working correctly?

不想你离开。 提交于 2019-11-30 11:44:15
I am having an issue calculating distance using the Location.distanceTo method. private class MyLocationOverlay1 extends MyLocationOverlay { @Override public void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) super.drawMyLocation(canvas,mapView,lastFix,myLocation,when); Location bLocation = new Location("reverseGeocoded"); bLocation.setLatitude(FindList.gpslat); // Value = 3.294391E7 bLocation.setLongitude(FindList.gpslong); // Value = -9.6564615E7 Location aLocation = new Location("reverseGeocoded"); aLocation.setLatitude(myLocation

How to get speed in android app using Location or accelerometer or some other way

丶灬走出姿态 提交于 2019-11-30 11:41:19
问题 I am working on app and try to get the speed and distance travelled by the user. I have used Google Play services location class to get the speed but it always returns me 0.0 value and not at all reliable. I wan accurate speed and distance travelled at real time. I have installed GPS Speedometer app on my device and its so perfect that even if i am walking then it gives me the speed. I want to get the same thing. I am confused in how to get speed, using location or using accelerometer or is

Order Facebook Places results by distance

故事扮演 提交于 2019-11-30 11:33:25
Does anyone know how to order Facebook places by distance from a search location? Note that I don't want to order results in my client app. I want the Facebook server to provide me with ordered results to facilitate pagination. I always want to append places from subsequent queries to the end of my array. This does not seem possible using the graph API query such as: https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000& .... because there is no way to tell Facebook to order the results. The nearest place may be last in the list of returned results. I have

Finding Location : Google Play Location Service or Android platform location APIs

霸气de小男生 提交于 2019-11-30 11:11:14
问题 i am trying to get the users location for my new navigation app. i want to check the users location frequently and it has to be accurate . I use the following code from sample to get the location . public class MainActivity extends Activity implements LocationListener { private LocationManager locationManager; private String provider; private TextView a; private TextView b; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

android: how to fix gps with mock(fake) coordinates?

送分小仙女□ 提交于 2019-11-30 11:10:45
问题 I'm trying to fix GPS programmatically when the GPS signal is not available. I want to do this in order to provide mock coordinates to other apps like google maps and others. I tried to use GPS_PROVIDER and NETWORK_PROVIDER but only with the latter I can get a new location valid for google maps. But this works only the first tima and if I want to re-fix more mock locations google maps doesn't see any change... why?? I have to do a service for what I want to do? public void setLocation(double

Change window location Jquery

人走茶凉 提交于 2019-11-30 11:05:13
I am using ajax to load my website content and want to update the window location when ajax is successful. How can I update the window location to "/newpage"?? I need users to be able to go back and to refresh. Is this possible?? I'm assuming you're using jquery to make the AJAX call so you can do this pretty easily by putting the redirect in the success like so: $.ajax({ url: 'ajax_location.html', success: function(data) { //this is the redirect document.location.href='/newpage/'; } }); You can set the value of document.location.href for this purpose. It points to the current URL. jQuery is