Search in sources :

Example 1 with LAttribution

use of org.vaadin.addon.leaflet.control.LAttribution in project v-leaflet by mstahv.

the class ControlTest method getTestComponent.

@Override
public Component getTestComponent() {
    leafletMap = new LMap();
    leafletMap.setCenter(60.4525, 22.301);
    leafletMap.setZoomLevel(15);
    leafletMap.addBaseLayer(new LOpenStreetMapLayer(), "OSM");
    /*
		 * Using nameless api, doesn't add layers control
		 */
    // leafletMap.addLayer(baselayer);
    /*
		 * Layers control can also be removed manually
		 */
    // leafletMap.getLayersControl().remove();
    scale.setPosition(ControlPosition.topright);
    scale.setImperial(false);
    scale.setMetric(true);
    leafletMap.addControl(scale);
    /*
		 * DEFAULT CONTROLS These are on there by default, but can be customized
		 * and disabled if needed.
		 */
    LAttribution attribution = new LAttribution();
    attribution.setPrefix("Leaflet with Java in JVM");
    attribution.setPosition(ControlPosition.bottomleft);
    // attribution.setEnabled(false);
    leafletMap.addControl(attribution);
    LZoom zoom = new LZoom();
    zoom.setPosition(ControlPosition.bottomright);
    // zoom.setEnabled(false);
    leafletMap.addControl(zoom);
    return leafletMap;
}
Also used : LMap(org.vaadin.addon.leaflet.LMap) LOpenStreetMapLayer(org.vaadin.addon.leaflet.LOpenStreetMapLayer) LZoom(org.vaadin.addon.leaflet.control.LZoom) LAttribution(org.vaadin.addon.leaflet.control.LAttribution)

Aggregations

LMap (org.vaadin.addon.leaflet.LMap)1 LOpenStreetMapLayer (org.vaadin.addon.leaflet.LOpenStreetMapLayer)1 LAttribution (org.vaadin.addon.leaflet.control.LAttribution)1 LZoom (org.vaadin.addon.leaflet.control.LZoom)1