Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I do onTap that doesn't require a longpress, but still have longpress enabled for other events?
    primarykey
    data
    text
    <p>Currently I have a series of markers on a google map. I want to be able to get the latitude and longitude from anywhere I longclick on the map and I want to open a message box dialog when I quick click on a marker. My issue is that by setting up longpress to work it makes it so my onTap function only gets called when I longclick. Is it possible for longlick to work only when I'm not clicking on a marker?</p> <pre><code>@Override public boolean onTouchEvent(MotionEvent event, MapView mapView) { return gestureScanner.onTouchEvent(event); //return false; } //////////////////////////////////// // Handle the clicking of a marker // //////////////////////////////////// @Override protected boolean onTap(int index) { System.out.println("OnTap"); OverlayItem item = mOverlays.get(index); int localLat = item.getPoint().getLatitudeE6(); int localLong = item.getPoint().getLongitudeE6(); AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); // Get the titles dialog.setTitle(item.getTitle()); // Get the text for the message //dialog.setMessage(item.getSnippet()); dialog.setMessage("Latitude: " + localLat + "\nLongitude: " + localLong); dialog.setNeutralButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); dialog.show(); return true; } @Override public void onLongPress(MotionEvent e) { long downTime = e.getDownTime(); System.out.println("Down time: " + downTime); System.out.println("LongPress Registered"); GeoPoint p = localMapView.getProjection().fromPixels((int) e.getX(), (int) e.getY()); System.out.println("Latitude = " + p.getLatitudeE6() + " Longitude: " + p.getLongitudeE6()); } </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.
    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