Search in sources :

Example 1 with MoveEndHandler

use of com.googlecode.gwtmapquest.transaction.event.MoveEndHandler in project opennms by OpenNMS.

the class MapQuestMapPanel method initializeMap.

/**
     * <p>initializeMap</p>
     */
private void initializeMap() {
    m_map = MQATileMap.newInstance(m_mapHolder.getElement());
    m_map.addControl(MQALargeZoomControl.newInstance());
    m_map.setZoomLevel(1);
    m_map.setCenter(MQALatLng.newInstance("0,0"));
    m_map.addMoveEndHandler(new MoveEndHandler() {

        @Override
        public void onMoveEnd(final MoveEndEvent event) {
            m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
        }
    });
    m_map.addClickHandler(new com.googlecode.gwtmapquest.transaction.event.ClickHandler() {

        @Override
        public void onClicked(final com.googlecode.gwtmapquest.transaction.event.ClickEvent event) {
            m_clickCounter.incrementCounter(event.getLL());
        }
    });
    m_map.addDblClickHandler(new DblClickHandler() {

        @Override
        public void onDblClicked(DblClickEvent event) {
            m_clickCounter.incrementCounter(event.getLL());
        }
    });
    m_map.addZoomEndHandler(new ZoomEndHandler() {

        @Override
        public void onZoomEnd(ZoomEndEvent event) {
            m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
        }
    });
    m_map.addShapeAddedHandler(new ShapeAddedHandler() {

        @Override
        public void onShapeAdded(ShapeAddedEvent event) {
            Element mqPoiDiv = DOM.getElementById("mqpoidiv");
            Element markerElement = Element.as(mqPoiDiv.getLastChild());
            updatePOILayer(markerElement);
        }
    });
    Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            syncMapSizeWithParent();
        }
    });
}
Also used : DblClickEvent(com.googlecode.gwtmapquest.transaction.event.DblClickEvent) MapPanelBoundsChangedEvent(org.opennms.features.poller.remote.gwt.client.events.MapPanelBoundsChangedEvent) ShapeAddedHandler(com.googlecode.gwtmapquest.transaction.event.ShapeAddedHandler) Element(com.google.gwt.dom.client.Element) MoveEndEvent(com.googlecode.gwtmapquest.transaction.event.MoveEndEvent) ZoomEndEvent(com.googlecode.gwtmapquest.transaction.event.ZoomEndEvent) MoveEndHandler(com.googlecode.gwtmapquest.transaction.event.MoveEndHandler) ResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent) ShapeAddedEvent(com.googlecode.gwtmapquest.transaction.event.ShapeAddedEvent) DblClickHandler(com.googlecode.gwtmapquest.transaction.event.DblClickHandler) ResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler) ZoomEndHandler(com.googlecode.gwtmapquest.transaction.event.ZoomEndHandler)

Aggregations

Element (com.google.gwt.dom.client.Element)1 ResizeEvent (com.google.gwt.event.logical.shared.ResizeEvent)1 ResizeHandler (com.google.gwt.event.logical.shared.ResizeHandler)1 DblClickEvent (com.googlecode.gwtmapquest.transaction.event.DblClickEvent)1 DblClickHandler (com.googlecode.gwtmapquest.transaction.event.DblClickHandler)1 MoveEndEvent (com.googlecode.gwtmapquest.transaction.event.MoveEndEvent)1 MoveEndHandler (com.googlecode.gwtmapquest.transaction.event.MoveEndHandler)1 ShapeAddedEvent (com.googlecode.gwtmapquest.transaction.event.ShapeAddedEvent)1 ShapeAddedHandler (com.googlecode.gwtmapquest.transaction.event.ShapeAddedHandler)1 ZoomEndEvent (com.googlecode.gwtmapquest.transaction.event.ZoomEndEvent)1 ZoomEndHandler (com.googlecode.gwtmapquest.transaction.event.ZoomEndHandler)1 MapPanelBoundsChangedEvent (org.opennms.features.poller.remote.gwt.client.events.MapPanelBoundsChangedEvent)1