Note that there are some explanatory texts on larger screens.

plurals
  1. POCant see the Marker or Zoom in GoogleMap in SupportMapFragment
    primarykey
    data
    text
    <p>I have a SupportMapFragment that I want to add a simple marker to but for some reason I cant see it on the map...I dont see any error in the logcat either any idea?</p> <pre><code>public class MapUserFragment extends SupportMapFragment { private GoogleMap googleMap; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); return inflater.inflate(R.layout.map_fragment_layout, container, false); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); googleMap = getMap(); if (googleMap != null) { try { googleMap.addMarker(new MarkerOptions().position(new LatLng(27.174840, 78.042500)).title("Hello World") .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_drawer))); } catch (Exception e) { e.printStackTrace(); } } } } </code></pre> <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="fill_parent" android:layout_height="fill_parent" class="com.google.android.gms.maps.SupportMapFragment" map:uiCompass="true" map:mapType= "normal" map:uiRotateGestures="true" map:uiScrollGestures="true" map:uiTiltGestures="true" map:uiZoomControls="true" map:uiZoomGestures="true" /&gt; </code></pre> <p>google-play-services_lib manifest</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; package="com.google.android.gms" android:versionCode="3159130" android:versionName="3.1.59 (744626-30)" &gt; &lt;uses-sdk android:minSdkVersion="8"/&gt; </code></pre> <p></p> <p>MyManifest</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tailgate" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" /&gt; &lt;!-- GCM connects to Google Services. --&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;!-- GCM requires a Google account. --&gt; &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt; &lt;!-- Keeps the processor from sleeping when a message is received. --&gt; &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt; &lt;uses-permission android:name="com.tailgate.permission.MAPS_RECEIVE" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt; &lt;!-- Creates a custom permission so only this app can receive its messages. NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE, where PACKAGE is the application's package name. --&gt; &lt;permission android:name="com.tailgate.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;!-- Location permission --&gt; &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-feature android:name="android.hardware.location" android:required="true" /&gt; &lt;uses-feature android:name="android.hardware.location.gps" android:required="false" /&gt; &lt;application android:name=".TailGateApplication" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCKHkansQagp34Q5hiEEDm5XMPhT_Izntc" /&gt; &lt;/application&gt; </code></pre> <p></p> <p>Edit:</p> <p>I also cant zoom into a certain LatLong</p> <pre><code> LatLng cur_Latlng =new LatLng(31.763160705566406, 35.20343017578125); googleMap.moveCamera(CameraUpdateFactory.newLatLng(cur_Latlng)); googleMap.animateCamera(CameraUpdateFactory.zoomTo(10)); googleMap.getUiSettings().setZoomControlsEnabled(true); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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