mapfragment

Add custom button to MapFragment with the same style of Maps app

主宰稳场 提交于 2019-11-30 16:44:59
I need add some custom buttons on my MapFragment. I use this code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <!--suppress AndroidDomInspection --> <fragment android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_alignParentBottom="true" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout

Android Google Maps: disable dragging in MapFragment

☆樱花仙子☆ 提交于 2019-11-30 05:34:27
Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out? Any one please suggest an idea of doing this! Thanks for your Precious help!! I think here's what you're looking for: Inside Google Maps Android v2 Scroll (pan) gestures A user can scroll (pan) around the map by dragging the map with their finger. You can disable scrolling by calling UiSettings.setScrollGesturesEnabled(boolean). madhu sudhan You can disable dragging in MapFragment using: googleMap.getUiSettings().setScrollGesturesEnabled(false); for disable

Pulse ring animation around a Google Maps marker in Android

岁酱吖の 提交于 2019-11-30 05:19:33
I want to add a pulse ring animation on blue dot current user location in Android google mapFragment (like Uber). Can anybody help me with this thing? I have found a solution to add pulsating animation to a marker. Here is the map part, Here variable "map" denotes your map. private Circle lastUserCircle; private long pulseDuration = 1000; private ValueAnimator lastPulseAnimator; private void addPulsatingEffect(Latlng userLatlng){ if(lastPulseAnimator != null){ lastPulseAnimator.cancel(); Log.d("onLocationUpdated: ","cancelled" ); } if(lastUserCircle != null) lastUserCircle.setCenter(userLatlng

MapFragment: bad performance after using the back button

倾然丶 夕夏残阳落幕 提交于 2019-11-30 04:04:45
I have a performance issue when using MapFragment together with the action bar menu. The bug emerges when three conditions are met Have a MapFragment instantiated. Trigger a fragment transaction from the options menu, replacing the map fragment with another fragment. Hit the back button and return to the map fragment. The performance is now noticeably degraded. Panning and zooming is very jerky. Opening the options menu again and dismissing it again fixes the issue. The behavior does not arise when Triggering the fragment replacement from a view button instead from the options menu. Triggering

Google mapfragment not working in android

十年热恋 提交于 2019-11-29 17:26:36
I have made a very simple demo program for android map view (api v2) by referring the following link,But my program doesn't shows map.its not running.Please help me,My code is as below: main.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_height="match_parent" android:name="com.google.android.gms.maps.MapFragment"/> main.java package com.example.mymap; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.support.v4

Mapfragment findFragmentById always null

不羁岁月 提交于 2019-11-29 13:48:35
I have problems to access the fragment of the map. getFragmentManager().findFragmentById(R.id.map)) returns always null. I don't know why. What's the problem? Thank you! <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/tvNombreCentro" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="10dp" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge

Android SupportMapFragment Exception Error

核能气质少年 提交于 2019-11-29 04:55:34
I am trying to use the new Google Play Services Lib and embbed Maps in side the Maps Fragment as below PlaceMapsFragment.java public class PlaceMapsFragment extends SupportMapFragment { private GoogleMap mMap; private LatLng mPosFija; public PlaceMapsFragment() { super(); } public static PlaceMapsFragment newInstance(LatLng posicion) { PlaceMapsFragment frag = new PlaceMapsFragment(); frag.mPosFija = posicion; return frag; } @Override public GoogleMap getMap() { // TODO Auto-generated method stub return super.getMap(); } @Override public void onCreate(Bundle arg0) { // TODO Auto-generated

Android Google Maps: disable dragging in MapFragment

♀尐吖头ヾ 提交于 2019-11-29 04:24:16
问题 Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out? Any one please suggest an idea of doing this! Thanks for your Precious help!! 回答1: I think here's what you're looking for: Inside Google Maps Android v2 Scroll (pan) gestures A user can scroll (pan) around the map by dragging the map with their finger. You can disable scrolling by calling UiSettings.setScrollGesturesEnabled(boolean). 回答2: You can disable dragging

Android SupportMapFragment Exception Error

跟風遠走 提交于 2019-11-27 22:41:44
问题 I am trying to use the new Google Play Services Lib and embbed Maps in side the Maps Fragment as below PlaceMapsFragment.java public class PlaceMapsFragment extends SupportMapFragment { private GoogleMap mMap; private LatLng mPosFija; public PlaceMapsFragment() { super(); } public static PlaceMapsFragment newInstance(LatLng posicion) { PlaceMapsFragment frag = new PlaceMapsFragment(); frag.mPosFija = posicion; return frag; } @Override public GoogleMap getMap() { // TODO Auto-generated method

Should I use MapView or MapFragment

痞子三分冷 提交于 2019-11-27 18:19:38
I am not sure whether I should be using MapView or stick to using a MapFragment . My application is an app that finds the nearest set of places that are closest to you. I want to be able to add locations, display details of a marker when I press a marker and when the user moves along the map I want to be able to get the coordinates of the center of the map and display the nearest locations within a defined radius. Would I be at a disadvantage if I continue to use MapFragments or should I switch over to MapView while I still have the chance? Emil Adz First of all, soon the MapView and Google