You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.map.events.

Class MapClickEvent

    • Constructor Detail

      • MapClickEvent

        public MapClickEvent​(Map source,
                             boolean fromClient,
                             @EventData("event.detail.coordinate")
                             elemental.json.JsonArray coordinate,
                             @EventData("event.detail.features.map(feature => feature.feature.id)")
                             elemental.json.JsonArray featureIds,
                             @EventData("event.detail.features.map(feature => feature.layer.id)")
                             elemental.json.JsonArray layerIds,
                             @EventData("event.detail.originalEvent.pageX")
                             int pageX,
                             @EventData("event.detail.originalEvent.pageY")
                             int pageY,
                             @EventData("event.detail.originalEvent.altKey")
                             boolean altKey,
                             @EventData("event.detail.originalEvent.ctrlKey")
                             boolean ctrlKey,
                             @EventData("event.detail.originalEvent.metaKey")
                             boolean metaKey,
                             @EventData("event.detail.originalEvent.shiftKey")
                             boolean shiftKey,
                             @EventData("event.detail.originalEvent.button")
                             int button)
    • Method Detail

      • getCoordinate

        public Coordinate getCoordinate()

        Gets the coordinate of the click on viewport

        Returns:

        coordinate of the click, in the view's projection.

      • getFeatures

        public List<FeatureEventDetails> getFeatures()

        List of map features at the clicked position. Can be used to distinguish whether the click was on the background, or on a feature. The features are sorted by their display order, meaning the top-most feature is the first item in the list.

        Returns:

        the list of features at the clicked position, or an empty list otherwise

      • getMouseDetails

        public MouseEventDetails getMouseDetails()

        Gets the click's mouse event details.

        Returns:

        mouse event details