android-mapview

Android - Two Maps in one App

旧巷老猫 提交于 2019-12-04 17:44:22
I got an App where on main screen show google mapView. But I need also in details view show the map. I know that it is impossible to run two maps simultaneously. Everything is working when I want to show something on the main map and later in detailed view, but when I come back to main one, it stops. How to stop main map and come back later to it? Having two maps in one app produces many weird application behavior. For example, Ive had overlays from one map show up in the second map. That said, it is possible to have two maps in one application without the above happening. What you need to do

RecyclerView / MapView crashes when rotating device

三世轮回 提交于 2019-12-04 17:44:02
I have a Android.Support.V4.Fragment that contains both a MapView and a RecyclerView . These are separate views in the Fragment . The app crashes when the device is rotated: Android.OS.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v7.widget.RecyclerView$SavedState I am passing the lifecycle methods to the MapView as required by the docs: private MapView mapView; private RecyclerView myRecyclerView; private RecyclerView.LayoutManager myLayoutManager; public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

Google Maps v2 Error on use of setMyLocationEnabled

筅森魡賤 提交于 2019-12-04 15:28:53
I am not sure were I went wrong, getting a nullPointerException on using googlemap.setMyLocationEnabled(true) in Google Map v2 example. MainActivity.java File: package com.example.locationgooglemapsv2; import java.io.IOException; import java.util.List; import android.content.Context; import android.location.Address; import android.location.Criteria; import android.location.Geocoder; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app

Google Map Android API v2 : GoogleMap is null

▼魔方 西西 提交于 2019-12-04 13:53:34
问题 I'm trying to explore using the MapView class for GoogleMap display, with no luck, as most codes examples are using MapFragment which I do not want. I am using Google Maps Android API v2. At first, just for testing with here from Google's example, I managed to get the typical normal map to display. public class POnlineMapView extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.online_map_activity); } }

How to change the marker for the overlay on tap for android?

匆匆过客 提交于 2019-12-04 10:40:43
问题 i have made an application in which i need to change the drawable of an overlayitem when a user clicks on it. i am using the following code to achieve this effect: protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); if(item.getTitle().equals("true")){ if(item.getMarker(OverlayItem.ITEM_STATE_FOCUSED_MASK).equals(greenMarker)){ item.setMarker(orangeMarker); view1ComplainPoleList.add(item.getSnippet()); Log.i("adding",item.getSnippet()); map.invalidate(); } else{ item

to view route between two points in map +iphone+Mapkit

被刻印的时光 ゝ 提交于 2019-12-04 09:51:44
问题 i want to get the route between the two point in the mapkit! i had done some google work n found this :-http://spitzkoff.com/craig/?p=108 I had used this to display map and pin:- - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBarHidden=NO; self.title=@"Map"; CLLocationCoordinate2D location; location.latitude=[latLabel doubleValue]; location.longitude=[longLabel doubleValue]; MKCoordinateRegion region;// = MKCoordinateRegionMakeWithDistance

two finger or pinc zoom to mapview in osmdroid

我是研究僧i 提交于 2019-12-04 09:28:29
I need help I'm trying to zoom to mapview by getting users multi touch points (firstly 2 finger touch) I know there is setMultiTouchControls() function but this is not what I want to do. I tried to explain with a picture :) it was easier than writting; The black bold arrows show the fingers' movement directions. The same situation can be considered for opposite directions.(zoom in) Ismail Sahin Finally, In osmdroid 3.0.10 this feature had been implemented. mapView.setBuiltInZoomControls(true); mapView.setMultiTouchControls(true); 来源: https://stackoverflow.com/questions/15159544/two-finger-or

Google map in android,display in small size mapview

江枫思渺然 提交于 2019-12-04 06:43:57
I want to display location in map view & map size should be 200X200. I tried loading map in mapview but its not displaying properly after tapping on direction pointer 2 to 3 times its displaying correct map but not moving. But when I use complete size of screen for displaying map without changing any code it's loading correctly.How can i display same iin small view? map code- static GoogleMap map; private MapView mapView; MapsInitializer.initialize(getApplicationContext()); switch (GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()) ) { case ConnectionResult.SUCCESS:

OnClickListener for pushpin

元气小坏坏 提交于 2019-12-04 06:26:13
问题 Here I have used google map and an overlay. I have used an image of pushpin to point to the GeoPoint. I want to set an OnClickListener event for the push pin. When user touches the pin, I want to toast a message. Below is the code. import java.util.List; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import android.graphics.Bitmap;

Create a map with colored polygons and coordinate points by using a .shp file in combination with another dataframe with coordinates

非 Y 不嫁゛ 提交于 2019-12-04 06:02:06
问题 I have the following map boundaries in this .gdb folder and here I have a csv which contains the variables that I want to plot and the coordinates of the points that need to be displayed on the map. My final goal is to create a map with polygons and inside every polygon there should be points according to the coordinates. Every polygon should be colored according to the count of studentid (students) for the year 2019. Any alternative is accepted I believe that the 1st code chunk below is