Closed shoneworn closed 5 years ago
maybe I have know how to deal with it .
what version are you using?
what version are you using?
2.7.7 I have find the method . thank you !
what version are you using?
2.7.7 I have find the method . thank you !
Could you provide the method name? Looking for the same.
I'm not sure there's a built in way in that version. Basically it's getScrollX/Y + event.getX/Y. If you want to scale it, do that.
Yeah thanks. Wasn't sure which methods to use. (tileView.getScrollX() + event.getX()) / tileView.getScale()
Does the trick.
awesome, glad you figured it out
` @Override public boolean onSingleTapConfirmed( MotionEvent event ) { int x = getScrollX() + (int) event.getX() - getOffsetX(); int y = getScrollY() + (int) event.getY() - getOffsetY(); mMarkerLayout.processHit( x, y ); mHotSpotManager.processHit( x, y ); if(onSingleTapListener!=null){ onSingleTapListener.onSingleTap(x,y); } return super.onSingleTapConfirmed( event ); }
@Override public void onLongPress(MotionEvent event) { int x = getScrollX() + (int) event.getX() - getOffsetX(); int y = getScrollY() + (int) event.getY() - getOffsetY(); if(onLongPressListener!=null){ int mX =(int)( x/getScale()mCoordinateTranslater.getRight()/mDetailLevelManager.getBaseWidth()); int mY = (int)(y/getScale()mCoordinateTranslater.getBottom()/mDetailLevelManager.getBaseHeight()); onLongPressListener.onLongPress(mX,mY); } super.onLongPress(event); }` this two function is useful to listen click event . you must calculate your scale value to find real location. good luck.
when i touch tileview , if i setOnTouchListener , i just get point of window postion . how can i get the position of tileview when i touch it . So I can add a point wherever i touched .