google-maps-android-api-2

Change the color of polyline in android google map v2

ぃ、小莉子 提交于 2019-12-07 09:57:04
问题 I have this code found from this link https://developers.google.com/maps/documentation/android/shapes#customizing_appearances Polyline line = map.addPolyline(new PolylineOptions() .add(new LatLng(-37.81319, 144.96298), new LatLng(-31.95285, 115.85734)) .width(25) .color(Color.BLUE) .geodesic(true)); My Problem is Color in Color.Blue returns an error saying The name Color does not exist in the current context. 回答1: Just define a color in your colors resources file and do this: PolylineOptions

how to make maps work offline in google maps api for android?

旧城冷巷雨未停 提交于 2019-12-07 09:36:46
问题 I am totally new to this api and I was wondering if there is a way that I can use the maps offline. I don't mind the size of the application be large so if there are anyways involved caching or something else size related, it is not a problem Any suggestions? ps: if it is not possible in google's api,is there a way to do this with another api form another source which provides a mapping service? 回答1: You can try to use osmdroid to work offline with Google Maps. Osmdroid is a replacement for

Google Maps API 2 MapView Not Updating

强颜欢笑 提交于 2019-12-07 09:25:18
问题 I'm displaying a Google Maps API v2 MapView in an Android app, but it's curiously not updating properly in a consistent fashion. I'm using the GPS to update the map position (tried both LocationManager and LocationClient) and although the map moves to the position, about fifty percent of the time either the street name layer fails to update or there's a fuzzy/blurry section that fails to update--until I do a manual drag (scroll) of the map. Then the entire map updates instantly. I've stripped

android maps v2 polygon transparency

北城以北 提交于 2019-12-07 05:15:27
问题 I'm using Google Maps v2 API for android and I don't manage to control the transparency of the fillColor. I would like to be able to see the map under a filled polygon. Is there a way to do that ? Thanks for any help ! 回答1: Well, let me describe how standard 4 bytes color is encoded: Standard pixel color consists of 4 bytes: A (alpha channel) - 0-255 (0 - fully transparent, 255 - fully opaque) R (red color channel) - 0-255 G (green color channel) - 0-255 B (blue color channel) - 0-255 Each

Google Maps Android Clustering OnCameraChangeListener() deprecated

好久不见. 提交于 2019-12-07 03:18:23
问题 Using the tutorial here, I successfully implemented clustering in my Android app. Since OnCameraChangeListener() is now deprecated in com.google.android.gms:play-services:9.4.0 is there a new way to implement the part below? private ClusterManager<MyItem> mClusterManager; googleMap.setOnCameraChangeListener(mClusterManager); EDIT: I tried directly replacing setOnCameraChangeListener by setOnCameraMoveListener like googleMap.setOnCameraMoveListener(mClusterManager); This does not work since

Converting a Drawable to a Bitmap to change the color of a Marker in Google Maps Android API v2

爱⌒轻易说出口 提交于 2019-12-07 02:48:21
问题 I'm converting an old application from v1 to v2, and I'm having a problem with the color of my Marker icons. I have a basic, white icon, and It needs to be colorized. In v1, I did it this way : Drawable d = DrawableUtils.resizeImageToDrawable( MapViewFragment.mapviewActivity, Configuration.Display.getDrawableFix(i), Configuration.MapView.getWaypointIconWidth(), Configuration.MapView.getWaypointIconHeight()); d.setColorFilter(color, Mode.MULTIPLY); overlay = new MyFplnFixListItimizedOverlay(d)

Animated Transparent Circle on Google Maps v2 is NOT animating correctly

浪尽此生 提交于 2019-12-07 02:15:11
问题 I was able to animate a basic circle on Android Google Maps v2, but I wanted to take it a step forward. I wanted the animated circle to be similar to Tinders animated circles, is that possible? Example: http://jsfiddle.net/Y3r36/9/ Right now, I am getting a fidgety animation that is very unacceptable. Here is my code: public void onMapReady(GoogleMap map) { double latitude = 33.750587; double longitude = -84.4199173; LatLng latLng = new LatLng(latitude,longitude); map.moveCamera

Animate marker on Polyline path

纵饮孤独 提交于 2019-12-07 01:00:59
问题 I have 3 markers on a Google Map. Two Markers to show starting and ending points Here is the code using to draw a Polyline between these two points: private void polyLine() { LatLng starting = new LatLng(##.######, ##.######); LatLng ending = new LatLng(##.######, ##.######); PolylineOptions line = new PolylineOptions().add(starting, ending); mGoogleMap.addMarker(new MarkerOptions().position(starting).title("Start")); mGoogleMap.addMarker(new MarkerOptions().position(ending).title("End"));

Released unknown bitmap reference

岁酱吖の 提交于 2019-12-06 23:57:57
问题 I'm trying to set icon of a Marker in Google Maps v2. I'm downloading some images over network and change their background in code. After that I'm setting them as icons to markers. At first creation of the map it works fine but after rotation there is an exception. Android version I run this on: 4.3 My code is as follows: UrlImageViewHelper.loadUrlDrawable(TuvaletlerMapActivity.this, iconUrl, new UrlImageViewCallback() { @Override public void onLoaded(ImageView iv, Bitmap bm, String arg2,

Android Google Maps v2 - Keep marker in the center of map

柔情痞子 提交于 2019-12-06 22:49:36
I'm a new Android developer working with Google Maps v2 right now. I just need to let the user drag the map but the initial marker shouldn't move with it. This is my layout : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.MapFragment" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout android:layout_width="match_parent" android:layout