use of org.discotools.gwt.leaflet.client.layers.raster.TileLayer in project opennms by OpenNMS.
the class NodeMapWidget method addTileLayer.
private void addTileLayer(String tileUrl, List<Option> optionsList) {
LOG.info("NodeMapWidget.setTileLayer(String, Option...) start");
LOG.info("NodeMapWidget.setTileLayer tileServerUrl: " + tileUrl + "," + optionsList);
final Options tileOptions = new Options();
for (Option eachOption : optionsList) {
tileOptions.setProperty(eachOption.getKey(), eachOption.getValue());
}
m_layer = new TileLayer(tileUrl, tileOptions);
m_map.addLayer(m_layer, true);
LOG.info("NodeMapWidget.setTileLayer(String, Option...) end");
}
use of org.discotools.gwt.leaflet.client.layers.raster.TileLayer in project activityinfo by bedatadriven.
the class LocationMap method afterRender.
@Override
protected void afterRender() {
super.afterRender();
Extents countryBounds = searchPresenter.getCountryBounds();
MapOptions mapOptions = new MapOptions();
mapOptions.setCenter(new LatLng(countryBounds.getCenterY(), countryBounds.getCenterX()));
mapOptions.setZoom(6);
mapOptions.setProperty("crs", new EPSG3857());
TileLayer baseLayer = new TileLayer(MapboxLayers.MAPBOX_STREETS, new Options());
markerLayer = new LayerGroup(new ILayer[0]);
map = new Map(getElement().getElementsByTagName("div").getItem(0), mapOptions);
map.addLayer(baseLayer);
map.addLayer(markerLayer);
bindEvents();
}
use of org.discotools.gwt.leaflet.client.layers.raster.TileLayer in project activityinfo by bedatadriven.
the class LeafletReportOverlays method setBaseMap.
public void setBaseMap(BaseMap baseMap) {
TileBaseMap tileBaseMap = MapboxLayers.toTileBaseMap(baseMap);
if (!Objects.equal(currentBaseMap, tileBaseMap)) {
if (baseLayer != null) {
mapWidget.removeLayer(baseLayer);
}
Options options = new Options();
options.setProperty("minZoom", tileBaseMap.getMinZoom());
options.setProperty("maxZoom", tileBaseMap.getMaxZoom());
baseLayer = new TileLayer(tileBaseMap.getTileUrlPattern(), options);
mapWidget.addLayer(baseLayer, true);
if (mapWidget.getZoom() > tileBaseMap.getMaxZoom()) {
mapWidget.setZoom(tileBaseMap.getMaxZoom());
}
if (mapWidget.getZoom() < tileBaseMap.getMinZoom()) {
mapWidget.setZoom(tileBaseMap.getMinZoom());
}
}
}
Aggregations