Package org.zkoss.openlayers.control

Examples of org.zkoss.openlayers.control.Control


               
        map1.addLayers(Arrays.asList(ol, jpl));
        map1.addControl(new LayerSwitcher());
       
        // create an overview map control with the default options
        Control overview1 = new OverviewMap(toMap(pair("maximized", true)));
        map1.addControl(overview1);
       
        map1.setCenter(new LonLat(0, 0), 2);
       
        // create the bottom map (with advanced overview map control)
        Map mapOptions = toMap(
            pair("maxExtent", new Bounds(-8242894.927728, 4965204.031195, -8227290.161511, 4994963.723637)),
            pair("maxResolution", 116.2487986015621),
            pair("projection", "EPSG:900913"),
            pair("units", "m")        );

       
        map2.setOptions(mapOptions);
        map2.addLayer(ny);
       
       
        // create an overview map control with non-default options
        Map controlOptions = toMap(
        pair("maximized", true),
        pair("mapOptions",
            mergeMap(mapOptions,
              pair("maxResolution", 156543.0339),
              pair("maxExtent", new Bounds(-20037508.34, -20037508.34,
                             20037508.34, 20037508.34)))
        ),
        pair("layers", Arrays.asList(jplOverview)
        ));
        Control overview2 = new OverviewMap(controlOptions);
        map2.addControl(overview2);
       
        map2.setCenter(new LonLat(-8233165.3575055, 4980298.21113769), 3);
  }
View Full Code Here


      boxes.addFeature(box);
    }

    map.addLayers(Arrays.asList(ol_wms, boxes));
    map.addControl(new LayerSwitcher());
    Control sf = new SelectFeature(boxes);
    map.addControl(sf);
    sf.activate();
    map.zoomToMaxExtent();

  }
View Full Code Here

TOP

Related Classes of org.zkoss.openlayers.control.Control

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.