use of com.googlecode.gwtmapquest.transaction.event.ZoomEndHandler 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();
}
});
}
Aggregations