google-maps-android-api-2

Android google map on click of current location button show alert box if gps not enabled

北城以北 提交于 2019-12-08 10:58:21
问题 I have implemented Google map in my app. When i click on the current location button i wanted to show alert box if Gps is not enabled. I tried this way where i got the view of that button. SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); View plusMinusButton = fm.getView().findViewById(1); View locationButton = fm.getView().findViewById(2); Using that locationButton i tried to use setOnclickListener but that did not help. My requirement is

Custom Overlays in Google Maps API v2

 ̄綄美尐妖づ 提交于 2019-12-08 10:28:13
问题 I need to create some custom polygon overlays on my map and by custom I mean I need to add more information to the overlay so that when it gets clicked I can show a dialog or something with information about the overlay. I have done a little reading and it looks like the Overlay and ItemizedOverlay classes were removed from the API v2 in the form of Polygons , Polylines etc... In order to create a custom overlay it looks like I have to create a View on top of the map and just draw on the view

Android google maps v2 crashing on startup

别说谁变了你拦得住时间么 提交于 2019-12-08 10:21:06
问题 In my android app supporting 2.2 and higher, I am trying to use the google maps api v2. I have this so far: Does anyone know what the issue is? Thanks. xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen

Android Google Maps v2 - Keep marker in the center of map

核能气质少年 提交于 2019-12-08 07:33:15
问题 I'm a new Android developer working with Google Maps v2 right now. I just need to let the user drag the map but the initial marker shouldn't move with it. This is my layout : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.MapFragment" android:layout_width="match_parent"

fillColor in Google Maps API polygon not working

≯℡__Kan透↙ 提交于 2019-12-08 07:27:29
I try to create a polygon to cover an area with these code: map.addPolygon(new PolygonOptions() .add(new LatLng(-7.542257, 110.446209), new LatLng(-7.557232, 110.420116), new LatLng(-7.580375, 110.400890), new LatLng(-7.592626, 110.389904), new LatLng(-7.596710, 110.391277), new LatLng(-7.599433, 110.381664), new LatLng(-7.604877, 110.376171), new LatLng(-7.617128, 110.361065), new LatLng(-7.628017, 110.345959), new LatLng(-7.636184, 110.334972), new LatLng(-7.655239, 110.303387), new LatLng(-7.678377, 110.288280), new LatLng(-7.705595, 110.271801), new LatLng(-7.683820, 110.259441), new

Android Google Maps V2 Caused by: java.lang.ClassCastException: com.google.android.gms.maps.SupportMapFragment cannot be cast to android.app.Fragment

喜夏-厌秋 提交于 2019-12-08 07:04:10
问题 I have this in my class import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.coffeeandcookies.ushuaiamovil.R; public class LayMapa2 extends FragmentActivity { @Override protected void onCreate(Bundle arg0) { setContentView(R.layout.lay_mapa2); super.onCreate(arg0); } } This in my xml <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout

Android increase polyline width by zoom level (Google Maps V2)

落爺英雄遲暮 提交于 2019-12-08 06:43:13
问题 Is there a way how I can automatic increase and decrease the width of a polyline when I zoom in and out on Google Maps V2? It looks horrible especially on newer devices when it stays so extremely thin. But you need it that thin when zoomed out. 回答1: Save the polyline when it is added to the map. Then perform actions on the polyline. Example for saving the polyline to an arraylist when added to the map. polylines = new ArrayList<Polyline>(); protected void onProgressUpdate(PolylineOptions...

Google maps API in Android

左心房为你撑大大i 提交于 2019-12-08 06:14:58
问题 I am trying to implement a functionality such that when a user enters an address in a text field and clicks on a button, that address should be copied into the destination field of Google maps and the user location should be set to "My Location" (his current location). 回答1: In order to show route on Google Map, Just call an intent which passes current and destination latitude and longitude. You may also pass address in any case if don't know lat-long. After doing this, its Google Map's job to

Using other account when uploading signed apk in google play store

随声附和 提交于 2019-12-08 05:57:56
问题 Their is no bug with regard to the maps. I already signed the apk with release keystore , the API Keys are registered in my account It perfectly works in any devices. What's the problem is when it is uploaded with the client account in google play store and downloaded in their device, the map displays white. Question: 1.Does it affect the application if the API keys are registered to my account and the one who upload the app is not my account ? 回答1: Answer: The API key is associated with the

Blank map with zoom controls on using Google Map's API V2 Fragment Map:

和自甴很熟 提交于 2019-12-08 04:52:25
问题 I am tring to implement google maps using the new google maps api v2 and for some reason i don't see a map. I think that the problem is those two lines of error when i run it on the emulator: E/ActivityThread( 1373): Failed to find provider info for com.google.settings E/ActivityThread( 1373): Failed to find provider info for com.google.android.gsf .gservices when i run the application on the device the following error is produced: Could not find class 'maps.j.k', referenced from method map.y