use of ol.source.ImageArcGisRestParams in project gwt-ol3 by TDesjardins.
the class ArcGISExample method show.
/* (non-Javadoc)
* @see de.desjardins.ol3.demo.client.example.Example#show() */
@Override
public void show(String exampleId) {
ImageArcGisRestParams params = new ImageArcGisRestParams();
params.showLayers("2");
ImageArcGisRestOptions options = new ImageArcGisRestOptions();
options.setUrl("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer");
options.setParams(params);
options.setRatio(1f);
ImageArcGisRest source = new ImageArcGisRest(options);
LayerOptions layerOptions = OLFactory.createOptions();
layerOptions.setSource(source);
Image layer = new Image(layerOptions);
// create a view
View view = new View();
Coordinate center = OLFactory.createCoordinate(-10997148, 4569099);
view.setCenter(center);
view.setZoom(4);
// create the map
MapOptions mapOptions = OLFactory.createOptions();
mapOptions.setTarget(exampleId);
mapOptions.setView(view);
Map map = new Map(mapOptions);
map.addLayer(layer);
// add some controls
map.addControl(new ScaleLine());
DemoUtils.addDefaultControls(map.getControls());
// add some interactions
map.addInteraction(new KeyboardPan());
map.addInteraction(new KeyboardZoom());
map.addControl(new Rotate());
}
Aggregations