google-maps-android-api-2

Custom infowindow in Google map android v2

China☆狼群 提交于 2019-11-28 17:28:29
I am using Google Map API V2 and i have created a custom InfoWindow for a Marker on map.In this InfoWindow i have a button. My problem is unable to set Onclicklistener/functioning to that Button(Dummy).Any one give me some idea to solve this : Here is code snippet: public class MarkerView extends FragmentActivity implements OnMarkerClickListener,OnInfoWindowClickListener{ private GoogleMap mMap; private Marker chennai; private View infoWindow; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.basic_demo); infoWindow=getLayoutInflater().inflate(R

Cluster markers in Google Maps Android v2

六眼飞鱼酱① 提交于 2019-11-28 16:52:38
问题 I have to place different markers on a GoogleMap from the Google Maps Android v2 API. The problem is that multiple markers are set to the same position (lat/lng), so the user only sees the "newest" marker. Is there a possibility (in the best case: a library) that clusters different markers from the same area (in relation to the zoomlevel)? I've already read about the MarkerClusterer , but this is designed for the JavaScript API. 回答1: Google has provided a utility to do this as part of their

How to display my location on Google Maps for Android API v2

孤人 提交于 2019-11-28 16:10:53
I've looked high and low for an answer on this, and no one, in any forum question has been able to help. I've searched through the tutorials. The API Guide says: The My Location button appears in the top right corner of the screen only when the My Location layer is enabled. So I've been looking for this My Location layer and have been unable to find anything. How do I show my location on a Google Map? Yos233 The API Guide has it all wrong (really Google?). With Maps API v2 you do not need to enable a layer to show yourself, there is a simple call to the GoogleMaps instance you created with

how to control/modify the activity textview from viewpager fragment

删除回忆录丶 提交于 2019-11-28 14:52:03
I have a viewpager which has five tab and control the tab with tablayout. the problem that i have is that the title doesn't change when want to go from one activity to another activity. the thing that i do is that i changed the textview title in tablayout in onTabSelected in the activity but in both on select tab and in on reselect tab method but sometimes it doesn't change anymore. another thing that makes the point is the map which i use the address of the map in my main activity title. i changed the address using setOnCameraChangeListener method and the problem with this case is that it run

Android Google Maps Direction Api - Api key restriction not working

喜欢而已 提交于 2019-11-28 13:40:47
When we are setting a Key restriction to NONE for Google Maps Direction Api, It works fine. But When we set Key restriction to Android apps and provide a proper Package name & SHA-1 certificate - It says Request Declined from Google Api response. Any known solution to this? Directions API is a web service. The restrictions that will work with an API keys for web services are IP restrictions. It is supposed that web services requests are executed on your backend servers. If you need to restrict an API key, the workaround is to create an intermediate server. Your Android application should send

Minimal Android API level to run Google Maps Android API v2

微笑、不失礼 提交于 2019-11-28 13:22:56
I have developed a mobile application that uses Google Maps Android API v1, and I plan to port it to the recent Google Maps Android API v2, as recommended by Google. However, my application also targets Android 2.1 devices, and I cannot figure out whether the v2 Maps will run on such devices. I have found some reference suggesting that v2 should work with API level 8 and 10 ( here , here and here ), provided that OpenGL ES 2.0 is supported by the mobile device, but nothing about API level 7. My question is therefore: What is the minimum Android API level to run Google Maps Android API v2? TIA!

Android Maps v2 - animate camera to include most markers

你离开我真会死。 提交于 2019-11-28 12:35:37
I have a set of points coming from a webservice that need to be displayed on a map. I have a current solution working nicely for most cases, using the well-known LatLngBounds.Builder , CameraUpdateFactory.newLatLngBounds and map.animateCamera . I have some cases which give problems though: when the points are too far away, the map centers on max zoom level on the barycenter of those points. For example: I have 10 points in France and 2 points in Hawai. Maps centers more or less on the caribeans at min zoom level. Hence on screen I got nothing shown, the user has to scroll to actually see

Google Maps v2 not loading. Error android.view.InflateException: Binary XML file line.. Error inflating class fragment

狂风中的少年 提交于 2019-11-28 12:17:28
问题 This is my MainActivity. minimum sdk version is 11 in my app. I used the API key in the android manifest file. When I did some minor modifications, it is showing me blank white space instead of map. public class MainActivity extends Activity { // Google Map private GoogleMap googleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { // Loading map initilizeMap(); } catch (Exception e) { e

Want to create google map navigation in my application - custom way

陌路散爱 提交于 2019-11-28 11:48:36
I have created an application in which I am trying to show user's movement by animating marker position. Using Google map V2. Location updates using location client. Animating marker using new location. But comparing with Google map navigation, there is no continuity in rendering navigation. Can anyone suggest a better approach? Thanks! Kapil For continuity, I think you need to fetch regular location updates from location client by giving location request like this. LocationRequest request = LocationRequest.create() .setInterval(0).setFastestInterval(0) .setSmallestDisplacement(0) .setPriority

Custom infowindow with google maps api v2

旧城冷巷雨未停 提交于 2019-11-28 11:12:48
I can customize the content of the infoWindow with a simple block of code: private GoogleMap mMap; mMap.setInfoWindowAdapter(new InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.custom_infowindow, null); return v; } }); <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="