Example usage for com.google.gwt.maps.client.overlays Marker addMouseDownHandler

List of usage examples for com.google.gwt.maps.client.overlays Marker addMouseDownHandler

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.overlays Marker addMouseDownHandler.

Prototype

public final HandlerRegistration addMouseDownHandler(final MouseDownMapHandler handler) 

Source Link

Document

This event is fired for a mousedown on the marker.

Usage

From source file:pl.itrack.client.local.services.maps.AbstractMapService.java

License:Apache License

void addCameraClickHandlers(Integer objectId, Marker marker) {
    marker.addClickHandler(event -> {
        if (!isMarkerLongPressed) {
            final TristarObject cameraDetails = getCameraDetails(objectId);
            showCameraDialog(cameraDetails.getName(), objectId);
        }//  w  ww  .ja  v a 2 s  .  c o  m
    });

    marker.addMouseDownHandler(event -> {
        isMarkerLongPressed = false;
        clickedMarkerRelatedObjectId = objectId;
        clickedMarker = marker;
        longPressTimer.schedule(LONG_PRESS_TIME);
    });

    marker.addMouseUpHandler(event -> longPressTimer.cancel());
}