google-maps-android-api-2

Android maps - Markers Bounds at the center of top half of map area

三世轮回 提交于 2020-02-12 04:55:40
问题 I have Android Map Extension attached under actionBar. I have couple of markers, lets say 2000. Than I have ArrayList of selected 3 markers upon some constant condition, nevermind. I want to zoom and move map to include this selected 3 markers at max possible zoom. It's an easy task, from this forum I found an easy way to do it : LatLngBounds bounds = new LatLngBounds.Builder().include(new LatLng(maxLat, maxLon)).include(new LatLng(minLat, minLon)).build(); mMap.moveCamera(CameraUpdateFactory

Marker Image Drawable change GoogleMap V2

给你一囗甜甜゛ 提交于 2020-02-08 06:49:11
问题 I have added markers in google map control using google map api v2 version but How to change Marker Background image when marker click event. @Override public boolean onMarkerClick(Marker arg0) { arg0.setIcon //Not show in List setIcon method Google API V2 Version return false; } 回答1: Override map onMarkerClick() and change icon for the marker clicked. private Marker changedMarker = null; @Override public boolean onMarkerClick(Marker marker) { if(changedMarker != null) { changedMarker.setIcon

NullPointerException When Trying to place Marker on Google Map V2

落花浮王杯 提交于 2020-01-24 19:32:06
问题 when I try to place Marker on google map with placeMarker method I get NullPointerException NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference` I/DpmTcmClient: RegisterTcmMonitor from: org.apache.http.impl.conn.TcmIdleTimerMonitor W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found. I/DynamiteModule: Considering local module com.google

preventing users from going outside map boundaries

ぐ巨炮叔叔 提交于 2020-01-23 09:55:38
问题 I am trying to prevent the user from moving outside a certain area in a google map. However there does not seem to be an easy way to do this. First time asking here so have mercy. I have tried the below in an effort to poll as the user scrolls, but the problem is that OnCameraChange doesn't fire often enough, so it works jerkily and inaccurately. I know there must be some way to do this as it seems like a simple and essential feature. private static final LatLng NEBOUND = new LatLng(47.670606

How to draw a dynamic line (route) with Google Maps Android API v2

懵懂的女人 提交于 2020-01-22 12:47:05
问题 I'm wondering what the best practice is to draw a dynamic route on a map with the Google Maps API v2. I want to have a map that's able to prolong the route while the user is moving. There seems to be the obvious solution by using a Polyline and PolylineOptions. But I just can't find an easy way to add points after I instantiated the Polyline. To draw a Polyline is something like this: PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.add(POINT1, POINT2, POINT3);

How can i take/merge screen shot of Google map v2 and layout of xml both programmatically?

你说的曾经没有我的故事 提交于 2020-01-19 05:04:05
问题 I am taking screenshot of Google Map v2 by using code of this answer which is giving me output : Which is fine to take screen shot of Map With following code i can take the screen shot of Layout with black map screen thats ok as with following code Map will black in ScreenShot String mPath = Environment.getExternalStorageDirectory().toString() + "/" + "myTestScr" + System.currentTimeMillis() + ".jpeg"; Bitmap bitmap; View v1 = (View) findViewById(R.id.rootviewtest); v1.setDrawingCacheEnabled

How do I clear the map of All points and markers and routes when switching tabs with a tab host

匆匆过客 提交于 2020-01-17 07:47:11
问题 I created an App that uses Google Maps to get the users current location and draw routes. Recently I converted this app to a TabHost with five tabs. Because of this I now need a way to clear and restart the map whenever a user clicks on that tab. How can I do this. Below is the layout.xml and activity code for my map. activity_map_view.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

NullPointerException trying to launch map fragment

喜夏-厌秋 提交于 2020-01-17 01:22:08
问题 This is the first time I have tried to do anything with play services and google maps/places API. I am getting a NPE error when trying to launch the activity. 06-10 09:15:45.704 19942-19942/com.rcd.mypr E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.rcd.mypr, PID: 19942 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rcd.mypr/com.rcd.mypr.BoxLocator.BoxLocator}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java

How to find if a geo-location is on a road between two points?

痴心易碎 提交于 2020-01-16 18:34:37
问题 I am a student working on an android application related to navigation trying to learn android programming. The application needs to search the geo-locations (latitude,longitude) among the ones available and find out which ones fall along the route the user is travelling. For example, if the user is travelling from 37.422,-122.084058 to 37.422,-122.084058, then I should be able to search the points that fall along this route from the set of points that I have. How do I do that? I am getting

How to find if a geo-location is on a road between two points?

给你一囗甜甜゛ 提交于 2020-01-16 18:34:13
问题 I am a student working on an android application related to navigation trying to learn android programming. The application needs to search the geo-locations (latitude,longitude) among the ones available and find out which ones fall along the route the user is travelling. For example, if the user is travelling from 37.422,-122.084058 to 37.422,-122.084058, then I should be able to search the points that fall along this route from the set of points that I have. How do I do that? I am getting