Search in sources :

Example 1 with Graticule

use of ol.Graticule in project gwt-ol3 by TDesjardins.

the class GraticuleExample method show.

/* (non-Javadoc)
     * @see de.desjardins.ol3.demo.client.example.Example#show()
     */
@Override
public void show(String exampleId) {
    // create an OSM-layer
    XyzOptions osmSourceOptions = OLFactory.createOptions();
    Osm osmSource = new Osm(osmSourceOptions);
    LayerOptions osmLayerOptions = OLFactory.createOptions();
    osmLayerOptions.setSource(osmSource);
    Tile osmLayer = new Tile(osmLayerOptions);
    // create a view
    View view = new View();
    Coordinate centerCoordinate = new Coordinate(1490463, 6894388);
    view.setCenter(centerCoordinate);
    view.setZoom(10);
    // create the map
    MapOptions mapOptions = OLFactory.createOptions();
    mapOptions.setTarget(exampleId);
    mapOptions.setView(view);
    Map map = new Map(mapOptions);
    map.addLayer(osmLayer);
    // add some controls
    map.addControl(new ZoomSlider());
    MousePosition mousePosition = new MousePosition();
    mousePosition.setCoordinateFormat(Coordinate.createStringXY(2));
    map.addControl(mousePosition);
    map.addControl(new ZoomToExtent());
    OverviewMap overviewMap = new OverviewMap();
    map.addControl(overviewMap);
    Graticule graticule = new Graticule();
    graticule.setMap(map);
}
Also used : XyzOptions(ol.source.XyzOptions) MapOptions(ol.MapOptions) OverviewMap(ol.control.OverviewMap) ZoomToExtent(ol.control.ZoomToExtent) Osm(ol.source.Osm) Tile(ol.layer.Tile) LayerOptions(ol.layer.LayerOptions) View(ol.View) MousePosition(ol.control.MousePosition) Graticule(ol.Graticule) Coordinate(ol.Coordinate) ZoomSlider(ol.control.ZoomSlider) OverviewMap(ol.control.OverviewMap) Map(ol.Map)

Aggregations

Coordinate (ol.Coordinate)1 Graticule (ol.Graticule)1 Map (ol.Map)1 MapOptions (ol.MapOptions)1 View (ol.View)1 MousePosition (ol.control.MousePosition)1 OverviewMap (ol.control.OverviewMap)1 ZoomSlider (ol.control.ZoomSlider)1 ZoomToExtent (ol.control.ZoomToExtent)1 LayerOptions (ol.layer.LayerOptions)1 Tile (ol.layer.Tile)1 Osm (ol.source.Osm)1 XyzOptions (ol.source.XyzOptions)1