GoogleMap setOnMapClickListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GoogleMap setOnMapClickListener method.

This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
7
CodeRank
This code example shows how to use the following methods:moveCamera, setOnCameraChangeListener, setOnInfoWindowClickListener, setOnMapClickListener, setOnMarkerClickListener
package com.example.amusementfinder; 
 
import android.app.Activity; 
import android.os.Bundle; 
import android.support.v4.app.FragmentTransaction; 
import android.util.AttributeSet; 
import android.util.Log; 
import android.widget.Toast; 
 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.GoogleMap.OnCameraChangeListener; 
import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; 
import com.google.android.gms.maps.GoogleMap.OnMapClickListener; 
import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.CameraPosition; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.Marker; 
import com.google.android.youtube.player.YouTubeApiServiceUtil; 

6
CodeRank
This code example shows how to use the following methods:addPolygon, setMyLocationEnabled, setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
		} 
		 
	} 
	 
	private void setUpMap() { 
		mMap.setOnMapClickListener(this);
		mMap.setOnMapLongClickListener(this);
		mMap.setOnCameraChangeListener(this);
		mMap.setOnMarkerDragListener(this);
		mMap.setOnMarkerClickListener(this);
		mMap.setMyLocationEnabled(true); //shows the location button and enables it	
		options.add(new LatLng(0,0));
		poly = mMap.addPolygon(options
				.strokeWidth(2)
                .strokeColor(Color.BLACK)
                .fillColor(0x7FB5B1E0));
	} 
	@Override 
    protected void onPause() { 
        super.onPause(); 
6
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
6
CodeRank
This code example shows how to use the following methods:setMyLocationEnabled, setOnMapClickListener, setOnMarkerClickListener, setOnMarkerDragListener
		// Map 
		if (mMap == null && mapFragment != null) {
			mMap = mapFragment.getMap();
 
			// Location 
			mMap.setMyLocationEnabled(true);
 
			// Listeners 
			mMap.setOnMapClickListener(this);
			mMap.setOnMarkerClickListener(this);
			mMap.setOnMarkerDragListener(this);
		} 
 
	} 
 
	// ************************************************ // 
	// **************** OVERRIDE BUSINESS ************* // 
	// ************************************************ // 
 
	/* ****************** OnMapClickListener ******************** */ 
5
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
5
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
5
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
5
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
5
CodeRank
This code example shows how to use the following methods:setOnCameraChangeListener, setOnMapClickListener, setOnMapLongClickListener
            } 
        } 
    } 
 
    private void setUpMap() { 
        mMap.setOnMapClickListener(this);
        mMap.setOnMapLongClickListener(this);
        mMap.setOnCameraChangeListener(this);
    } 
 
    @Override 
    public void onMapClick(LatLng point) {
        mTapTextView.setText("tapped, point=" + point);
    } 
 
    @Override 
    public void onMapLongClick(LatLng point) {
        mTapTextView.setText("long pressed, point=" + point);
    } 
 
5
CodeRank

Related GoogleMap setOnMapClickListener Questions & Answers:

setOnMapClickListener Method Overview
Sets a callback that's invoked when the map is tapped.
See Code Examples for other Android GoogleMap Methods: