/** * fluent setter * @see #setViewBoundScale(double) * * @param viewBoundScale * required parameter */ public Icon withViewBoundScale(final double viewBoundScale) { this.setViewBoundScale(viewBoundScale); return this; }
/** * fluent setter * @see #setViewBoundScale(double) * * @param viewBoundScale * required parameter */ public Icon withViewBoundScale(final double viewBoundScale) { this.setViewBoundScale(viewBoundScale); return this; }
icon.setHref("image.png"); icon.setViewRefreshMode(ViewRefreshMode.NEVER); icon.setViewBoundScale(0.75);
protected void setDefaultIconStyle(Style style, SimpleFeature feature, KmlEncodingContext context) { // figure out if line or polygon boolean line = feature.getDefaultGeometry() != null && (feature.getDefaultGeometry() instanceof LineString || feature .getDefaultGeometry() instanceof MultiLineString); boolean poly = feature.getDefaultGeometry() != null && (feature.getDefaultGeometry() instanceof Polygon || feature .getDefaultGeometry() instanceof MultiPolygon); // Final pre-flight check if (!line && !poly) { LOGGER.log(Level.FINER, "Unexpectedly entered encodeDefaultIconStyle() " + "with something that does not have a multipoint geometry."); return; } IconStyle is = style.createAndSetIconStyle(); // make transparent if they ask for attributes, since we'll have a label if (context.isDescriptionEnabled()) { is.setColor("00ffffff"); } // if line or polygon scale the label if (line || poly) { is.setScale(0.4); } String imageURL = "http://icons.opengeo.org/markers/icon-" + (poly ? "poly.1" : "line.1") + ".png"; Icon icon = is.createAndSetIcon(); icon.setHref(imageURL); icon.setViewBoundScale(1); }
icon.setHref(getGroundOverlayHRef(layer)); icon.setViewRefreshMode(ViewRefreshMode.NEVER); icon.setViewBoundScale(0.75);