google-maps-android-api-2

Google Maps Version 2 - Updating information windows

不问归期 提交于 2019-12-12 04:57:10
问题 As we know in google maps android version 2, a custom information windows, is a view that converts to an image. Actually google aftre you return you view converts the view to a image an then show it to the info windows. But I want to show images downloading from internet to my infowindow. Actually, I want that before that download complete show an progress bar to my infowindows and after it compeleted update info windows, by this mechanism how I can do this? 回答1: Have a model object that

Android - Google Map make marker sticky

半腔热情 提交于 2019-12-12 04:56:50
问题 I have following marker code on my MapFragment. I want this marker stick to it's position. Means I want marker at center position in map and when I move/drag map then marker shouldn't get moved. How to do that with following marker? PlaceMarker = PlaceMap.addMarker( new MarkerOptions() .position(new LatLng(0, 0)) .draggable(true) .title("Drag Me")); PlaceMarker.showInfoWindow(); Thanks 回答1: You can add a listener when the user pans the map and set the marker on the center. mMap

How to add google maps v2 sdk to maven project as dependency?

三世轮回 提交于 2019-12-12 03:44:37
问题 How to add google maps v2 sdk to maven project as dependency? I am using jar file but project need resource. How i can add them? 回答1: You should be able to use my Maven Android SDK Deployer to get the the Play services install into your local Maven repository or deployed to your repository manager and then add a apklib dependency to the Google Play Services, which contains the maps stuff. More at https://github.com/mosabua/maven-android-sdk-deployer 回答2: It looks like the Maps v2 API is part

Google play services maps 9.2.0 issue

心已入冬 提交于 2019-12-12 03:37:49
问题 My Android app has been successfully using maps by including the following in my gradle ... compile project(':googleplayservices_lib') My SDK manager says I have rev 32 which appears to be the latest. So with this, everything has been working just fine. Now I'm enhancing the app and I saw some posts that says I can now use zIndex parameter when adding a marker to control the Z Index. But to do this I must add the following to my gradle . . . compile 'com.google.android.gms:play-services-maps

Google map API - rotate polygon in z-direction

点点圈 提交于 2019-12-12 03:35:00
问题 I would like to rotate polygon on Z-direction. Please See below image. I got code from below post Google Maps API rotate Rectangle Which is working perfectly fine to rotate polygon on X-->Y or Y-->X direction. Please see below image. I apologize for my English to explain this problem. I appreciate any help on this. 回答1: The following example demonstrates how to rotate a polygon. Create a polygon from a rectangle object and display it on the map instead of rectangle. Rotate a polygon. check

Generate .kml file in Android from GoogleMapsApiV2

旧街凉风 提交于 2019-12-12 03:28:20
问题 I'm making a Google Maps Application which one of the functions is to generate maps from user traveled distance. I do this by adding PolyLines to my map fragment so the user can see the path he just traveled. However, after the user is done recording his route I want to export those PolyLines as a .kml file so the user can travel the same path next time, but I don't know if I should use a XML parser to make the file myself or is there any way to actually export all the contents from the

Draw polygon using onMarkerDrag google map v2

不羁的心 提交于 2019-12-12 03:11:50
问题 I'm trying to draw a free form lines over google map v2, so I'm trying to do this by listening to marker drag. I wrote the following code but it doesn't draw anything @Override public void onMarkerDrag(Marker marker) { Integer markerId = markerMapHash.get(marker); // as I'm giving every marker a key by HashMap if (markerId == 1) { System.out.println("this is the draw line marker: "+marker.getPosition()); lineCordinates.add(marker.getPosition()); // lineCordinates is an arrayList } for (int i

Dynamically increase the size of custom marker in google maps - Android

只愿长相守 提交于 2019-12-12 02:49:21
问题 I use Picasso to retrieve the Bitmap image to use as a marker icon and it apply successfully. But I need to dynamically increase the size of the custom marker for all devices. Because with my code below, it's working fine in some devices but in some others devices, the marker is very big. Here's my code dest = new LatLng(myMarker.getmLatitude(), myMarker.getmLongitude()); markerOption = new MarkerOptions().position(dest); location_marker = mMap.addMarker(markerOption); Target target = new

Google maps not showing Android

爱⌒轻易说出口 提交于 2019-12-12 02:32:53
问题 I want to implement google maps in my app. I added a google maps activity and created a key. I didn't change anything in the code elsewhere. I should work but it doesn't. MapsActivity public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is

create custom marker icons on runtime using android xml

北城以北 提交于 2019-12-12 02:14:56
问题 I am developing an android app in which I need to download an image from its URL, create a bitmap out of it and than display it on map as an icon. so far I have successfully completed to show bitmaps dynamically on map but I need to place my images on some background. something like this shown here How to create a custom-shaped bitmap marker with Android map API v2? any example or suggestion would be helpful. thanks...:) 回答1: I got the answer for my above problem I created a bitmap from view