Search in sources :

Example 1 with MarkerStyleRenderer

use of com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer in project com.revolsys.open by revolsys.

the class WikipediaBoundingBoxLayerWorker method newLayer.

public static BoundingBoxRecordLayer newLayer(final Map<String, ? extends Object> config) {
    final GeometryFactory wgs84 = GeometryFactory.floating3d(4326);
    final BoundingBoxRecordLayer layer1 = new BoundingBoxRecordLayer("wikipedia", "Wikipedia Articles", WikipediaBoundingBoxLayerWorker.class, wgs84);
    final BufferedImage image = Icons.getImage("wikipedia");
    final ImageMarker marker = new ImageMarker(image);
    final MarkerStyle style = new MarkerStyle();
    style.setMarker(marker);
    layer1.setRenderer(new MarkerStyleRenderer(layer1, style));
    final BoundingBoxRecordLayer layer = layer1;
    layer.setProperties(config);
    return layer;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) MarkerStyleRenderer(com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer) MarkerStyle(com.revolsys.swing.map.layer.record.style.MarkerStyle) BufferedImage(java.awt.image.BufferedImage) BoundingBoxRecordLayer(com.revolsys.swing.map.layer.record.BoundingBoxRecordLayer) ImageMarker(com.revolsys.swing.map.layer.record.style.marker.ImageMarker)

Example 2 with MarkerStyleRenderer

use of com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer in project com.revolsys.open by revolsys.

the class GeoNamesBoundingBoxLayerWorker method newLayer.

public static BoundingBoxRecordLayer newLayer(final Map<String, ? extends Object> config) {
    final GeometryFactory wgs84 = GeometryFactory.floating3d(4326);
    final BoundingBoxRecordLayer layer = new BoundingBoxRecordLayer("geoname", "Geo Names", GeoNamesBoundingBoxLayerWorker.class, wgs84);
    final BufferedImage image = Icons.getImage("world");
    final ImageMarker marker = new ImageMarker(image);
    final MarkerStyle style = new MarkerStyle();
    style.setMarker(marker);
    layer.setRenderer(new MarkerStyleRenderer(layer, style));
    layer.setProperties(config);
    return layer;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) MarkerStyleRenderer(com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer) MarkerStyle(com.revolsys.swing.map.layer.record.style.MarkerStyle) BufferedImage(java.awt.image.BufferedImage) BoundingBoxRecordLayer(com.revolsys.swing.map.layer.record.BoundingBoxRecordLayer) ImageMarker(com.revolsys.swing.map.layer.record.style.marker.ImageMarker)

Example 3 with MarkerStyleRenderer

use of com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer in project com.revolsys.open by revolsys.

the class ArcGisRestServerRecordLayer method newSimpleMarkerRenderer.

private AbstractRecordLayerRenderer newSimpleMarkerRenderer(final MapEx symbol) {
    String markerName = symbol.getString("style", "esriSMSCirlce");
    markerName = markerName.replace("esriSMS", "").toLowerCase();
    final double markerSize = symbol.getDouble("size", 10);
    final Color markerFill = getColor(symbol);
    Color markerColor = new Color(0, 0, 0, 0);
    final MapEx outline = symbol.getValue("outline");
    double lineWidth = 0;
    if (outline != null) {
        markerColor = getColor(outline);
        lineWidth = outline.getDouble("width", lineWidth);
    }
    final MarkerStyle markerStyle = MarkerStyle.marker(markerName, markerSize, markerColor, lineWidth, markerFill);
    return new MarkerStyleRenderer(this, markerStyle);
}
Also used : MapEx(com.revolsys.collection.map.MapEx) Color(java.awt.Color) MarkerStyleRenderer(com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer) MarkerStyle(com.revolsys.swing.map.layer.record.style.MarkerStyle)

Aggregations

MarkerStyleRenderer (com.revolsys.swing.map.layer.record.renderer.MarkerStyleRenderer)3 MarkerStyle (com.revolsys.swing.map.layer.record.style.MarkerStyle)3 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)2 BoundingBoxRecordLayer (com.revolsys.swing.map.layer.record.BoundingBoxRecordLayer)2 ImageMarker (com.revolsys.swing.map.layer.record.style.marker.ImageMarker)2 BufferedImage (java.awt.image.BufferedImage)2 MapEx (com.revolsys.collection.map.MapEx)1 Color (java.awt.Color)1