android-maps

Saving MapFragment (Maps v2) State in Android

你。 提交于 2019-12-01 15:02:14
I'm working with the new GoogleMaps API (v2) and have some problems with the fragment. I have two fragments in my app (Map, List) and the user can switch between them. Works fine so far with this code: if (itemPosition == 0) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myMapFragment).commit(); } else if (itemPosition == 1) { getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentpos, myListFragment).commit(); }...... When I work with the map, switch to the list fragment and then back to the map fragment, the last position of the map is not saved.

URI for Google Maps Intent with waypoints

六月ゝ 毕业季﹏ 提交于 2019-12-01 14:32:39
I would like to add to my app ability to open Google Maps app with more than 2 points but I can only set start point and end point. How to add waypoints? I've tried uri as described in https://stackoverflow.com/a/13565504/3626048 but it's not working. In Google Maps doc https://developers.google.com/maps/documentation/android/intents there's also nothing about it. Is it even possible to add waypoints to Google Maps intent? I think you can use +to:waypoint after the destination address. For example: https://www.google.com/maps?saddr=San+Francisco&daddr=GooglePlex+Mountain+View+to:San+Jose Or:

Best Way to Add Map Pins to Google Map Android

断了今生、忘了曾经 提交于 2019-12-01 12:42:36
I have been successful at adding the pins but I need the pins to be refreshed when the user clicks on the map and provides a new location, I get an error. Keep in mind that I need this to happen in the background so that it does not affect the map interaction. My problem is that when the user clicks on the map the list of map pins is already being updated and I get an ConcurrentModificationException error. Basically, I have a JSONArray which has locations. I need each location to be on the map and when the new location is touched the pins are updated and the old pins are cleared. Any

Best Way to Add Map Pins to Google Map Android

[亡魂溺海] 提交于 2019-12-01 10:43:02
问题 I have been successful at adding the pins but I need the pins to be refreshed when the user clicks on the map and provides a new location, I get an error. Keep in mind that I need this to happen in the background so that it does not affect the map interaction. My problem is that when the user clicks on the map the list of map pins is already being updated and I get an ConcurrentModificationException error. Basically, I have a JSONArray which has locations. I need each location to be on the

Android Google map v2 in tab Overlapping issue, Multiple map in tab

这一生的挚爱 提交于 2019-12-01 06:34:52
I am new to android, now am working with Google maps v2, I have used tabhost to show Google map v2, In this tabhost i need to show two Google maps v2 on different tab. When i switch the tab b/w two tabs which contain map, it get overlapped. I don't know to overcome this issue. //code is here for both tab mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setMyLocationEnabled(true); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); //locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME,

Android Google map v2 in tab Overlapping issue, Multiple map in tab

懵懂的女人 提交于 2019-12-01 05:06:13
问题 I am new to android, now am working with Google maps v2, I have used tabhost to show Google map v2, In this tabhost i need to show two Google maps v2 on different tab. When i switch the tab b/w two tabs which contain map, it get overlapped. I don't know to overcome this issue. //code is here for both tab mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setMyLocationEnabled(true); locationManager = (LocationManager) getSystemService(Context

How to refresh Google map.

牧云@^-^@ 提交于 2019-12-01 04:48:38
Hi Guys this is my code. I am able to refresh the google map on refresh button click but it is showing me the old coordinates and in some area it is show the rectangle image with cross image in it.. So guys please let me know where is the error or what modification i have to do in it. public class GmapActivity extends MapActivity {Mapview map;Button btnrefresh;Button btnbacktolist; int chargenumber=0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gmapactivity); final

How to refresh Google map.

一个人想着一个人 提交于 2019-12-01 03:34:11
问题 Hi Guys this is my code. I am able to refresh the google map on refresh button click but it is showing me the old coordinates and in some area it is show the rectangle image with cross image in it.. So guys please let me know where is the error or what modification i have to do in it. public class GmapActivity extends MapActivity {Mapview map;Button btnrefresh;Button btnbacktolist; int chargenumber=0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle

Map v2 SupportMapFragment inside Viewpager

懵懂的女人 提交于 2019-11-30 11:33:52
问题 Background I have successfuflly added the new map api v2.0 to a ViewPager and the map loads fine. I am using the FragmentViewPager. I run into trouble however when trying to add markers as I cannot get the Fragment by tag as the ViewPager I am using is from the compatibility library and defined in XML, and this "hides" the tag from me. The Question How can I load the new Map v2 with markers SupportMapFragment into a ViewPager that uses a FragmentPagerAdapter . My Attempt So in my nievety I

Android: Setting Zoom Level in Google Maps to include all Marker points

有些话、适合烂在心里 提交于 2019-11-30 10:19:34
问题 I am trying to set zoom level for Maps in android such that it includes all the points in my list. I am using following code. int minLatitude = Integer.MAX_VALUE; int maxLatitude = Integer.MIN_VALUE; int minLongitude = Integer.MAX_VALUE; int maxLongitude = Integer.MIN_VALUE; // Find the boundaries of the item set // item contains a list of GeoPoints for (GeoPoint item : items) { int lat = item.getLatitudeE6(); int lon = item.getLongitudeE6(); maxLatitude = Math.max(lat, maxLatitude);