/** * Set the title of this context. * * @param title the title. */ public void setTitle(final String title) { super.setTitle(title); }
/** * Set the title of this context. * * @param title * the title. */ public void setTitle(final String title){ super.setTitle(title); }
public MapContent(MapContext context) { this(); for (MapLayer mapLayer : context.getLayers()) { layerList.add(mapLayer.toLayer()); } if (context.getTitle() != null) { setTitle(context.getTitle()); } if (context.getAbstract() != null) { getUserData().put("abstract", context.getAbstract()); } if (context.getContactInformation() != null) { getUserData().put("contact", context.getContactInformation()); } if (context.getKeywords() != null) { getUserData().put("keywords", context.getKeywords()); } if (context.getAreaOfInterest() != null) { getViewport().setBounds(context.getAreaOfInterest()); } }
public class Quickstart { public static void main(String[] args) throws Exception { File file = JFileDataStoreChooser.showOpenFile("shp", null); if (file == null) { return; } FileDataStore store = FileDataStoreFinder.getDataStore(file); SimpleFeatureSource featureSource = store.getFeatureSource(); // Create a map content and add our shapefile to it MapContent map = new MapContent(); map.setTitle("Quickstart"); Style style = SLD.createSimpleStyle(featureSource.getSchema()); Layer layer = new FeatureLayer(featureSource, style); map.addLayer(layer); // Display the map JMapFrame.showMap(map); } }
@Deprecated public MapContent(MapLayer[] array, String title, String contextAbstract, String contactInformation, String[] keywords, final CoordinateReferenceSystem crs) { this(); if (array != null) { for (MapLayer mapLayer : array) { if (mapLayer == null) { continue; } Layer layer = mapLayer.toLayer(); layerList.add(layer); } } if (title != null) { setTitle(title); } if (contextAbstract != null) { getUserData().put("abstract", contextAbstract); } if (contactInformation != null) { getUserData().put("contact", contactInformation); } if (keywords != null) { getUserData().put("keywords", keywords); } if (crs != null) { getViewport().setCoordinateReferenceSystem(crs); } }
public MapContent(MapContext context) { this(); for (MapLayer mapLayer : context.getLayers()) { layerList.add(mapLayer.toLayer()); } if (context.getTitle() != null) { setTitle(context.getTitle()); } if (context.getAbstract() != null) { getUserData().put("abstract", context.getAbstract()); } if (context.getContactInformation() != null) { getUserData().put("contact", context.getContactInformation()); } if (context.getKeywords() != null) { getUserData().put("keywords", context.getKeywords()); } if (context.getAreaOfInterest() != null) { getViewport().setBounds(context.getAreaOfInterest()); } }
/** * Show the map using a JMapFrame. */ public void show() { if (KLAB.ENGINE instanceof NodeEngine) { return; } MapContent content = new MapContent(); content.setViewport(new MapViewport(space.getEnvelope())); for (SLDesc sld : sLayers.values()) { content.addLayer(sld.getLayer()); } Viewport viewport = new Viewport(800, 800); int[] xy = viewport.getSizeFor(space.getMaxX() - space.getMinX(), space.getMaxY() - space.getMinY()); content.setTitle("Spatial display"); JMapFrame display = new JMapFrame(content); display.setMinimumSize(new Dimension(xy[0] + 300, xy[1])); display.enableLayerTable(true); display.enableToolBar(true); display.enableStatusBar(true); display.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); display.setVisible(true); }