google-maps-android-api-2

Remove previous Marker and add new Marker in Google Map v2

独自空忆成欢 提交于 2019-12-03 12:01:05
问题 I want to remove a current marker after long click on map anywhere and recreate a new marker at that point. I have cleared google map on long click on map and new marker is created but the previous marker also displayed. My Code is: public class EditLocation extends Fragment { View v; Context c; GoogleMap MAP; Button back; int loc; String lat; boolean isTapped = true; public EditLocation(Context c, int location, String latitude) { // TODO Auto-generated constructor stub this.c = c; this.loc =

google maps api v2 out of memory error

醉酒当歌 提交于 2019-12-03 11:25:40
问题 i have a huge memory problem in my app. i am using google map api v2 with ClusterManager and custom markers. i supply an image via call to markerOptions.icon(BitmapDescriptorFactory.fromBitmap(bitmap)); for each marker based on its category. the problem is: after several screen rotations my app crashes because of OOM error: 05-14 11:04:12.692 14020-30201/rokask.rideabike E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 4194316 byte allocation with 1627608 free bytes and 1589KB until OOM

Error package `com.google.android.gms…` doesn't exist

核能气质少年 提交于 2019-12-03 10:40:59
问题 I am new to Android development. I am learning to use Parse.com backend service and get stuck early on. I am following tutorial to create application that uses Google Maps Android API v2 . What I've done : download sample project from parse Import AnyWall-android\Anywall folder from downloaded project to Android Studio Rebuild project Then I get a bunch of errors here : import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesClient; import

in Android google maps api v2 for 4.0, show the routes from current location to given lat long

限于喜欢 提交于 2019-12-03 10:00:56
For android in google maps api v2 its showing whole earth by following all the steps from here http://mobisys.in/blog/2012/12/google-rolls-out-android-maps-api-v2/ , can i zoom in the route from current location to given lattitude and longitude, and the problem is i need to show multiple routes, how is it achievable?? right now i am not doing anything in my activity, but i think i have to do some coding for drawing the routes. how can i do this? thank you so much for your answers, and please provide me any tutorial if u know. thanks again. Finally i solved this problem by using this code.. :

How to check if an Google Maps InfoWindow is still displayed before updating it?

半世苍凉 提交于 2019-12-03 09:59:40
问题 I started working on an InfoWindowAdapter that is displaying location images inside the InfoWindow. I have a lot of different locations, therefore it is possible that an location image is not available on the phone and is downloaded from the web. Now the Maps API states the following: Note that a snapshot of the returned view will be taken and then rendered on the map so subsequent changes to the view will not be reflected by the info window on the map. To update the info window (e.g., after

Google Maps Android API V2 blacking out part of layout

℡╲_俬逩灬. 提交于 2019-12-03 09:40:35
问题 I'm trying to integrate Google Maps Android API v2 into my Android Application. I'm placing the Google Map in the middle of my layout. It works great when the layout is able to fit on the screen, but when the layout is too big to fit, and the user scrolls down to see the rest of the content, the rest of the layout is blacked out by the Google Map. See the following screenshot: (Note: All the map gestures are disabled to allow the user to scroll.) My layout XML: <?xml version="1.0" encoding=

Night mode for Google maps?

大城市里の小女人 提交于 2019-12-03 09:28:45
问题 My question is simple. Is there a night mode for Google maps? So far I could only apply GoogleMap.MAP_TYPE_NORMAL | GoogleMap.MAP_TYPE_TERRAIN | GoogleMap.MAP_TYPE_SATELLITE but could not find Night Mode . I want something like this Please do not suggest me to use overlay , I already have tried. I cannot use it as I have to place markers on it. Came across this post but it is 2 years old and I guess there should be some improvement. 回答1: Google just announced having launched custom map

How to determine if lat long coordinates are on a road with Google Maps API v2

瘦欲@ 提交于 2019-12-03 09:16:30
问题 I have used Google geo address and using lat/long have got the address. How do I determine if I am on road on not? Basically hit-test for road? I am currently using location manager for lat/long and the GeoAddress is same for on road and next to road. 回答1: Final Solution Use reverse geocoding via the Google Geocoding API. The term geocoding generally refers to translating a human-readable address into a location on a map. The process of doing the converse, translating a location on the map

Wrong titles for markers with Google Map Android API v2

与世无争的帅哥 提交于 2019-12-03 09:13:59
I'm trying to develop some algorythm for clustering markers on map. Amount of displayed markers should depends on current zoom level. If I show one marker from group of 10 I want to set it's title to "10". The problem is that now sometimes visible markers doesn't have title at all, I've no idea how it's possible. Here is my code: public class MainActivity extends FragmentActivity { private ArrayList<Marker> markers = new ArrayList<Marker>(); private Bitmap markerImage; private float oldZoom = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

How to draw a dynamic line (route) with Google Maps Android API v2

左心房为你撑大大i 提交于 2019-12-03 08:38:53
I'm wondering what the best practice is to draw a dynamic route on a map with the Google Maps API v2. I want to have a map that's able to prolong the route while the user is moving. There seems to be the obvious solution by using a Polyline and PolylineOptions. But I just can't find an easy way to add points after I instantiated the Polyline. To draw a Polyline is something like this: PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.add(POINT1, POINT2, POINT3); Polyline line = googleMap.addPolyline(polylineOptions); But after I passed the line to GoogleMap I can't add