supportmapfragment

Google Maps Android API v2 detect long press on map and add marker not working

拟墨画扇 提交于 2019-12-05 00:21:06
I want to add a marker on map with long press. Toast in onMapClick() was display with normal tap. But long press is not working. Toast in onMapLongClick() is not displayed with long press. Also marker is not displayed on map. I'm using SupportMapFragment because I want to use my application on Android 2.x devices. I have tested my app on Nexus One which has Android version 2.3.7. This is my code. public class MainActivity extends FragmentActivity implements OnMapClickListener, OnMapLongClickListener { final int RQS_GooglePlayServices = 1; private GoogleMap myMap; Location myLocation; @Override

Synchronize ListFragment and SupportMapFragment selection

青春壹個敷衍的年華 提交于 2019-12-04 19:31:06
I have 2 views of essentially the same data: List of items in a android.support.v4.app. ListFragment Markers on a map in a com.google.android.gms.maps. SupportMapFragment Both of the above are using loader pattern to obtain the same data (extending LoaderCallbacks , querying ContentProvider , and so on) Both are hosted within a single activity inside a ViewPager. What will be the best strategy to synchronize currently selected list item / marker for both of these fragments? (Think of "My Places" edit UI, or "Directions" of the Google Maps with their left-hand pane and a map in the center).

Differences between MapView, MapFrament and SupportMapFragment

六月ゝ 毕业季﹏ 提交于 2019-12-04 18:21:52
问题 I would know the differences because I'm developing an app and I would introduce Google Map API v2 for compiling above Android 2.3. Which should I use? 回答1: MapView: A View which displays a map (with data obtained from the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map. Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. Use it if you are

Google Maps API V2 android app on API level 8 up to 17

☆樱花仙子☆ 提交于 2019-12-04 16:02:59
I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app. now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed "project has stopped working". So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1. this is the code i have for the small example exercise Any suggestions would be much appreciated My Layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=

How to save information of markers of Map v2 so that it can be retrieve on marker click

巧了我就是萌 提交于 2019-12-04 15:31:37
I am making an app which has map v2 and I am displaying multiple pins successfully. I have followed an tutorial which was just displaying the pin/markers on map v2. Through service I am getting information of Marker showing the Hotels location on map . The service is sending me the information which include Hotel Name, Location , Food , Services , rating and Latitude and longitude.so let me explain what I have done so far what I am doing is getting each hotel specification in my asynctask and in this I am calling the following method to add marker addMarker(Double.parseDouble(latitude), Double

Android GoogleMap or SupportMapFragment - null pointer exception

≡放荡痞女 提交于 2019-12-04 14:01:28
问题 In my app i showing google map version2 in a fragment. but i get Null pointer exception at mMap = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); This is my full code: public class SearchResultMap extends Fragment{ private GoogleMap mMap; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View fragmentView

getMap() in onCreate(), created from layout gives nullpointerexception

僤鯓⒐⒋嵵緔 提交于 2019-12-04 05:28:36
问题 This my code: import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; Inside onCreate() method:(I have only this at onCreate(), aside a bundle creation and variables asignation, using that bundle.) FragmentManager myFM = getSupportFragmentManager(); SupportMapFragment myMAPF =(SupportMapFragment)myFM.

Issue while using 2 map fragments in One application

夙愿已清 提交于 2019-12-03 20:09:25
I am trying to use two different Map Fragment in two different Fragment Activities. And as per the SupportMapFragment design, I am keeping the map key in the META TAG of the appilcation properties in Manifest file. However my Map view is not clearing, it is showing same map with old points in the second Fragment eventhough I am calling "getMap().clear()". Please suggest This is working fine untill and unless I dont use new MapFragment in a separate Activity, If I use new Mapfragment, it is taking the same map view, so the map view is not clearing. Code : MAP FRAGMENT public class

Differences between MapView, MapFrament and SupportMapFragment

时光怂恿深爱的人放手 提交于 2019-12-03 11:54:32
I would know the differences because I'm developing an app and I would introduce Google Map API v2 for compiling above Android 2.3. Which should I use? Ferdous Ahamed MapView: A View which displays a map (with data obtained from the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map. Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. Use it if you are going to add a map into a fragment . (you need to update each lifecycle to MapView). See Google

getSupportFragmentManager() method is undefined for type MapFragment

房东的猫 提交于 2019-12-03 08:55:39
I'm trying to implement Google Map display and below are my codes: package com.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MapFragment extends SherlockMapFragment { private GoogleMap mMap; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateView(inflater, container, savedInstanceState); SupportMapFragment mapFrag=