Package org.zkoss.openlayers.base

Examples of org.zkoss.openlayers.base.Bounds


        toMap(pair("layers", "nexrad-n0r-wmst"),
            pair("transparent", true), pair("format", "image/png"),
            pair("time", "2005-08-29T13:00:00Z")));
    map.addLayer(ia_wms);
    map.addControl(new LayerSwitcher());
    map.zoomToExtent(new Bounds(-100.898437,22.148438,-78.398437,39.726563), false);
  }
View Full Code Here


       
        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);
View Full Code Here

  public void doAfterCompose(Window comp) throws Exception {
    super.doAfterCompose(comp);
    map.setOptions(toMap(
        pair("projection", "EPSG:900913"),
        pair("units", "m"),
        pair("maxExtent", new Bounds(-20037508.34, -20037508.34,
            20037508.34, 20037508.34)),
        pair("maxResolution", 156543.0339)));

    map.addLayer(new OSM());
    String[] matrixIds = new String[26];
View Full Code Here

        "http://vmap0.tiles.osgeo.org/wms/vmap0", toMap(pair("layers",
            "basic")));
    Vector boxes = new Vector("Boxes");

    for (int i = 0; i < box_extents.length; i++) {
      Bounds bounds = Bounds.fromArray(new ArrayList(box_extents[i]));
      org.zkoss.openlayers.feature.Vector box = new org.zkoss.openlayers.feature.Vector(
          bounds.toGeometry());
      boxes.addFeature(box);
    }

    map.addLayers(Arrays.asList(ol_wms, boxes));
    map.addControl(new LayerSwitcher());
View Full Code Here

    map.setOptions(toMap(
        pair("projection", new Projection("EPSG:900913")),
        pair("displayProjection", new Projection("EPSG:4326")),
        pair("units", "m"),
        pair("maxResolution", 156543.0339),
        pair("maxExtent", new Bounds(-20037508, -20037508, 20037508,
            20037508))));

    map.addLayer(new Google("Google Layer", toMap(pair(
        "sphericalMercator", true))));

    // prepare to style the data
    StyleMap styleMap = new StyleMap(toMap(pair("strokeColor", "black"),
        pair("strokeWidth", 2), pair("strokeOpacity", 0.5),
        pair("fillOpacity", 0.2)));

    // create a color table for state FIPS code
    String[] colors = new String[] { "red", "orange", "yellow", "green",
        "blue", "purple" };
    String code;
    Map<String, Map<String, String>> fips = new HashMap<String, Map<String, String>>();
    for (int i = 1; i <= 66; ++i) {
      code = "0" + i;
      code = code.substring(code.length() - 2);
      fips.put(code, toMap(pair("fillColor", colors[i % colors.length])));
    }
    // add unique value rules with your color lookup
    styleMap.addUniqueValueRules("default", "STATE_FIPS", fips, null);

    // create a vector layer using the canvas renderer (where available)
    map.addLayer(new Vector(
        "States",
        toMap(pair("strategies", new Object[] { new BBOX() }),
          pair("protocol",
          new WFS(toMap(pair("version", "1.1.0"),
              pair("srsName", "EPSG:900913"),
              pair("url",
                "http://v2.suite.opengeo.org/geoserver/wfs"),
              pair("featureType", "states"),
              pair("featureNS",
                "http://usa.opengeo.org")))),
            pair("styleMap", styleMap),
            pair("renderers",
              new String[] { "Canvas", "SVG", "VML" }))));

    // if you want to use Geographic coords, transform to ESPG:900913
    map.zoomToExtent(new Bounds(-73.839111, 40.287907, -68.214111,
        44.441624).transform(map.getDisplayProjection(),
        map.getProjection()), false);

  }
View Full Code Here

    String apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
    Map options = toMap(
        pair("projection", "EPSG:900913"),
        pair("units", "m"),
        pair("maxResolution", 156543.0339),
        pair("maxExtent", new Bounds(-20037508, -20037508, 20037508,
            20037508)));
    map.setOptions(options);
   
    // OpenLayers.Layer.MultiMap is deprecated, use Bing instead.
    Layer ve = new Bing(toMap(pair("key", apiKey),
View Full Code Here

TOP

Related Classes of org.zkoss.openlayers.base.Bounds

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.