android-maps-v2

Google Maps Marker not getting displayed

こ雲淡風輕ζ 提交于 2019-12-08 08:32:57
问题 I am trying to learn google map API. I see a map but I am unable to get a marker at the right location. I see it somewhere in the ocean near China. Moreover, map is centered at (0,0) and not the (lat,long) that I have provided. Here is my code Activity public class HomeActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home_page); GoogleMap map = ((MapFragment) getFragmentManager()

Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method gls.a

只愿长相守 提交于 2019-12-08 04:11:35
问题 Before I begin I have tried every solution offered under similar questions posted on stackoverflow as well as other forums to no avail: I have the following code to render maps...It worked for a few days then outright stopped working. I have changed the API keys but also nothing. public class The_Map_Fragment extends SherlockFragment { .......... .......... if (googleMap == null) { googleMap = ((SupportMapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap(); googleMap

How to create release key for android v2 maps

感情迁移 提交于 2019-12-07 22:51:43
问题 I tried below code for a debug key and its working fine. When i make a apk then map is crashing. After searching in google i found debug key is work in release mode. keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android So,how can i create a release key for v2 maps. please help me. 回答1: I didn't had the chance of doing that, but for my understanding what should be done is: 1. First of all you will need to export

How to draw a shape dynamically on map touched location in android

拥有回忆 提交于 2019-12-07 17:22:16
问题 I want to draw a shape, wherever the user touches the map, the should be drawn dynamically. I don't have any idea about drawing these shapes. How could I achieve this? Can I get this done through canvas? I am using MapFragment. Please see the image, Please give me any idea!! Any help is appreciated!! 回答1: You can do that by adding a View overlaying the map. have a Polyline object (initially empty) that will be your line handle onTouchEvent on that View translate x,y from events to LatLng

Maps v2 marker animation - fade in and out

会有一股神秘感。 提交于 2019-12-07 06:30:25
问题 How would one fade in and out a GoogleMap marker? This is how I add a marker to the Map: marker = map.addMarker(new MarkerOptions() .position(point) .title(title) .snippet(text) .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker)) ); 回答1: With Google Play services 4.0+ you can use Marker.setAlpha in conjunction with Handler that posts some Runnable every few milliseconds. The code will be similar to my answer here Drop marker slowly from top of screen to location on android map V2.

Info window isn't center position Android Google Map v2

柔情痞子 提交于 2019-12-07 05:32:01
问题 I have problem with info window on Google Map v2. Info window is from left on marker. This is problem reproduced only Samsung Galaxy S4. I installed Google Api Demo and it is reproduced. Is it bug? How can fix it? 回答1: I've submitted this issue on maps v2 tracker. http://code.google.com/p/gmaps-api-issues/issues/detail?id=5439 Edit: Now resolved in the GPServices library. 回答2: Are you setting the anchor point in your code? The position looks similar to when I do this: marker.setAnchor(0.0F, 0

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"));

How to zoom camera to cover the path in android googlemap?

一个人想着一个人 提交于 2019-12-06 23:43:11
问题 I have covered multiple locations in Google map using LatLng.Builder and it's working. Is there any way I could cover the whole path between two location in Google map ? My Curent Code to include multiple locations builder = new LatLngBounds.Builder(); builder.include(LatLng1); builder.include(LatLng2); googleMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 17)); Any suggestion please? Thanks 回答1: I know you already find the answer, but here is my method to solve the

How to display smooth movement of current location in google map android

帅比萌擦擦* 提交于 2019-12-06 15:34:12
问题 I am implementing a map navigation application. I get device's current location every 1000 milliseconds and draw a polyline, from the current location to fixed marker point. But when using device inside a vehicle, polyline and current location update not animating like uber or google-map. It's changing suddenly from one point to another. How to get a smooth animation of the current location change. 回答1: you have to try this way it will help you private void animateMarkerNew(final LatLng

How to create release key for android v2 maps

与世无争的帅哥 提交于 2019-12-06 14:12:20
I tried below code for a debug key and its working fine. When i make a apk then map is crashing. After searching in google i found debug key is work in release mode. keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android So,how can i create a release key for v2 maps. please help me. I didn't had the chance of doing that, but for my understanding what should be done is: 1. First of all you will need to export you project as a Signed Application : Right click your project -> Android Tools -> Export Signed