Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've got exactly the same problem. The provided example</p> <pre><code>&lt;fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" map:cameraBearing="112.5" map:cameraTargetLat="-33.796923" map:cameraTargetLng="150.922433" map:cameraTilt="30" map:cameraZoom="13" map:mapType="normal" map:uiCompass="false" map:uiRotateGestures="true" map:uiScrollGestures="false" map:uiTiltGestures="true" map:uiZoomControls="false" map:uiZoomGestures="true"/&gt; </code></pre> <p>works fine, but if you try to add it into a parent element it refuses to accept the xmlns. If you move the xmlns declaration to the top element it still refuses to accept the map prefix in the fragment:</p> <pre><code>Unexpected namespace prefix "map" found for tag fragment </code></pre> <p>Now if you extend SupportMapFragment and use a custom view such as this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dp"&gt; &lt;com.google.android.gms.maps.MapView android:id="@+id/map_view" android:layout_width="match_parent" android:layout_height="match_parent" map:cameraBearing="0" map:cameraTargetLat="54.25" map:cameraTargetLng="-4.56" map:cameraTilt="30" map:cameraZoom="5.6" map:mapType="normal" map:uiCompass="true" map:uiRotateGestures="true" map:uiScrollGestures="true" map:uiTiltGestures="true" map:uiZoomControls="false" map:uiZoomGestures="true"&gt; &lt;/com.google.android.gms.maps.MapView&gt; &lt;/LinearLayout&gt; </code></pre> <p>...then it doesn't complain and the resultant map is correct. For me that raises further problems however as there are no decent examples of how to do this subclassing, you have to do more than override <strong>onCreateView</strong> and when I try to do anything to the map subsequently I get the following:</p> <pre><code>java.lang.IllegalStateException: Map size should not be 0. Most likely, layout has not yet occured for the map view. </code></pre> <p>...even if I wait 30 seconds after the map has appeared.(only first loading)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload