google-maps-android-api-2

How to reverse Geocode in google maps api 2 android

坚强是说给别人听的谎言 提交于 2019-12-20 10:33:20
问题 I want to do reverse geocoding in my app using map api 2.But i dont know exactly how to do that?Any ideas? 回答1: Use Geocoder: Geocoder geoCoder = new Geocoder(context); List<Address> matches = geoCoder.getFromLocation(latitude, longitude, 1); Address bestMatch = (matches.isEmpty() ? null : matches.get(0)); 回答2: You can do reverse-geocoding in two ways Geocoder Google API Geocoder It should be executed in a separate thread: private class FindPlaces extends AsyncTask<String, Void, List<Address>

How to remove single marker using Google Maps V2? [duplicate]

纵饮孤独 提交于 2019-12-20 08:34:04
问题 This question already has answers here : Remove a marker from a GoogleMap (9 answers) Closed 6 years ago . The only method that removes markers from map is clear. However it clears all markers from the map. I want to remove only single marker or group of markers. How could i achieve this? 回答1: After adding the marker it is possible to obtain its reference: Marker marker = map.addMarker(..); The Marker class has a remove method: 回答2: I got the same problem, so to fix it I'm doing mMap = super

How to get location of android device by its android id

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:28:56
问题 I am new in android and recently start learning about Android and I am trying to get location of any android device by its unique android id. By that I can track the approx or exact location either by GPS or network provider. In detail I mean to say that whenever i enter any Android id in my app i can get device location in my application. Thanks for your kind help. 回答1: Finally I am able to do with this code: public class MyService extends Service implements LocationListener{ String GPS

Use Google Maps API MapView without permission

↘锁芯ラ 提交于 2019-12-20 05:23:27
问题 Does anyone know if it's possible to use the Google Maps API for Android's MapView without giving it location permission? I just want to render a map and place a marker on it. I am not asking for the user's location in any way. I cannot use the MapFragment because I am housing this view inside another Fragment, and nested fragments aren't supported until Android 4.2. 回答1: Per the specify Android permissions section: The following location permissions are recommended, but you can omit them if

Display Map v2 in popup Window not display in android?

眉间皱痕 提交于 2019-12-20 03:37:05
问题 i want to open the popup window on that i used the map v2 for displaying map v2 in popup window but is not display here i put my xml layout and activity class main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="

Google map: moving marker and map together smoothly along with the user?

て烟熏妆下的殇ゞ 提交于 2019-12-20 02:52:34
问题 I have to show real time/live user moving location in google map once user turn on the feature and up-to terminating it. I have had used the method below to animate the marker. private void animateMarker(final Marker marker, final LatLng toPosition, final boolean hideMarker) { final Handler handler = new Handler(); final long start = SystemClock.uptimeMillis(); Projection proj = mMap.getProjection(); Point startPoint = proj.toScreenLocation(marker.getPosition()); final LatLng startLatLng =

How to center text on android IconGenerator

▼魔方 西西 提交于 2019-12-19 16:06:19
问题 I'm developing an app using lots of markers placed on the map, and I'm using a custom ClusterRenderer to show them. Problem is that I can't draw the cluster's size in the center of the custom marker icon, please see attached screenshot. I've tried adding contentPadding to the IconGenerator, but still no luck, because of the changing number of digits shown. Could you please help me center the text on the generated icon? Code: IconGenerator clusterIconGenerator = new IconGenerator(context);

How to center text on android IconGenerator

 ̄綄美尐妖づ 提交于 2019-12-19 16:04:14
问题 I'm developing an app using lots of markers placed on the map, and I'm using a custom ClusterRenderer to show them. Problem is that I can't draw the cluster's size in the center of the custom marker icon, please see attached screenshot. I've tried adding contentPadding to the IconGenerator, but still no luck, because of the changing number of digits shown. Could you please help me center the text on the generated icon? Code: IconGenerator clusterIconGenerator = new IconGenerator(context);

Compilation error in Android Studio When making a simple Google Android Maps API v2 project

寵の児 提交于 2019-12-19 07:22:51
问题 Recently I migrated to the New Android Studio IDE based on IntelliJ The Guides i followed were: https://developers.google.com/maps/documentation/android/start ( for basics ) How can I create an Android application in Android Studio that uses the Google Maps Api v2? ( for importing the required Google Play services and support libraries into android studio ) All the libraries were properly detected by Android Studio and i didn't get any 'library not found errors'. The project was shown error

Android Google Maps API v2: get my bearing location

橙三吉。 提交于 2019-12-19 03:38:11
问题 I would like to force the camera to behave like you are using navigation, it means when you rotate 90° left, the camera does the same thing. I have a Google Map where my location (as a blue dot) is shown. mGoogleMap.setMyLocationEnabled(true); When I am moving, blue dot is with an arrow which shows my current bearing. I would like to get this bearing. I am getting my current location using FusedLocationApi : currentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient)