Package org.zkoss.openlayers.base

Examples of org.zkoss.openlayers.base.LonLat


        VirtualEarth.Type.HYBRID))));
    map.addLayer(new VirtualEarth("Aerial", toMap(pair("type",
        VirtualEarth.Type.AERIAL))));

    map.addControl(new LayerSwitcher());
    map.setCenter(new LonLat(-110, 45), 3, false, false);

  }
View Full Code Here


    map.addLayer(new Bing(toMap(pair("key", apiKey),
        pair("type", "AerialWithLabels"),
        pair("name", "Bing Aerial With Labels"))));

    map.addControl(new LayerSwitcher());
    map.setCenter(new LonLat(-71.147, 42.472).transform(new Projection(
        "EPSG:4326"), map.getProjection()), 11);

  }
View Full Code Here

       
        // create an overview map control with the default options
        Control overview1 = new OverviewMap(toMap(pair("maximized", true)));
        map1.addControl(overview1);
       
        map1.setCenter(new LonLat(0, 0), 2);
       
        // create the bottom map (with advanced overview map control)
        Map mapOptions = toMap(
            pair("maxExtent", new Bounds(-8242894.927728, 4965204.031195, -8227290.161511, 4994963.723637)),
            pair("maxResolution", 116.2487986015621),
            pair("projection", "EPSG:900913"),
            pair("units", "m")        );

       
        map2.setOptions(mapOptions);
        map2.addLayer(ny);
       
       
        // create an overview map control with non-default options
        Map controlOptions = toMap(
        pair("maximized", true),
        pair("mapOptions",
            mergeMap(mapOptions,
              pair("maxResolution", 156543.0339),
              pair("maxExtent", new Bounds(-20037508.34, -20037508.34,
                             20037508.34, 20037508.34)))
        ),
        pair("layers", Arrays.asList(jplOverview)
        ));
        Control overview2 = new OverviewMap(controlOptions);
        map2.addControl(overview2);
       
        map2.setCenter(new LonLat(-8233165.3575055, 4980298.21113769), 3);
  }
View Full Code Here

    map.addLayer(new Google("Google Streets",  toMap(pair("type", Google.Type.NORMAL))));
    map.addLayer(new Google("Google Satellite", toMap(pair("numZoomLevels", 20))));
    map.addLayer(new Google("Google Hybrid", toMap(pair("type", Google.Type.HYBRID), pair("numZoomLevels", 20))));
    map.addLayer(new Google("Google Physical", toMap(pair("type", Google.Type.SATELLITE), pair("numZoomLevels", 22))));
    map.addControl(new LayerSwitcher());
    map.setCenter(new LonLat(10.2, 48.9), 5, false, false);
  }
View Full Code Here

  private Openlayers map;

  public void doAfterCompose(Window comp) throws Exception {
    super.doAfterCompose(comp);
    map.addLayer(new OSM("Simple OSM Map"));
    map.setCenter(new LonLat(-71.147, 42.472).transform(
                new Projection("EPSG:4326"),
                map.getProjection()), 12, false, false);

  }
View Full Code Here

   
  }
  @Listen("onClick=#center")
  public void centerMap(Event evt) {
    if (lat.getValue() == null && lon.getValue() == null)
      myComp.setCenter(new LonLat(116, 25.9).transform(new Projection("EPSG:4326"), myComp.getProjection()), zoom.getValue(), false, false);
    else
      myComp.setCenter(new LonLat(lon.doubleValue(), lat.doubleValue()).transform(new Projection("EPSG:4326"), myComp.getProjection()), zoom.getValue(), false, false);
    //myComp.invalidate();
  }
View Full Code Here

      myComp.setCenter(new LonLat(lon.doubleValue(), lat.doubleValue()).transform(new Projection("EPSG:4326"), myComp.getProjection()), zoom.getValue(), false, false);
    //myComp.invalidate();
  }
  @Listen("onClick=#office")
  public void gotoOffice(Event evt) {
    myComp.setCenter(new LonLat(121.5272, 25.0495).transform(new Projection("EPSG:4326"), myComp.getProjection()), 20, false, true);
   
  }
View Full Code Here

            pair("matrixSet", "EPSG:900913"),
            pair("matrixIds", matrixIds),
            pair("format", "image/png"), pair("style", "_null"),
            pair("opacity", 0.7), pair("isBaseLayer", false))));
    map.addControl(new LayerSwitcher());
    map.setCenter(new LonLat(-13677832, 5213272), 13, false, false);

  }
View Full Code Here

    map.addLayer(new Yahoo("Yahoo"));
    map.addLayer(new WMS("OpenLayers WMS",
        "http://vmap0.tiles.osgeo.org/wms/vmap0", toMap(pair("layers",
            "basic"))));
    map.addControl(new LayerSwitcher());
    map.setCenter(new LonLat(23.342453, 120.320154).transform(
        new Projection("EPSG:900913"), new Projection("EPSG:4326")), 4,
        false, false);

  }
View Full Code Here

  public void doAfterCompose(Window comp) throws Exception {
    super.doAfterCompose(comp);
    map.addLayer(new WMS( "OpenLayers WMS",
             "http://vmap0.tiles.osgeo.org/wms/vmap0", toMap(pair("layers", "basic"))));
            
        map.setCenter(new LonLat(0, 0), 0);
        map.addLayer(new Text("text", toMap(pair("location", Executions.getCurrent().getContextPath() + "/data/textfile.txt"))));

        Markers markers = new Markers("Markers");
        map.addLayer(markers);

        Size size = new Size(21,25);
        Pixel offset = new Pixel(-(size.getWidth()/2), -size.getHeight());
        Icon icon = new Icon("http://www.openlayers.org/dev/img/marker.png",size,offset);
        markers.addMarker(new Marker(new LonLat(0,0),icon));

        Icon halfIcon = (Icon) icon.clone();
         markers.addMarker(new Marker(new LonLat(0,45),halfIcon));

         Marker marker = new Marker(new LonLat(90,10), (Icon)icon.clone());
         marker.setOpacity(0.2);
//         marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); OpenLayers.Event.stop(evt); });
         markers.addMarker(marker);
         map.addControl(new LayerSwitcher());
         map.zoomToMaxExtent();
View Full Code Here

TOP

Related Classes of org.zkoss.openlayers.base.LonLat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.