google-maps-android-api-2

Google Maps Android API v2 - MarkerOptions draggable and visible methods

假如想象 提交于 2019-12-03 15:55:50
I'm playing with the new Google Maps Android API (v2) released earlier this month and I was delighted to see a MarkerOptions.draggable(boolean draggable) method which I thought would create a draggable marker when passing in a draggable value of true . However, on trying it (i.e. adding a marker as such to the map), it doesn't seem to do anything. The MarkerOptions.visible(boolean visible) method too, which I thought would hide the marker from view when passing in a visible value of false . Anyone been able to get these methods to work? The latter issue is already in the Google Bug Tracker .

Android Google Maps Api V2, getting the coordinates for the current map center

雨燕双飞 提交于 2019-12-03 14:33:52
I am using Android Google Maps Api V2 (not MapView or MapActivity) and I am having difficulty getting the coordinates for the center of the map. I was thinking of using @Override public void onCameraChange(CameraPosition arg0) { // TODO Auto-generated method stub geoCodeCenter(/*Location object*/); } but I can't get the lat/long from the CameraPosition object. the camera also has more dimensions as you can look at the map at different pitches now too, so getting the center of for latitude/longitude isn't the same since the user isn't guaranteed to be looking at the map from birds eye view,

How to enable google map navigation in android app

非 Y 不嫁゛ 提交于 2019-12-03 14:28:22
I have two points on google map first one is the source and second is the destination, I have the route between these points on the map.Now I want to navigate user from source to destination as Google does on Google Map Like this:- The Google Maps Android API v2 doesn't provide any functionality for navigation. It is in contradiction with Terms of Service of Maps APIs. Have a look at section 10.4 c (iii) of ToS: No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control. https:/

Get current location in onMapReady in android using google locations API

这一生的挚爱 提交于 2019-12-03 14:17:53
问题 I'm trying to display the current location of the user on the google map inside my app but I don't want to keep updating the location as the user moves. His initial location should be recorded and showed until he closes the app. I have written the following code for this: private GoogleMap mMap; protected GoogleApiClient mGoogleApiClient; Location mLastLocation; double lat =0, lng=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Android Maps - animateCamera() method not working proper

爷,独闯天下 提交于 2019-12-03 14:13:58
Problem: 1) Map getting animated to reach the required location(4th line in code) but it got zoomed to the default location(5th line in code) [leaving the map in the default location at the specified zoom level] 2) I understand why is the problem happening but i don't know how to resolve it. 3) If i change the 4th line to moveCamera instead of animateCamera that will work, but i do want animateCamera() method. Here's the code: map=((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap(); MarkerOptions options=new MarkerOptions().position(new LatLng(13.0810,80.2740)); map

Google Maps API v2 not working

本小妞迷上赌 提交于 2019-12-03 13:09:33
I am trying to build an application using Google Maps API v2 but the thing is, the application keeps giving me force closes although i followed all the required instructions. Here is the android part import android.support.v4.app.FragmentActivity; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapController; import com.google.android.maps.MapView; public class GPSonMap extends FragmentActivity{ MapView map; MapController controller; LocationManager locationManager; LocationListener listener; PendingIntent pendingIntent ; Criteria criteria; MapOverlay overlay; @Override

Android google maps button style

半城伤御伤魂 提交于 2019-12-03 13:05:45
I would like to place a button on top of my google map, which is pretty easy. However I would like it to look like the buttons google uses (zoom buttons, locate me button). Is there a way I can 'cheat' and find the styles they used for their buttons. Or has anyone else created this style before? If you disassemble Google Play Services apk by using apktool , and look into drawable * folders, you will find the resources for these buttons among other resources. For example, this is the drawable of the upper zoom button: res/drawable/maps_btn_zoom_up.xml , and this is the "empty" button: res

drawing driving routes using waypoints on android ( Google maps, Google direction api, json parsing, decode google polyline)

[亡魂溺海] 提交于 2019-12-03 13:00:05
问题 drawPath() is used to draw polyloine on map. public void drawPath(String result){ try { final JSONObject jsonObject = new JSONObject(result); JSONArray routeArray = jsonObject.getJSONArray("routes"); JSONObject routes = routeArray.getJSONObject(0); JSONObject overviewPolylines = routes.getJSONObject("overview_polyline"); String encodedString = overviewPolylines.getString("points"); String statusString = jsonObject.getString("status"); Log.d("test: ", encodedString); List<LatLng> list =

Multiple markers with text on Android Google Maps API v2

前提是你 提交于 2019-12-03 12:42:59
问题 My goal is to have multiple markers with text on each on the Android Google Maps API v2 map. The info windows approach (showInfoWindow()) is not suitable, because only one info window is displayed at a time. For example I want to have something like this: As you can see each marker has its own data (number for this example) displayed all the time. How can I achieve this with Android Google Maps API v2 ? 回答1: to do that you'll have to customize the icon of each individual marker to be what you

Change foreground and background color of Place Autocomplete Fragment

感情迁移 提交于 2019-12-03 12:21:55
I've used Google Place API and integrated Place Autocomplete Fragment . Can i change its Foreground or background color. It seems bit dull in my device. And I also want to know that can I set " powered by Google " sentence to at the bottom part of the screen. I have seen some application which have it on bottom. If you place that fragment in another layout you are able to modify as you want. Make nested such: <...CardView...> <..Your Fragment...> The logo issue, since you decided to use all autonomous API instead of creating your own layout and integrating, it comes up by default which will