android-maps-v2

Don't snap to marker after click in android map v2

旧街凉风 提交于 2019-11-28 21:13:42
Currently Android Map v2 snaps to marker location after click. I want to disable this behavior but see no options to do it. Does anybody know how to fix that? Based on what I read from the Markers - Google Maps Android API ( https://developers.google.com/maps/documentation/android/marker#marker_click_events ) Marker click events You can use an OnMarkerClickListener to listen for click events on the marker. To set this listener on the map, call GoogleMap.setOnMarkerClickListener(OnMarkerClickListener). When a user clicks on a marker, onMarkerClick(Marker) will be called and the marker will be

MapFragment gets a dark overlay when used in DialogActivity

一笑奈何 提交于 2019-11-28 20:05:40
问题 I'm trying to show a MapFragment of the Android Maps v2 API in an Activity with the @android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar theme. This works fine. However, the map gets a dark overlay: When I change the theme to @android:style/Theme.DeviceDefault.Light.NoActionBar , the map is shown as it should: This is my xml layout file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

What is difference between 'debug.keystore' and 'release.keystore' in Android?

女生的网名这么多〃 提交于 2019-11-28 18:17:59
Recently, I was working with Android Maps V2. I came across debug.keystore and release.keystore . What is the difference between them? Why do we have to use both? The Android build process signs your application differently depending on which build mode you use to build your application. There are two build modes: debug mode and release mode . You use debug mode when you are developing and testing your application. You use release mode when you want to build a release version of your application that you can distribute directly to users or publish on an application marketplace such as Google

Set a max zoom level on LatLngBounds builder

匆匆过客 提交于 2019-11-28 17:04:16
I haven't found an answer in my search, there are a few answers on SO but they didn't work for me. I have 2 markers on the map and I am using LatLngBounds builder in order to let the camera zoom to the right zoom level to include them both. Everything works as expected aside one thing, when the 2 markers are really close to each other, the map is very very zoomed and well, it doesn't make any sense to have this level of zooming. LatLngBounds.Builder builder = new LatLngBounds.Builder(); builder.include(firstMarker.getPosition()); builder.include(secondMarker.getPosition()); LatLngBounds bounds

Android Google Map how to check if the gps location is inside the circle

六月ゝ 毕业季﹏ 提交于 2019-11-28 16:15:38
I'm trying to detect if a user is in the radius of a Marker , using the users gps location. I have the marker's coordinates, but I don't know how to calculate whether the user is in the area. I've tried to use the following, but even when the current location is inside the circle I keep getting the "outside" message. public class MapaEscola extends FragmentActivity { private GoogleMap googleMap; private Serializable escolas; private ProgressDialog dialog; private Circle mCircle; private Marker mMarker; @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override protected void onCreate(Bundle

Android Google Maps: XML layout errors

↘锁芯ラ 提交于 2019-11-28 14:40:11
I am trying to get google maps v2 to work in android using android studio. I got all my keys and manifest setup. When I try and create xml for the actual activity that the map will show up on I get errors. My xml looks like this: <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" tools:context=".MainActivity" > <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout

MapFragment - NullPointerException - Google Maps V2 - Android

自古美人都是妖i 提交于 2019-11-28 14:19:59
I'm getting an NullPointerException with the following code: private ProjectionProxy proxy = new ProjectionProxy(); private GoogleMap mMap = null; private Context context = this; @Override protected void onCreate(Bundle load) { super.onCreate(load); setContentView(R.layout.fragment_ride_tracking); //mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.myMapView)).getMap(); mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context); mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); mMap

Zoom on current user location displayed

别说谁变了你拦得住时间么 提交于 2019-11-28 11:42:53
问题 I'm using the Google Maps for Android v2. I would like to display the current user location and zoom on it. Here is the code in the FragmentActivity : @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_activity); mMap = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.mapFragment_mapActivity)).getMap(); if (mMap == null) { Toast.makeText(this, R.string.mapCreationProblem, Toast.LENGTH_LONG)

Google Maps API v2: How to make markers non-clickable?

爱⌒轻易说出口 提交于 2019-11-28 11:17:34
I mean if i click marker OnMarkerClickListener is called, so the OnMapClickListener did not. Even if i set mMap.setOnMarkerClickListener(null); marker object still masks all click events for underlying map and objects. How can i set Marker transparent for all user interractions? This is indeed a "limitation" of markers as of 3.1.59 version of the library. If you really need them to be markers, please post a feature request on gmaps-api-issues for MarkerOptions.clickable and Marker.setClickable . If you can, consider using other visual objects, e.g. GroundOverlay . The only problem is they all

Google map android API V2 crashed

让人想犯罪 __ 提交于 2019-11-28 10:22:10
I want to load the google map API on my android. I try everything I search but it still crash. this is my MainActivity.java package com.example.androidmapsv2; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Show the