Code Monkey home page Code Monkey logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 31, 2024

Original comment by neilboyd on 26 Apr 2010 at 7:16

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from osmdroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 31, 2024
I've done this.

In OpenStreetMapView.java:

       /**
     * Zooms in at pixel centered at touchX, touchY
     * @param touchX
     * @param touchY
     */
    public void zoomInCentered(float touchX, float touchY) {
        GeoPoint center = this.getProjection().fromPixels(touchX, touchY);
        setMapCenter(center);
        zoomIn();
    }

and then hooking up the method:

private class OpenStreetMapViewDoubleClickListener implements 
GestureDetector.OnDoubleTapListener {
        public boolean onDoubleTap(MotionEvent e) {
            Log.i("double tap", "Double tap! " + e);
            OpenStreetMapView.this.zoomInCentered(e.getX(), e.getY());
            return true;
        }
        public boolean onDoubleTapEvent(MotionEvent e) {
            return false;
        }
        public boolean onSingleTapConfirmed(MotionEvent e) {
            return false;
        }
    }

in variable fields:
    protected final GestureDetector.OnDoubleTapListener doubleTap = new OpenStreetMapViewDoubleClickListener();

In constructor:

    this.mGestureDetector.setOnDoubleTapListener(doubleTap);

Works fine.

Original comment by [email protected] on 23 Jul 2010 at 8:22

from osmdroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 31, 2024
This issue was closed by revision r303.

Original comment by neilboyd on 26 Jul 2010 at 10:56

  • Changed state: Fixed

from osmdroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 31, 2024
It should really fix the point that was double-tapped, not center on it - 
that's what Google Maps does. But this is good enough for a start.

Original comment by neilboyd on 26 Jul 2010 at 10:58

from osmdroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.