google-maps-android-api-2

How to handle Location Listener updates inside a Service in Android?

China☆狼群 提交于 2019-12-03 08:37:05
I am working on an app that should get accurate user location continuously if user is inside a specific zone. The location updates should be saved on a server (Parse.com) so other users can get the current location of the user. The flow is: Application onCreate --> start Service with LocationListener --> onLocationChanged --> save new location on Parse.com --> Parse.com Cloud afterSave method send push notification to users --> other users get notifications via broadcast reciever --> update user marker on map <-- Questions: I am not sure about how to implement step 4, should I save the new

Android Draw polylines with arrow on google map with direction path

岁酱吖の 提交于 2019-12-03 08:20:45
I have added polylines but not able to add arrow with direction on google map should be display as below And when it zoom up, more arrow should be display like below I have tried reading various blogs and codes but not able to get the goal I have used following code snippet below: private void DrawArrowHead(MarkerOptions MO, GoogleMap mMap, LatLng from, LatLng to) { // obtain the bearing between the last two points double bearing = GetBearing(from, to); // round it to a multiple of 3 and cast out 120s double adjBearing = Math.round(bearing / 3) * 3; while (adjBearing >= 120) { adjBearing -=

How to add text above polyline in google maps?

孤者浪人 提交于 2019-12-03 07:47:18
I have 2 markers, I would like to draw a line between them, and have a text showing the distance above the line, just like in the web version of google maps. I've already found this sample about drawing a line between 2 markers, but how do I add text above the line? One idea would be to calculate the midpoint between the two markers using their lat and long coordinates and then put an infowindow with whatever information you want to show. Or something like the following could help: Link I had a situation to show the distance between two markers above the polyline. Below is what was my

SlidingDrawer over GoogleMap

烂漫一生 提交于 2019-12-03 07:03:08
问题 First of all, I know the SlidingDrawer is deprecated, but I haven't found any alternative to it so I'm using it anyways :3 (If someone knows an alternative to it, please share it!) So I have a GoogleMap in my activity (actually a fragment but it doesn't matter), and a nice SlidingDrawer in the same screen. It works fine, but when I open or close the slidingdrawer over the map, it starts behaving weird. It looks like the map want's to stay in front of the slidingdrawer. When the drawer is

Google MAPs API for android limit 2500 requests/day is per client device or per application key?

梦想的初衷 提交于 2019-12-03 06:33:54
Sorry, I found similar questions - but not the answers: only discussions. I'm developing android application which is intended to place points and draw routes on map. In case Google limits using of their maps 2500 r/day per key - there is no way to use it, since even in case your application was once sold - you'll need to pay every month for every additional 1000 req/day. Especially it is unclear for free application: how much it will cost for 100000 downloads per month after 1 year? Please, share your experience (not your assumptions). Thanks. use of the Google Places API for Android request

Map of MapFragment gets loaded with lag when returning from another activity

梦想与她 提交于 2019-12-03 06:16:58
As far as I can see, MapFragment has an issue with transition animations. All views on the layout are getting shown immediately, including the MapFragment's own views (like zoom buttons). But the map itself gets loaded with a lag only after the animation is completed. In order to illustrate the problem, I did the following: I changed one of the Activities in the Google maps android API examples slightly. It opens a blank activity via an Action Item. When I click back button, the map gets loaded, but only after the transition is completed. I exaggerated the transition effect a little bit, so

Centering bitmap Marker (Google Maps Android API v2)

自闭症网瘾萝莉.ら 提交于 2019-12-03 06:11:37
问题 When I add a marker from a custom Bitmap, the marker is not centered at the point I specify. I'm adding it like this: // ID tramo final int tramoId = tr.getId(); // Nodos final Nodo[] nodos = tr.getNodos(); final PolylineOptions p = new PolylineOptions(); MarkerOptions m = new MarkerOptions(); // Seteamos posicion de linea y marker m.position(semisuma(nodos)); for (final Nodo n : nodos) { p.add(n.getLatLng()); } // Color de linea y marker BitmapDescriptor icon = null; if (tr.getCapacidad() ==

zoom over specific route google map

不打扰是莪最后的温柔 提交于 2019-12-03 06:08:59
I have a list of random latitude and longitude points and I am drawing a route between them. My question is how to bound this route within google map I made below utility method public static void drawRouteIntoMap(final List<? extends MapHelper> position, final GoogleMap googleMap) { /*List<MapHelper> position = new ArrayList<MapHelper>(); for (int i = lastPosition; i < maps.size(); i++) { position.add(maps.get(i)); }*/ if (position.size() > 0 && Validator.isNotNull(googleMap)) { googleMap.clear(); List<PolylineOptions> polylineOptionses = new ArrayList<PolylineOptions>(); PolylineOptions

How perform click operation on marker custom info window on google map V2 in android

断了今生、忘了曾经 提交于 2019-12-03 05:43:44
I am implementing google map V2 in my app.I have added custom info window to marker.There are three images cancel,delete & edit. onclick, cancel image window hide. delete data delete & on edit dialog open for editing. My problem is, how perform click operation on on these images? MaciejGórski There is no direct way to do it, but there seems to be workaround for this (which I haven't tested myself yet). You may see a long description in this answer: https://stackoverflow.com/a/15040761/2183804 . https://developers.google.com/maps/documentation/android/marker Quoting form the docs Info window

Difference between getInfoWindow() and getInfoContents() in Googlemaps v2 for Android

好久不见. 提交于 2019-12-03 05:41:14
Two questions: Whats the difference between public abstract View getInfoWindow (Marker marker) and public abstract View getInfoContents (Marker marker) . What is the use of getInfoContents() . Google map blog says: (getInfoWindow()) allows you to provide a view that will be used for the entire info window. (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background. . can any one please expalin(try to compare with an existing item, may be like listView row item or so ) Thanks In the above screenshot, I have used an