/** * Create an instance of {@link Icon} * */ public static Icon createIcon() { return new Icon(); }
/** * fluent setter * @see #setViewBoundScale(double) * * @param viewBoundScale * required parameter */ public Icon withViewBoundScale(final double viewBoundScale) { this.setViewBoundScale(viewBoundScale); return this; }
/** * fluent setter * @see #setViewRefreshMode(ViewRefreshMode) * * @param viewRefreshMode * required parameter */ public Icon withViewRefreshMode(final ViewRefreshMode viewRefreshMode) { this.setViewRefreshMode(viewRefreshMode); return this; }
@Override public Icon clone() { Icon copy; copy = ((Icon) super.clone()); copy.linkSimpleExtension = new ArrayList<Object>((getLinkSimpleExtension().size())); for (Object iter: linkSimpleExtension) { copy.linkSimpleExtension.add(iter); } copy.linkObjectExtension = new ArrayList<AbstractObject>((getLinkObjectExtension().size())); for (AbstractObject iter: linkObjectExtension) { copy.linkObjectExtension.add(iter.clone()); } return copy; }
go.setName("Map"); Icon icon = go.createAndSetIcon(); icon.setHref("image.png"); icon.setViewRefreshMode(ViewRefreshMode.NEVER); icon.setViewBoundScale(0.75);
public String getKMLStyle(String label, Folder folder) { if (kmlStyles.containsKey(label)) return (String) kmlStyles.get(label); int pushpingLinkCounter = kmlStylesCounter % kmlPushPings.length; int colorCounter = kmlStylesCounter % kmlColors.length; Style style = folder.createAndAddStyle().withId( String.valueOf(kmlStylesCounter)); style.createAndSetIconStyle() .withScale(1.399999976158142) .withIcon( new Icon().withHref(kmlPushPings[pushpingLinkCounter])); style.createAndSetLineStyle().withColor(kmlColors[colorCounter]) .withWidth(2); style.createAndSetPolyStyle().withColor(kmlColors[colorCounter]); kmlStyles.put(label, String.valueOf(kmlStylesCounter)); kmlStylesCounter++; return String.valueOf(kmlStylesCounter - 1); } private String getKMLLabel(SimpleFeature feature) {
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); }
void encodeGroundOverlay(Folder container, Layer layer, int drawOrder, Envelope box) { GroundOverlay go = container.createAndAddGroundOverlay(); go.setDrawOrder(drawOrder); Icon icon = go.createAndSetIcon(); String href = WMSRequests.getGetMapUrl(request, layer, 0, box, new String[] { "width", "256", "height", "256", "format", "image/png", "transparent", "true" }); icon.setHref(href); LOGGER.fine(href); // make sure the ground overlay disappears as the lower tiles activate addRegion(go, box, 128, 512); LatLonBox llBox = go.createAndSetLatLonBox(); setEnvelope(box, llBox); }
@Override public Overlay clone() { Overlay copy; copy = ((Overlay) super.clone()); copy.icon = ((icon == null)?null:((Icon) icon.clone())); copy.overlaySimpleExtension = new ArrayList<Object>((getOverlaySimpleExtension().size())); for (Object iter: overlaySimpleExtension) { copy.overlaySimpleExtension.add(iter); } copy.overlayObjectExtension = new ArrayList<AbstractObject>((getOverlayObjectExtension().size())); for (AbstractObject iter: overlayObjectExtension) { copy.overlayObjectExtension.add(iter.clone()); } return copy; }
if (icon.equals(other.icon) == false) { return false;
/** * add a value to the linkObjectExtension property collection * * @param linkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Icon addToLinkObjectExtension(final AbstractObject linkObjectExtension) { this.getLinkObjectExtension().add(linkObjectExtension); return this; }
/** * add a value to the linkSimpleExtension property collection * * @param linkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Icon addToLinkSimpleExtension(final Object linkSimpleExtension) { this.getLinkSimpleExtension().add(linkSimpleExtension); return this; }
go.setDrawOrder(mapLayerOrder); Icon icon = go.createAndSetIcon(); icon.setHref(getGroundOverlayHRef(layer)); icon.setViewRefreshMode(ViewRefreshMode.NEVER); icon.setViewBoundScale(0.75);
Icon icon = new Icon().withHref("http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png"); IconStyle validIconStyle = new IconStyle() .withIcon( icon ) .withColor(RED); Icon trackIcon = new Icon().withHref("http://earth.google.com/images/kml-icons/track-directional/track-0.png"); IconStyle trackIconStyle = new IconStyle() .withIcon( trackIcon )
protected void setInlineIconStyle(Style style, org.geotools.styling.Style sld, IconProperties properties, KmlEncodingContext context) { final String name = properties.getIconName(sld); Map<String,org.geotools.styling.Style> iconStyles = context.getIconStyles(); if (!iconStyles.containsKey(name)) { final org.geotools.styling.Style injectedStyle = IconPropertyInjector.injectProperties(sld, properties.getProperties()); iconStyles.put(name, injectedStyle); } final Double scale = properties.getScale(); final String path = "icons/" + name + ".png"; IconStyle is = style.createAndSetIconStyle(); if (properties.getHeading() != null) { is.setHeading(0.0); } if (scale != null) { is.setScale(scale); } Icon icon = is.createAndSetIcon(); icon.setHref(path); }
@Override public Icon clone() { Icon copy; copy = ((Icon) super.clone()); copy.linkSimpleExtension = new ArrayList<Object>((getLinkSimpleExtension().size())); for (Object iter: linkSimpleExtension) { copy.linkSimpleExtension.add(iter); } copy.linkObjectExtension = new ArrayList<AbstractObject>((getLinkObjectExtension().size())); for (AbstractObject iter: linkObjectExtension) { copy.linkObjectExtension.add(iter.clone()); } return copy; }
@Override public Overlay clone() { Overlay copy; copy = ((Overlay) super.clone()); copy.icon = ((icon == null)?null:((Icon) icon.clone())); copy.overlaySimpleExtension = new ArrayList<Object>((getOverlaySimpleExtension().size())); for (Object iter: overlaySimpleExtension) { copy.overlaySimpleExtension.add(iter); } copy.overlayObjectExtension = new ArrayList<AbstractObject>((getOverlayObjectExtension().size())); for (AbstractObject iter: overlayObjectExtension) { copy.overlayObjectExtension.add(iter.clone()); } return copy; }
if (icon.equals(other.icon) == false) { return false;
/** * add a value to the linkObjectExtension property collection * * @param linkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Icon addToLinkObjectExtension(final AbstractObject linkObjectExtension) { this.getLinkObjectExtension().add(linkObjectExtension); return this; }
/** * add a value to the linkSimpleExtension property collection * * @param linkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Icon addToLinkSimpleExtension(final Object linkSimpleExtension) { this.getLinkSimpleExtension().add(linkSimpleExtension); return this; }