I have a fragment containing a MapView. I added this view to the XML file as follows:
<?xml version="1.0" encoding="utf-8"?> <com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" map:uiCompass="true" android:background="#00000000" />
And I linked it with my code as follows:
public class HotSpotsFragment extends MainFragment implements LocationListener { private static final String TAG = "HotSpotsFragment"; private Context context; private LocationManager locationManager; private MapView mapView; private GoogleMap googleMap; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
I want to add to add options to my map view. Based on what was mentioned in GoogleMapOptions , "These parameters can be used when adding a map to your application programmatically (unlike XML). If you use MapFragment, you can pass these parameters using the static factory newInstance (GoogleMapOptions) method. If you use MapView, you can pass these parameters using the MapView constructor (Context, GoogleMapOptions). " and finally my case, " If you add a map using XML, you can apply these parameters using custom XML tags. "
I have not found a single example to show how to add parameters via XML. I want to add zOrderOnTop = "true" to my XML code.
Any suggestion will be appreciated. Thanks
source share