currentlocation

How to show current location of user while open my app

寵の児 提交于 2019-12-11 07:01:10
问题 I want to make an app, when user open my app user will get their current location in my app and while user change their location it will also update after some specific time. I got solution of changed location while user change their location but i need to show current location of user while user open my app . 回答1: googleMap.setMyLocationEnabled(true); Location myLocation = googleMap.getMyLocation(); These are the the key lines to get current location. for more info ,refer these tutorials:

myLocationEnabled changing to isMyLocationEnabled on swift when using GoogleMaps

 ̄綄美尐妖づ 提交于 2019-12-11 05:23:22
问题 Im trying to get a users current location to show with google maps API. I have been struggling with this issue for weeks and the code runs but doesn't update to current location when I change the location in the simulator. My code is below and after looking how other people are doing it they all have mapView.myLocationEnabled = true whereas for me this produces an error saying 'myLocationEnabled has been renamed to 'isMylocationEnabled'. I've seen some up to date posts (from 2 months ago) and

android-How to check location is in special area?

和自甴很熟 提交于 2019-12-08 03:30:47
问题 I want to use google map in my android app in specific area. for example in special country. How can I check that my current location is in that place? updates: for example how to check that I am in New Delhi city 回答1: You can try using LatLngBounds and LatLngBounds.contains() private LatLngBounds NewDelhi = new LatLngBounds(your special area SE LatLng , NE LatLng ); if(NewDelhi.contains(your location LatLng)) //Do something 回答2: Get city name from Location: Geocoder geocoder = new Geocoder

setting canShowCallOut = NO for current location annotation, iPhone

谁都会走 提交于 2019-12-06 17:36:50
问题 I am using custom call out (title and subtitle)for Current location icon. I tried following to disable default annotation but it does not work. - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation { NSLog(@"viewForAnnotation"); if ([annotation isKindOfClass:[MKUserLocation class]]) { MKAnnotationView *userLocationView = [mapView viewForAnnotation:annotation]; userLocationView.canShowCallout = NO; NSLog(@"[annotation isKindOfClass:[MKUserLocation

How to fetch current location in appdelegate using swift

陌路散爱 提交于 2019-12-06 14:58:46
问题 Hi am developing a app using swift i want to fetch current location of the user when app launches so i written my code in app delegate i have include all the functions and methods i.e.. added and imported frameworks core location and also updated plist but i cant able to fetch current location code in my app delegate: import UIKit import CoreLocation import MapKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate,CLLocationManagerDelegate { var

setting canShowCallOut = NO for current location annotation, iPhone

一世执手 提交于 2019-12-04 23:20:14
I am using custom call out (title and subtitle)for Current location icon. I tried following to disable default annotation but it does not work. - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation { NSLog(@"viewForAnnotation"); if ([annotation isKindOfClass:[MKUserLocation class]]) { MKAnnotationView *userLocationView = [mapView viewForAnnotation:annotation]; userLocationView.canShowCallout = NO; NSLog(@"[annotation isKindOfClass:[MKUserLocation class]"); return nil; } } Only way it works is -(void)mapView:(MKMapView *)mapView

How to fetch current location in appdelegate using swift

余生长醉 提交于 2019-12-04 21:11:42
Hi am developing a app using swift i want to fetch current location of the user when app launches so i written my code in app delegate i have include all the functions and methods i.e.. added and imported frameworks core location and also updated plist but i cant able to fetch current location code in my app delegate: import UIKit import CoreLocation import MapKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate,CLLocationManagerDelegate { var locationManager:CLLocationManager! var window: UIWindow? var centerContainer: MMDrawerController? private var

Get accurate current location from Network Provider

早过忘川 提交于 2019-12-03 07:52:49
问题 I use the following code to get Current Location from a Network provider in my application: LocationManager mgr = (LocationManager) getSystemService(LOCATION_SERVICE); boolean network_enabled = mgr.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if(network_enabled){ Location location = mgr.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); But it gives a location approximately 300-700 meters away from my actual location. This is expected from a Network provider. But the problem is:

How to change location of my location button in google maps using swift

时光怂恿深爱的人放手 提交于 2019-12-03 05:08:41
I am using google maps in my project i want to show my location button a bit up how should i do that using swift You can change the position of the MapControls by set the padding for your map view . let mapView = GMSMapView() mapView.isMyLocationEnabled = true mapView.settings.myLocationButton = true mapView.padding = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 50) It will change the padding of the my location control. From bottom 50px and from right 50px Refer the below screenshot which added the padding of 50px from bottom and right. Like Subramanian, this works very well : mapView

Showing current location on android Google Map v2, But app crashes

血红的双手。 提交于 2019-12-02 15:31:44
问题 Here is my Activity code package com.example1.heartconnect; import android.location.Location; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import