google-maps-android-api-2

Use google maps offline maps (cache) in Google Maps Android API

风流意气都作罢 提交于 2019-11-29 09:24:22
问题 Google Maps offers for a few months the feature to download a certain geographic region for later offline use. I use Google Maps Android API in my App and I see that while offline, in contrast to the real google maps app, I cannot zoom in to street level in my App fully, so the downloaded data is probably not used. Is there a way for my app to make use of it? 回答1: You need to create your own TileProvider and access tiles locally. Check this documentation. Here are some related threads that

How to disable marker click event?

偶尔善良 提交于 2019-11-29 09:22:35
I am developing an simple app, where I already displayed marker title with mrkr.showInfoWindow() but I don't want user to tap again that marker. How to disable clicking event of particular marker ? This is how I tried. Marker marker = gMap.addMarker(new MarkerOptions().position(new LatLng(location .getLatitude(), location.getLongitude())).title("I am here").icon(BitmapDescriptorFactory.fromResource(R.drawable.mrk1))); marker.showInfoWindow(); //how to use marker.setClickable here or somthing here.? How to display that infowindow()/title of my marker throughout my application ? You can set

Calculate the area of a polygon drawn on google maps in an Android application

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 08:50:26
I would like to calculate the are of a polygon drawn in a map fragment for a college project. This is how I draw my polygon. @Override public void onMapClick(LatLng point) { //tvLocInfo.setText("New marker added@" + point.toString()); map.addMarker(new MarkerOptions().position(point).draggable(true).title(point.toString())); markerClicked = false; } @Override public void onMapLongClick(LatLng point) { //tvLocInfo.setText("New marker added@" + point.toString()); map.clear(); } @Override public boolean onMarkerClick(Marker marker) { if(markerClicked){ if(polygon != null){ polygon.remove();

Map Marker icon animation (Google Maps API V2 for Android)

混江龙づ霸主 提交于 2019-11-29 08:49:02
On a custom event, I need my Marker to update its drawable 6 times (basically, I want the Marker to grow and shrink 3 times with a delay of 0.5 s between each growth and each shrink) so it notifies the user of said event. Is there any way to achieve this without actually having to remove the Marker and adding it again with a different Drawable ? KlasE I'm afraid there is no way to do it today without actually removing the marker and adding it again with another drawable. I have just done so myself in an attempt to create a progress bar. It works, but it is an awkward way of doing it. Click

Disable and enable view android

限于喜欢 提交于 2019-11-29 08:43:53
My target is to draw free shapes above google map v2, so I created an app to draw free shapes by finger movement in a custom view and putted this view above the map fragment in the layout.xml and made the view background to be transparent. and now I can draw free shapes well but the problem now is that I can't control map or do zooming or dragging in it. Is there are any way to make me control both of them, for example a button to covert the control from map fragment to view of drawing and vise versa ? or to turn on/off the view of drawing? this is my code DrawerView.java public class

travel time between two locations in Google Map Android API V2

自作多情 提交于 2019-11-29 07:38:17
how to display travel time between two locations in Google Map Android API V2, in my program i using JSONParse to display driving distance, but i'm can't to display the display travel time, This example program I made: DirectionActivity.java public class DirectionActivity extends FragmentActivity implements OnMyLocationChangeListener{ private LatLng start; private LatLng end; private String nama; private final String URL = "http://maps.googleapis.com/maps/api/directions/json?"; private GoogleMap map; private JSONHelper json; private ProgressDialog pDialog; private List<LatLng> listDirections;

AutoComplete Search bar in Google Maps

耗尽温柔 提交于 2019-11-29 07:13:22
I'm creating an app based on places search. I would like to know how can I add a search bar into my Google Map, where the user can select a Place, and I can capture what the user chose. I'm trying to include an autocomplete Search Box that is displayed above the Google Map in the UI. You can simply use a PlaceAutoCompleteFragment . First ensure that you're using the latest version of Google Play Services ( Version 8.4.0 and up includes the PlaceAutoCompleteFragment class ): compile 'com.google.android.gms:play-services-maps:11.0.2' compile 'com.google.android.gms:play-services-location:11.0.2'

android - draw resizable circle on google map

♀尐吖头ヾ 提交于 2019-11-29 07:13:09
I'm trying to draw a resizable circle on top of my google map, which the user will be able to expand or shrink using touch gestures (for example to shrink the circle the user will pinch the circle on the screen, I want it to work like zooming in/out option in the map, only that just the circle will get bigger/smaller on the map). Is this possible to implement? And if so how would I go about accomplishing that. I searched Google and Stackoverflow and as I understand, I need to add a custom view on top of my map fragment and implement OnTouchListener to this View (and that is just the beginning)

how to change the color of a particular area on Google map api v2 in android

醉酒当歌 提交于 2019-11-29 06:55:40
I am working on an Android app that makes use of the Google Maps API v2 and would like to mark a specific area on the map with a certain color on a click event. For example, when I click on India, the area covering the country should be colored green. I'm already using GroundOverlay , but it requires an image to display something on the map, resulting in the colored area not being a good match. Since both the map and the image have their own shape, this does not cover the exact area. Can anyone please tell me how to color an Android Google Maps API v2 map more accurately? Like MaciejGórski

Empty InfoWindow when Marker is clicked

别来无恙 提交于 2019-11-29 06:42:26
This is my code to add new Markers to my GoogleMap: MarkerOptions m = new MarkerOptions(); m.title(title); m.snippet(snippet); m.position(location); mMap.addMarker(m); mMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { Toast.makeText(DemoActivity.this, "WindowClicked: "+ marker.getTitle() + ":" + marker.getSnippet(), Toast.LENGTH_SHORT).show(); } }); Now This works just fine when my title and snippet are in English. The infoWindow and the Toast works as expected. However, as in my case, title and snippet are in Arabic,