android-maps-v2

How to constantly detect nearby marker locations from current location in Google Maps android?

前提是你 提交于 2019-11-28 10:12:53
I am trying to display a TextView at the top left corner of Google Maps that inform users if they are x distances from particular marker point locations, i.e. "You are close to location A", but only display the TextView if within range. If they move out of range, the TextView will disappear. I understand that the Google Places API shows you all the nearby locations, but I only want to show nearby locations of the markers I have on the map if users are x distances close to them. How can I achieve this? Would I still need to use Google Places API? my class .java: private GoogleMap mMap; private

Display Multiple pin on same LAT/LONG values

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 08:55:30
问题 I'm trying to show pins on mapv2 of same lat/long values, but the pins are getting overlapped on one another. Id there any better way to display multiple pins at same lat/long when i have to display bunch of pins at the same location (Lat/Long). 回答1: Use anchor(float u, float v) of MarkerOptions() to set different anchor for each Marker 回答2: No, it is not possible, because just think in a common way, you have one latitude and longitude, means one point to put pin, so if you are push 1000 pins

Google Maps fragment showing blank grey map

血红的双手。 提交于 2019-11-28 06:29:11
问题 I'm having problems with getting the map in my map fragment to show. I have tried several different solutions but the map remains blank (grey). Can somebody please point out what I'm doing wrong? The SHA1 fingerprint I'm using is the one I found in Android > Build . Note: where it says "api key from developers console", I of course have put the correct key. Fragment01.java import com.google.android.gms.maps.CameraUpdate; import com.google.android.gms.maps.CameraUpdateFactory; import com

TileProvider method getTile - need to translate x and y to lat/long

自闭症网瘾萝莉.ら 提交于 2019-11-28 06:28:56
I’m porting an iOS app to Android, and using Google Maps Android API v2. The application needs to draw a heatmap overlay onto the map. So far, it looks like the best option is to use a TileOverlay and implement a custom TileProvider . In the method getTile , my method is given x, y, and zoom, and needs to return a bitmap in the form of a Tile . So far, so good. I have an array of heatmap items that I will use to draw radial gradients onto the bitmap, each with a lat/long. I am having trouble with the following two tasks: How do I determine if the tile represented by x, y, and zoom contains the

Animate a car(Marker) along a path in google map android

人走茶凉 提交于 2019-11-28 06:04:43
I am going to share a solution of moving a marker along the path if you have List.The Bitmap will move along the path from using LatLng list. public static void setAnimation(GoogleMap myMap, final List<LatLng> directionPoint, final Bitmap bitmap) { Marker marker = myMap.addMarker(new MarkerOptions() .icon(BitmapDescriptorFactory.fromBitmap(bitmap)) .position(directionPoint.get(0)) .flat(true)); myMap.animateCamera(CameraUpdateFactory.newLatLngZoom(directionPoint.get(0), 10)); animateMarker(myMap, marker, directionPoint, false); } private static void animateMarker(GoogleMap myMap, final Marker

How to change the position of a Marker on a Android Map v2

我的梦境 提交于 2019-11-28 05:50:59
I need to do the following: I have a Marker on the map and I need to change the position of it. So I tried the following: MarkerOptions a = new MarkerOptions() .position(new LatLng(50,6))); map.addMarker(a); a.position(new LatLng(50,5)); where map is a GoogleMap . I think I have to refresh the map or somthing equal? Found the solution, Need to do it like this: MarkerOptions a = new MarkerOptions() .position(new LatLng(50,6))); Marker m = map.addMarker(a); m.setPosition(new LatLng(50,5)); There's one example of moving marker in google map v2 demo app .. In file adt-bundle-linux/sdk/extras

mapFragment.getMapAsync(this) - NullPointerException

瘦欲@ 提交于 2019-11-28 05:48:53
I am using com.google.android.gms:play-services-maps:7.5.0 version of Google Maps services. When trying to call the below I get java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.SupportMapFragment.getMapAsync(com.google.android.gms.maps.OnMapReadyCallback)' on a null object reference . @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { SupportMapFragment mapFragment = (SupportMapFragment) getActivity().getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this)

Android google map version 2 shows blank white page?

纵然是瞬间 提交于 2019-11-28 05:47:55
问题 In my application am using Google map version 2.When i run the application in real device through eclipse means it shows the map.but when i export the application as signed apk and am upload my apk in play store.Then i download the uploaded apk file from play store and am run it in my device but it shows only blank white page.i don't know whats the problem.Can any know.please help me to solve this issue. 回答1: You have to require signed apk with SHA-1 Step 1: Now locate to jdk in C drive

Offseting the center of the MapFragment for an animation moving both the target lat/lng and the zoom level

青春壹個敷衍的年華 提交于 2019-11-28 03:33:23
I've got a UI that has a MapFragment with a transparent View overlaid on top of it. The map takes up the entire screen, whereas the View is just the left third of the screen. As a result, the default "center" of the map is off. When someone clicks on a marker, I want to center that marker in the wholly visible area of the MapFragment (not the center of the MapFragment itself). Since this is hard to describe with words, let me use a few pictures. Suppose this is how my UI looks: When the user clicks a marker, I want to both center it and zoom in to see it closer. Without any adjustments, this

update polyline according to the user moving android googleMaps v2

穿精又带淫゛_ 提交于 2019-11-28 01:04:28
I have googleMap (v2) with polyline that presents a route between the user current location and the destination point. Now, I want to update the polyline according to the user moving. I tried to redrawing the whole polyline when location is changed but the polyline is flickering. I didn't find any appropriate function in the PolylineOptions class (the function add() is only to add a vertex but not to update or remove) do you have any idea how to update the polyline ??? thank you for giving your time. The only way as of version 3.1.36: List<LatLng> points = polyline.getPoints(); points.add