android-maps-v2

Google map v2 android method getMap() returns null

若如初见. 提交于 2019-12-11 05:38:38
问题 In my application I am using google map programmatically, but when I call getMap() it returns null. even I have tried onActivityCreated() but still it returns null. somebody please help me.. Here is my code, public void callMap() { try { int status = GooglePlayServicesUtil .isGooglePlayServicesAvailable(mActivity); if (status == ConnectionResult.SUCCESS) { Log.d("sreedhu", "Google Play Service Available"); gmo = (new GoogleMapOptions()).zoomControlsEnabled(true) .rotateGesturesEnabled(true);

Error android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment

你离开我真会死。 提交于 2019-12-11 05:32:48
问题 i am following tutorial for using google maps api v2 .i am facing an error error logs are 05-15 00:08:18.415: E/AndroidRuntime(4547): FATAL EXCEPTION: main 05-15 00:08:18.415: E/AndroidRuntime(4547): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.rtesh.onemore/org.rtesh.onemore.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment 05-15 00:08:18.415: E/AndroidRuntime(4547): at android.app.ActivityThread

How to get address from latitude and longitude android google map v2 [duplicate]

不羁的心 提交于 2019-12-11 03:45:24
问题 This question already has answers here : get latitude and longitude with geocoder and android Google Maps API v2 (5 answers) Closed 4 years ago . I am trying to get an address from latitude and longitude in Android Google Maps v2, but it errors. Here is my code: case PLACES_DETAILS : final HashMap<String, String> hm = result.get(0); final double latitude = Double.parseDouble(hm.get("lat")); final double longitude = Double.parseDouble(hm.get("lng")); SupportMapFragment fm = (SupportMapFragment

How to check is streetview is available on location

本小妞迷上赌 提交于 2019-12-11 03:43:27
问题 I'm using the the Google Maps Android SDK and I'm trying to find out if a StreetView panorama is available is a certain location. To describe the feature: "If a user click on a map marker and a the location has a panorama then show the panoram, otherwise just zoom the map to the marker location) I'd rather not create a SupportStreetViewPanoramaFragment if the location doesn't have a panorama. Even if I create it I think the only possible way would be to call

android maps v2 custom overlay disappears on zoom

為{幸葍}努か 提交于 2019-12-11 02:17:43
问题 At zoom levels not included in my map cache, generated by MapTiler, Android Maps v2 does not display the map. My understanding was that Android Maps v2 will use the highest zoom level available for a given tile cache, so why is it hiding the layer? On closer inspection, it's because the tile provider I've implemented returns null, indicating no tile available. Android Maps v2 doesn't seem to hold onto the lower resolution copy and display it, instead just opting to show nothing. 回答1: This is

Stick position to road on android maps v2

穿精又带淫゛_ 提交于 2019-12-10 19:06:26
问题 I am developing an app to be used on road while driving, just like Google Maps for Android, the official Google application. If you set a target and an origin on the google maps app and begin route, it will stick you on road: the arrow marker will be on road, and it kinda looks like a magnet action between your position and the nearest road, so you will never be off-road because you are supposted to be on road. How is that made? I want to center the map in the user location, but I want it to

How to enable Drag a Marker (Android Map Api v2) after a single Touch?

自作多情 提交于 2019-12-10 17:23:46
问题 I have a map with some markers. I set the listener for drag: map.setOnMarkerDragListener(this); But the drag is enable only after the user long press the marker. I want to enable drag immediately. Is there a way to do this with Android Maps (v2)? 回答1: You can use Drag and Drop, with the Android drag/drop framework, you can allow your users to move data from one View to another view in the current layout using a graphical drag and drop gesture. The framework includes a drag event class, drag

Tile Overlay for Android maps v2: How to map latitude and longitude to a pixel location

烂漫一生 提交于 2019-12-10 12:04:11
问题 I'm building an image for an Android maps v2 TileOverlay . Say, for example, that I want a pixel that will end up at a particular latitude and longitude in the tile, to be a particular color. How do I know what latitudes and longitudes in the tile will map to which pixels in my image? What is the mapping from {latInTile,lngInTile} to {pixelLocationX, pixelLocationY} for a tile? Thanks. 回答1: This is exactly what a "projection" is. Google uses the Mercator Projection, described here https://en

Android maps API v2 backward compatibility

耗尽温柔 提交于 2019-12-10 11:56:05
问题 As I understand application with new maps SDK v2 can be installed only on devices with Google Play services APK. And v1 keys will not be available after 3/2013, so does it means I can't build today map application wich runs on most of android devices? 回答1: As I understand application with new maps SDK v2 can be installed only on devices with Google Play services APK. The app can be installed on whatever devices you want. Maps V2 will only work on devices with the Play Services Framework APK.

MapView v2 snapshot() creates an unfinished Bitmap

家住魔仙堡 提交于 2019-12-10 11:02:28
问题 I'm using the new snapshot() method on the GoogleMap object, and in my SnapshotReadyCallback I'm swapping out the MapView in my layout for an ImageView with the Bitmap passed to me from the callback. The unfortunate thing about this is, even though I'm getting a Bitmap it appears that the snapshot was taken before the map finished rendering. I should also add that this View is being created programmatically, and isn't added to the Activity right away (it's actually being placed in a