All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mapbox.mapboxsdk.events.ScrollEvent Maven / Gradle / Ivy

package com.mapbox.mapboxsdk.events;

import com.mapbox.mapboxsdk.views.MapView;

/**
 * The event generated when a map has finished scrolling to the coordinates
 * (x,y).
 */
public class ScrollEvent implements MapEvent {
    protected MapView source;
    protected int x;
    protected int y;
    protected boolean userAction;

    public ScrollEvent(final MapView aSource, final int ax, final int ay, final boolean userAction) {
        this.source = aSource;
        this.x = ax;
        this.y = ay;
        this.userAction = userAction;
    }

    /**
     * Return the map which generated this event.
     */
    public MapView getSource() {
        return source;
    }

    /**
     * Return the x-coordinate scrolled to.
     */
    public int getX() {
        return x;
    }

    /**
     * Return the y-coordinate scrolled to.
     */
    public int getY() {
        return y;
    }

    /**
     * @return true if it was a user action (touch action).
     */
    public boolean getUserAction() {
        return userAction;
    }

    @Override
    public String toString() {
        return "ScrollEvent [source=" + source + ", x=" + x + ", y=" + y + "]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy