google-maps-android-api-2

Multiple maps v2 in TabActivity

有些话、适合烂在心里 提交于 2019-11-30 02:05:51
I'm currently trying to have 2 maps v2 in different tabs of a TabActivity using MapView objects. The problem arises in the following scenario: tab1 with a map is displayed go to tab2 in order to display another map in this second tab looks like the map image from first tab is overlapping the new map. See the following picture: On the right you can see how the first map is still displayed on top of it. The touch events are going to the new map but that doesn't really help. I spent a lot of time trying to convert our app to use fragments and run into other types of issues. One of them being http

Associate an object with Marker (google map v2)

点点圈 提交于 2019-11-29 23:52:04
In my app I have some objects that have their location displayed on the map using markers. The problem is that the only way I've found to handle marker clicks is googleMap.setOnMarkerClickListener(new ... { @Override public void onMarkerClick(Marker marker) { // how to get the object associated to marker??? } }) In other words I get the Marker object while the only interface that I have allows me to set just MarkerOptions. Any way to associate Marker with an object? You can associate arbitrary object by using Marker 's setTag() method Marker amarker = mMap.addMarker(new MarkerOptions()

Is it possible to add arrows heads on poly line using Android maps V2 [duplicate]

帅比萌擦擦* 提交于 2019-11-29 23:23:29
This question already has an answer here: How to create direction arrows for my polylines in android 3 answers How to draw poly line with arrow head(It indicates the direction) using Android Maps V2 API. In Android Maps Documentation this option is not available.Is it possible to add arrows on polyline? Here's a working example I've developed using the same concept as what Doug suggested, by taking a JavaScript example ( http://econym.org.uk/gmap/example_arrows.htm ) and converting it to Java code. For handiness it uses images from Google Maps servers, but these could images of your design or

How to make custom CoordinatorLayout.Behavior with parallax scrolling effect for google MapView?

旧街凉风 提交于 2019-11-29 22:52:02
问题 I try to make a parallax scrolling effect for google MapView and RecycleView using CoordinatorLayour . so base on some tutorials found on web I made below code. The layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools

Adding multiple markers in Google Maps Api v2

爷,独闯天下 提交于 2019-11-29 22:29:07
问题 I have successfully managed to show the google map api v2. I want to add markers for my positions on it. As per the documentation, I am only able to add one marker at a time or have to use a loop to add multiple. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.demo_v2); googleMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);

Google Maps current location marker and accuracy radius overlay

匆匆过客 提交于 2019-11-29 21:26:07
问题 How can I display a blinking ellipsis and a circle demonstrating user's current location and the accuracy (blue overlay) on Google Maps Android API v2? To be more specifically, how can I have an animated drawable like the one Google uses? And how can I display a circle as a blue overlay (25% alpha or something like)? Thanks. 回答1: Actually, the solution is simpler than I thought. When using Google Maps Android API v2, the GoogleMap object has a method called setMyLocation. If you set it to

Android google maps marker disable navigation option

六眼飞鱼酱① 提交于 2019-11-29 20:33:07
Im creating an app where users need to walk to a point on a map. But they need to find a route to the point by them selves. Ive created a map with markers but by default if a user clicks on the marker a "start navigation" and "view in google maps" option is shown. Is it possible to disable these options ? The options that are shown on marker click This thing is called Map Toolbar . You can disable it by calling UiSettings.setMapToolbarEnabled(false) : GoogleMap map; ....... //init map map.getUiSettings().setMapToolbarEnabled(false); You can also define setMapToolbarEnabled() from the XML using

How to display nearby places like ATM's, hospitals in Android Google Map?

北慕城南 提交于 2019-11-29 20:30:45
How to display nearby places & place details like ATM's, Hospitals, Restaurants, etc. in Android Google Map This is the link that I used: Showing nearby places & place details using Google Places & Maps API I'm able to fetch my current location but nearby places are not getting displayed. Neither am I getting any error in my logcat you can get places near by your location using Google Place API and for use of Place Api see this blog hope this will help you. Get places nearby your location using Google Place API . Know about Location Data also filter data with Place Type where you found the

How to customize PlaceAutocomplete widget dialog design to list places

会有一股神秘感。 提交于 2019-11-29 20:27:20
I need to show list of places in dropdown using google placeAutocomplete widgets. Here I'm getting dialog to show places according to my query but I need to give custom design for that search result dialog as like in Uber, Ola apps. Here I want design like below image. If anyone done this before please give me your suggestions,thanks in advance. You need to customize your adapter. I had implemented this functionality in my project. You can follow this. activity_search.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id=

Make clickable polygons on Google Maps (for Android)

爷,独闯天下 提交于 2019-11-29 19:30:59
问题 I have continuous LatLngs of various areas in a city. Is there any way I can create clickable polygons with it. Once way to go about would be to Generate polygons with the available LatLngs.( I want to visually show the polygons on the map with color encoding) Set up setOnMapClickListener . Do a point inside polygon test. I understand that this is very naive. What are the alternative approaches? 回答1: Here's how I did it. Polygon polygon = getMap().addPolygon(new PolygonOptions() .add(new