Package org.zkoss.openlayers.base

Examples of org.zkoss.openlayers.base.StyleMap


    org.zkoss.openlayers.layer.Vector vectorLayer = new org.zkoss.openlayers.layer.Vector(
        "Simple Geometry",
        toMap(pair(
            "styleMap",
            new StyleMap(
                toMap(pair(
                    "default",
                    toMap(pair("strokeColor", "#00FF00"),
                        pair("strokeOpacity", 1),
                        pair("strokeWidth", 3),
View Full Code Here


    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() }),
View Full Code Here

TOP

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

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.