use of org.cesiumjs.cs.collections.ImageryLayerCollection in project gwt-cs by iSergio.
the class ImageryLayersSplit method buildPanel.
@Override
public void buildPanel() {
ViewerOptions viewerOptions = new ViewerOptions();
viewerOptions.imageryProvider = ArcGisMapServerImageryProvider.create("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
viewerOptions.baseLayerPicker = false;
final ViewerPanel csVPanel = new ViewerPanel(viewerOptions);
ImageryLayerCollection layers = csVPanel.getViewer().imageryLayers();
TileMapServiceImageryProviderOptions tileMapServiceImageryProviderOptions = new TileMapServiceImageryProviderOptions();
tileMapServiceImageryProviderOptions.url = "https://cesiumjs.org/blackmarble";
tileMapServiceImageryProviderOptions.credit = Credit.create("Black Marble imagery courtesy NASA Earth Observatory");
tileMapServiceImageryProviderOptions.flipXY = true;
ImageryLayer blackMarble = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider(tileMapServiceImageryProviderOptions));
blackMarble.splitDirection = ImagerySplitDirection.LEFT();
csVPanel.getViewer().scene().imagerySplitPosition = 0.5;
Slider slider = new Slider("Slider", 0, 100, 50);
slider.setStep(1);
slider.setWidth("100%");
slider.addListener(new SliderListener() {
@Override
public void onStart(SliderEvent e) {
//
}
@Override
public boolean onSlide(SliderEvent e) {
Slider source = e.getSource();
double value = source.getValue() / 100.;
csVPanel.getViewer().scene().imagerySplitPosition = value;
return true;
}
@Override
public void onChange(SliderEvent e) {
//
}
@Override
public void onStop(SliderEvent e) {
//
}
});
AbsolutePanel aPanel = new AbsolutePanel();
aPanel.add(csVPanel);
aPanel.add(slider, 0, 5);
contentPanel.add(aPanel);
contentPanel.add(new HTML("<p>Use the split property to only show layers on one side of a slider.</p>"));
initWidget(contentPanel);
}
use of org.cesiumjs.cs.collections.ImageryLayerCollection in project gwt-cs by iSergio.
the class ImageryLayers method buildPanel.
@Override
public void buildPanel() {
ViewerOptions viewerOptions = new ViewerOptions();
ArcGisMapServerImageryProviderOptions arcGisMapServerImageryProviderOptions = new ArcGisMapServerImageryProviderOptions();
arcGisMapServerImageryProviderOptions.url = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
viewerOptions.imageryProvider = new ArcGisMapServerImageryProvider(arcGisMapServerImageryProviderOptions);
viewerOptions.baseLayerPicker = false;
ViewerPanel csVPanel = new ViewerPanel(viewerOptions);
ImageryLayerCollection layers = csVPanel.getViewer().imageryLayers();
TileMapServiceImageryProviderOptions tileMapServiceImageryProviderOptions = new TileMapServiceImageryProviderOptions();
tileMapServiceImageryProviderOptions.url = "https://cesiumjs.org/blackmarble";
tileMapServiceImageryProviderOptions.credit = Credit.create("Black Marble imagery courtesy NASA Earth Observatory");
tileMapServiceImageryProviderOptions.flipXY = true;
ImageryLayer blackMarble = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider(tileMapServiceImageryProviderOptions));
blackMarble.alpha = 0.5f;
blackMarble.brightness = 2.0f;
SingleTileImageryProviderOptions singleTileImageryProviderOptions = new SingleTileImageryProviderOptions();
singleTileImageryProviderOptions.url = GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png";
singleTileImageryProviderOptions.rectangle = Rectangle.fromDegrees(-75.0, 28.0, -67.0, 29.75);
layers.addImageryProvider(new SingleTileImageryProvider(singleTileImageryProviderOptions));
contentPanel.add(new HTML("<p>Create imagery layers from multiple sources.</p>"));
contentPanel.add(csVPanel);
initWidget(contentPanel);
}
Aggregations