google-maps-android-api-2

Fused Location Provider in Android

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 09:19:41
I am developing an app using Fused Location Provider. I have a doubt. For getting location in regular intervals it uses requestLocationUpdates(). But from which source is it get the location either from WIFI or GPS or Network. In my app, it gets location in regular intervals only when WiFi is ON. When WiFi is in OFF state, then it can't get the location(it supposed to get location from some other source either form GPS or Network. But it never get location. Or i have to write listeners for GPS and Network). I don't know what is the problem. Can anyone help me. And, whether it works only when

What is the suggested way of implementing overlays in v2 of the Android Google Maps API?

强颜欢笑 提交于 2019-11-30 09:07:05
In the original version of the Android Google Maps API it was very easy to implement an overlay with the following code: List<Overlay> mapOverlays = mapView.getOverlays(); AlarmOverlay alarmOverlay = new AlarmOverlay(); mapOverlays.add(alarmOverlay); ...it was then possible to override the overlays draw() method and paint vector graphics, override the overlays onTouchEvent() method and give custom controls, etc. I am at a loss as to how to architect similar custom controls in v2, as the use-case for overlays is not mentioned in the API reference (and markers and polygons are not enough). Does

Add GIF image to marker of Google Map Api v2

会有一股神秘感。 提交于 2019-11-30 09:02:26
问题 When I add GIF Image to marker of google map V2 the image is shown but it stops its movement. Why? And how can I solve this issue and make the image do its movement? Hope anyone can help me. Thanks in advance. 回答1: Marker Icon in google maps android api v2 is a static image and you cannot change the icon once you have created the marker. So if you are trying to include any animation using GIF images, it will not be supported and only a single image from the GIF will be shown as the icon. An

Getting Android Google Map v2 working in release version by generating SHA1 fingerprint for API key

回眸只為那壹抹淺笑 提交于 2019-11-30 09:00:45
问题 I spent a long time tonight trying to figure out how to get my Google Map that worked in the debug version of my Android application to work in the release version. There were a few different problems that came up. Some fragments of Stack Overflow posts helped, but I thought it would be useful to list more detail for the whole process, including the problems I had, which were: 1) How/where do you specify something different for your release version? 2) How do you run the keytool executable

Google Maps Android API v2: My location marker always over other markers?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 07:55:32
Currently migrating an Android app using Google Maps to Google Maps Android v2; I want the map to display the built-in location marker, as well as custom markers. With the previous library, I used to draw the location marker 'below' custom markers, with mapView.setReticleDrawMode(ReticleDrawMode.DRAW_RETICLE_UNDER); I can't find a similar option in the new API. Did I miss something? After a bit a searching, I couldn't find such an option. I finally removed the location pin, and added a similar Marker and Circle to the map; since it is a classic Marker, it appears below the other markers. map

Clustering map markers on zoom out and unclustering on zoom in

旧巷老猫 提交于 2019-11-30 07:43:11
I am using the Google Map Android clustering Utitlity With Google Maps v2 play services. I am not getting the behavior I expected. As you can see in the two images below, when zoomed in I can see a cluster of 20 and a single marker up an to the left, but when i zoom out til they are on top of each other i am not seeing them cluster.. the 20 cluster still says 20 and not 21? Is that expected behavior? Is there a way can make the cluster show 21 instead of 20+ This is default behavior specified in DefaultClasterRenderer#onBeforeClusterRendered() : /** * Called before the marker for a Cluster is

Google Map Direction Api using Retrofit

冷暖自知 提交于 2019-11-30 07:42:37
I want to draw the route between two Location. I used the retrofit library to call the API. I didn't get any response. I need the polyline in an ArrayList. How i do that? Need help to create the GsonAdapter also... Thank you.. In the activity ` String base_url = "http://maps.googleapis.com/"; Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .create(); RestAdapter restAdapter = new RestAdapter.Builder() .setEndpoint(base_url) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); MyApiRequestInterface reqinterface = restAdapter.create

Using an xml Layout for a Google Map Marker for Android

你说的曾经没有我的故事 提交于 2019-11-30 07:38:23
I want to use a layout and not a drawable for my marker I am using with Google Maps Api 2 for an Android app. Like this: Marker m = googleMap .addMarker(new MarkerOptions() .position(LOC) .snippet(user) .title(name) .icon(BitmapDescriptorFactory.fromResource(R.layout.map_marker))); However, it seems this is only designed for use from drawable folder. I simply what an image with a background where I can change colors based on marker type. This is the layout I want to use: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width

Arrow Mark over Polyline in Android Google Route Map

。_饼干妹妹 提交于 2019-11-30 07:30:11
how to show Arrowheads over Polyline in Android Google map v2 I have gone through couple of links , most of them gives link to JS https://google-developers.appspot.com/maps/documentation/javascript/examples/overlay-symbol-arrow but I need in Android not JS and I can't use those codes in Android Some are using MapActivity I followed a tutorial to creat map activity too https://developers.google.com/maps/documentation/android/v1/hello-mapview but it didnt work I can't generate the mapactivity and thus i couldn't use the locationoverlays i have also got some posts commenting as it is available in

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

核能气质少年 提交于 2019-11-30 07:18:29
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? abielita You need to create your own TileProvider and access tiles locally. Check this documentation . Here are some related threads that may help you: Using the android Google Maps API v2 as a viewer of offline tiles: is it possible?