use of com.revolsys.swing.map.layer.record.style.marker.ImageMarker 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;
}
use of com.revolsys.swing.map.layer.record.style.marker.ImageMarker 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;
}
use of com.revolsys.swing.map.layer.record.style.marker.ImageMarker in project com.revolsys.open by revolsys.
the class MarkerStyle method setMarkerFile.
public void setMarkerFile(final String markerFile) {
final Object oldMarkerFile = this.markerFile;
// TODO property change
this.markerFile = markerFile;
final Pattern pattern = Pattern.compile("url\\('?([^']+)'?\\)");
String url;
final Matcher matcher = pattern.matcher(markerFile);
if (matcher.find()) {
url = matcher.group(1);
} else {
url = markerFile;
}
if (url.toUpperCase().matches("[A-Z][A-Z0-9\\+\\.\\-]*:")) {
this.markerFileResource = Resource.getResource(url);
} else {
this.markerFileResource = Resource.getBaseResource(url);
}
firePropertyChange("markerFile", oldMarkerFile, markerFile);
setMarker(new ImageMarker(this.markerFileResource));
}
Aggregations