Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have to implement Custom marker; It is like this:</p> <pre><code>custommarker.xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:background="#ADD8E6" android:gravity="center_vertical|center_horizontal" android:orientation="horizontal" &gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:adjustViewBounds="true" android:contentDescription="@string/app_name" android:src="@drawable/sabarmati" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/snippet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dp" android:textColor="@android:color/black" android:textSize="15sp" /&gt; &lt;TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dp" android:textColor="@android:color/black" android:textSize="10sp" android:textStyle="bold" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>Activity:</p> <pre><code>public class PlacesMapActivity extends android.support.v4.app.FragmentActivity implements OnClickListener, LocationListener { /** * Note that this may be null if the Google Play services APK is not * available. */ ImageButton btn_home; private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); SupportMapFragment fragment = (SupportMapFragment)getSupportFragmentManager() .findFragmentById(R.id.map); mMap = fragment.getMap(); mMap.setMyLocationEnabled(true); // mMap = ((SupportMapFragment) getSupportFragmentManager() // .findFragmentById(R.id.map)).getMap(); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.title("First Location"); markerOptions.snippet("This Is Test Location"); LatLng latlng = new LatLng(23.0333, 72.6167); markerOptions.position(latlng); // markerOptions.title("Ahmedabad Cordinat Found here"); // Marker m = mMap.addMarker(markerOptions); ***mMap.setInfoWindowAdapter(new InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker marker) { View myContentView = getLayoutInflater().inflate( R.layout.custommarker, null); TextView tvTitle = ((TextView) myContentView .findViewById(R.id.title)); tvTitle.setText(marker.getTitle()); TextView tvSnippet = ((TextView) myContentView .findViewById(R.id.snippet)); tvSnippet.setText(marker.getSnippet()); return myContentView; } });*** mMap.addMarker(new MarkerOptions() .position(latlng) .title("This is Sabarmati Ashram") .snippet("Ahmedabad") .icon(BitmapDescriptorFactory .defaultMarker(BitmapDescriptorFactory.HUE_RED))); mMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker arg0) { // TODO Auto-generated method stub Intent intent = new Intent(getBaseContext(), DetailsOfPlacesActivity.class); startActivity(intent); } }); btn_home = (ImageButton) findViewById(R.id.activity_map_ibtn_home); btn_home.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub finish(); } }); } } </code></pre>
    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.
    3. VO
      singulars
      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