public OverviewMap(OverviewMapController controller) { super("270px"); // XXX map needs explicit px height this.controller = controller; map.addLayer(this.markerLayer); new OverviewMapEventBroker(); }
/** * Creates the osm. */ private void createOSM() { this.osm = OSM.THIS("OpenStreetMap Preview", OpenLayers.getProxyHost() + "http://tile.openstreetmap.org/${z}/${x}/${y}.png", new OSMOptions()); ; // OSM.Mapnik("OpenStreetMap Preview"); this.map.addLayer(osm); }
private void initializeBackgroundMapLayer() { PropertiesManager properties = getPropertiesManager(); spatialReference = properties.getParameterAsString("mapSrs"); String url = properties.getParameterAsString("mapUrl"); url = url == null ? "OSM" : url; // if not set in config if ("OSM".equalsIgnoreCase(url)) { map.addLayer(initializeOSMLayer()); } else { try { map.addLayer(initializeWMSLayer(url)); } catch (Exception e) { // fallback to default String message = "Could not create WMS layer."; Toaster.getToasterInstance().addErrorMessage(message); map.addLayer(initializeOSMLayer()); } } }
/** * Inits the vector layer. */ private void initVectorLayer() { VectorOptions vectorOption = new VectorOptions(); vectorOption.setStyle(this.createStyle()); vectorOption.setDisplayInLayerSwitcher(false); this.vector = new Vector("Geofence PREVIEW Vector Layer", vectorOption); this.map.addLayer(vector); }
public StationSelectorMap(MapController controller) { super("523px"); // XXX map needs explicit height in px getMapWidget().setStylePrimaryName("n52-sensorwebclient-stationselector-map"); this.controller = controller; map.addLayer(markerLayer); try { if (isDefinedGlobalExtent()) { PropertiesManager propertiesMgr = getPropertiesManager(); double lleftX = new Double(propertiesMgr.getParameterAsString("lleftX")); double lleftY = new Double(propertiesMgr.getParameterAsString("lleftY")); double urightX = new Double(propertiesMgr.getParameterAsString("urightX")); double urightY = new Double(propertiesMgr.getParameterAsString("urightY")); EastingNorthing ll = new EastingNorthing(lleftX, lleftY, DISPLAY_PROJECTION); EastingNorthing ur = new EastingNorthing(urightX, urightY, DISPLAY_PROJECTION); defaultExtent = new BoundingBox(ll, ur); } else { GWT.log("No global extent configured. Zooming to: " + Constants.FALLBACK_EXTENT); defaultExtent = Constants.FALLBACK_EXTENT; } } catch (NumberFormatException e) { GWT.log("Error while parsing configured bounding box. Zooming to: " + Constants.FALLBACK_EXTENT); defaultExtent = Constants.FALLBACK_EXTENT; } zoomToExtent(defaultExtent); }
this.map.addLayer(layer);