Search in sources :

Example 31 with MapComposer

use of au.org.emii.portal.composer.MapComposer in project spatial-portal by AtlasOfLivingAustralia.

the class AreaPolygon method onClick$btnCancel.

public void onClick$btnCancel(Event event) {
    MapComposer mc = getMapComposer();
    if (layerName != null && mc.getMapLayer(layerName) != null) {
        mc.removeLayer(layerName);
    }
    this.detach();
}
Also used : MapComposer(au.org.emii.portal.composer.MapComposer)

Example 32 with MapComposer

use of au.org.emii.portal.composer.MapComposer in project spatial-portal by AtlasOfLivingAustralia.

the class AreaMapPolygon method onCheck$rgPolygonLayers.

public void onCheck$rgPolygonLayers(Event event) {
    Radio selectedItem = rgPolygonLayers.getSelectedItem();
    //Add and remove layer to set as top layer
    String layerName = selectedItem.getValue();
    MapComposer mc = getMapComposer();
    MapLayer ml = mc.getMapLayer(layerName);
    mc.removeLayer(layerName);
    mc.activateLayer(ml, true);
}
Also used : MapComposer(au.org.emii.portal.composer.MapComposer) MapLayer(au.org.emii.portal.menu.MapLayer) Radio(org.zkoss.zul.Radio)

Example 33 with MapComposer

use of au.org.emii.portal.composer.MapComposer in project spatial-portal by AtlasOfLivingAustralia.

the class OpenFacetsEvent method onEvent.

@Override
public void onEvent(Event event) throws Exception {
    MapComposer mc = (MapComposer) event.getPage().getFellow(StringConstants.MAPPORTALPAGE);
    MapLayer mapLayer = mc.getMapLayer(layerName);
    if (mapLayer != null) {
        if (StringConstants.GRID.equals(mapLayer.getColourMode())) {
            mapLayer.setColourMode("-1");
            mc.updateLayerControls();
        }
        Events.echoEvent("openFacets", mc, null);
    }
}
Also used : MapComposer(au.org.emii.portal.composer.MapComposer) MapLayer(au.org.emii.portal.menu.MapLayer)

Example 34 with MapComposer

use of au.org.emii.portal.composer.MapComposer in project spatial-portal by AtlasOfLivingAustralia.

the class PredictionEvent method onEvent.

@Override
public void onEvent(Event event) throws Exception {
    MapComposer mc = (MapComposer) event.getPage().getFellow(StringConstants.MAPPORTALPAGE);
    Map<String, Object> params = new HashMap<String, Object>();
    if (speciesLayerName != null) {
        params.put(StringConstants.SPECIES_LAYER_NAME, speciesLayerName);
    } else {
        params.put(StringConstants.SPECIES_LAYER_NAME, StringConstants.NONE);
    }
    if (polygonLayerName != null) {
        params.put(StringConstants.POLYGON_LAYER_NAME, polygonLayerName);
    } else {
        params.put(StringConstants.POLYGON_LAYER_NAME, StringConstants.NONE);
    }
    if (environmentalLayerName != null) {
        params.put(StringConstants.ENVIRONMENTALLAYERNAME, environmentalLayerName);
    } else {
        params.put(StringConstants.ENVIRONMENTALLAYERNAME, StringConstants.NONE);
    }
    mc.openModal("WEB-INF/zul/tool/Maxent.zul", params, StringConstants.ADDTOOLWINDOW);
}
Also used : MapComposer(au.org.emii.portal.composer.MapComposer) HashMap(java.util.HashMap)

Example 35 with MapComposer

use of au.org.emii.portal.composer.MapComposer in project spatial-portal by AtlasOfLivingAustralia.

the class ActiveLayersLegendEventListener method onEvent.

@Override
public void onEvent(Event event) throws Exception {
    MapComposer mapComposer = getMapComposer(event);
    if (mapComposer != null && mapComposer.safeToPerformMapAction()) {
        // get reference to the label/image the user clicked on 
        Component target = event.getTarget();
        Listitem listItem = (Listitem) target.getParent().getParent();
        listItem.setSelected(true);
    } else {
        LOGGER.debug("MapController reports unsafe to perform action");
    }
}
Also used : MapComposer(au.org.emii.portal.composer.MapComposer) Listitem(org.zkoss.zul.Listitem) Component(org.zkoss.zk.ui.Component)

Aggregations

MapComposer (au.org.emii.portal.composer.MapComposer)38 MapLayer (au.org.emii.portal.menu.MapLayer)20 Listitem (org.zkoss.zul.Listitem)6 HashMap (java.util.HashMap)5 Component (org.zkoss.zk.ui.Component)5 ParseException (com.vividsolutions.jts.io.ParseException)3 JSONObject (org.json.simple.JSONObject)3 ScatterplotDataDTO (au.org.ala.spatial.dto.ScatterplotDataDTO)2 Query (au.org.ala.spatial.util.Query)2 Geometry (com.vividsolutions.jts.geom.Geometry)2 WKTReader (com.vividsolutions.jts.io.WKTReader)2 DateFormat (java.text.DateFormat)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Checkbox (org.zkoss.zul.Checkbox)2 Facet (au.org.ala.legend.Facet)1 ToolComposer (au.org.ala.spatial.composer.tool.ToolComposer)1 PortalSession (au.org.emii.portal.session.PortalSession)1 IsValidOp (com.vividsolutions.jts.operation.valid.IsValidOp)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1