Examples of MapWidget


Examples of com.google.gwt.maps.client.MapWidget

            double longitude = Double.parseDouble(getParam("longitude"));

            LatLng collegeCenter = new LatLng(latitude, longitude);

            if (latitude == -1 && longitude == -1) {
                map = new MapWidget();
            } else {
                map = new MapWidget(collegeCenter, DEFAULT_ZOOM);
            }

            map.setSize("300px", "250px");

            map.addControl(new SmallMapControl());
View Full Code Here

Examples of com.googlecode.maps3.client.MapWidget

   
    FlowPanel controls = new FlowPanel();
    controls.setStyleName("controls");
    mainDock.addNorth(controls, 2);
   
    final MapWidget map = new MapWidget(opts);
    mainDock.add(map);

    LatLngBounds bounds = LatLngBounds.newInstance();
    bounds.extend(LatLng.newInstance(37.660773,-122.534448));
    bounds.extend(LatLng.newInstance(37.860773,-122.334448));
    map.fitBounds(bounds);
   
    // Add the controls
    latLonBox = new TextBox();
    latLonBox.setText("37,-122");
    controls.add(latLonBox);
   
    controls.add(new Button("Switching InfoWindow", new ClickHandler() {
      @Override
      public void onClick(ClickEvent event)
      {
        initInfoWindow();
       
        FlowPanel panel = new FlowPanel();
        panel.add(new Button("Click Me", handler1));
       
        infoWindow.setContent(panel);
        infoWindow.open(map.getMapJSO());
      }
    }));
   
    controls.add(new Button("Expanding InfoWindow", new ClickHandler() {
      @Override
      public void onClick(ClickEvent event)
      {
        initInfoWindow();

        final FlowPanel panel = new FlowPanel();
        panel.add(new Button("Click Me", new ClickHandler() {
          @Override
          public void onClick(ClickEvent event)
          {
            // Doesn't work
            panel.clear();
            panel.add(new Label("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."));
            infoWindow.setContent(panel);
            infoWindow.setContent(panel);

            // Works
//            FlowPanel nextPanel = new FlowPanel();
//            nextPanel.add(new Label("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."));
//            infoWindow.setContent(nextPanel);
          }
        }));
       
        infoWindow.setContent(panel);
        infoWindow.open(map.getMapJSO());
      }
    }));
   
    controls.add(new Button("Reverse Geocode", new ClickHandler() {
      @Override
      public void onClick(ClickEvent event)
      {
        String latLonStr = latLonBox.getText();
        String[] split = latLonStr.split(",");
       
        float lat = Float.parseFloat(split[0]);
        float lon = Float.parseFloat(split[1]);
        final LatLng point = LatLng.newInstance(lat, lon);
       
        map.getMapJSO().panTo(point);
       
        GeocoderRequest request = GeocoderRequest.newInstance();
        request.setLatLng(point);
       
        GWT.log("Geocoding " + point, null);
       
        Geocoder geocoder = Geocoder.newInstance();
        geocoder.geocode(request, new GeocoderCallback() {
          @Override
          public void callback(JsArray<GeocoderResponse> responses, GeocoderStatus status)
          {
            GWT.log("Got callback with status " + status, null);
           
            if (status.equals(GeocoderStatus.OK))
            {
              InfoWindowJSO info = InfoWindowJSO.newInstance();
              info.setPosition(point);
              if (responses.length() > 0)
              {
                info.setContent(responses.get(0).toString());
              }
              else
              {
                info.setContent("No results from geocoder");
              }
             
              info.open(map.getMapJSO());
            }
            else
            {
              Window.alert("Geocoder failed: " + status);
            }
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    final MapWidget map = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
    mapLayout.addChild(searchPanel);
   
    // ---------------------------------------------------------------------
    // Create the right-side (overview map, layer-tree, legend):
    // ---------------------------------------------------------------------
    final SectionStack sectionStack = new SectionStack();
    sectionStack.setBorder("10px solid #777777");
    sectionStack.setStyleName("round_corner");
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setCanReorderSections(true);
    sectionStack.setCanResizeSections(false);
    sectionStack.setSize("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    legend.setBackgroundColor("#FFFFFF");
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    final MapWidget map = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
        GetMapImageAction getMapImage = new GetMapImageAction(map);
        toolbar.addSeparator();
        toolbar.addActionButton(getMapImage);
        GetLegendImageAction getLegendImageAll = new GetLegendImageAction(map, true);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImageAll);
        GetLegendImageAction getLegendImage = new GetLegendImageAction(map, false);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImage);
        // switch all labels on
        for (Layer layer : map.getMapModel().getLayers()) {
          layer.setLabeled(true);
        }
      }
    });
   
    map.getMapModel().addLayerSelectionHandler(new LayerSelectionHandler() {

      public void onSelectLayer(LayerSelectedEvent event) {
        for (Layer layer : map.getMapModel().getLayers()) {
          if (layer.isSelected()) {
            layer.setVisible(true);
          } else {
            layer.setVisible(false);
          }
        }
      }

      public void onDeselectLayer(LayerDeselectedEvent event) {
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
    mapLayout.addChild(searchPanel);

    // ---------------------------------------------------------------------
    // Create the right-side (overview map, layer-tree, legend):
    // ---------------------------------------------------------------------
    final SectionStack sectionStack = new SectionStack();
    sectionStack.setBorder("10px solid #777777");
    sectionStack.setStyleName("round_corner");
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setCanReorderSections(true);
    sectionStack.setCanResizeSections(false);
    sectionStack.setSize("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    legend.setBackgroundColor("#FFFFFF");
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

    layout.setMargin(5);

    // create the map and toolbar

    // @extract-start createGwtWidget, Create GWT widget in toolbar
    MapWidget map = new MapWidget("mapOsm", "app");
    Toolbar toolbar = new Toolbar(map);
    // @extract-skip-start
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    // @extract-skip-end
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

  private Canvas getExample1() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapOsm", "widget-utility");
    final RibbonBarLayout ribbonBar = new RibbonBarLayout(mapWidget, "ribbon-bar-1");
    ribbonBar.setSize("100%", "94px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

  private Canvas getExample2() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapWmsCountries", "widget-utility");
    final RibbonTabLayout ribbon = new RibbonTabLayout(mapWidget, "ribbon-1");
    ribbon.setSize("100%", "120px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

  private Canvas getExample3() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapCountries", "widget-utility");
    final RibbonBarLayout ribbon = new RibbonBarLayout(mapWidget, "ribbon-bar-2");
    ribbon.setSize("100%", "80px");

    layout.addMember(ribbon);
    layout.addMember(mapWidget);
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

  private Canvas getExample4() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapWms", "widget-utility");
    final RibbonBarLayout ribbon = new RibbonBarLayout(mapWidget, "ribbon-bar-3");
    ribbon.setStyleName("myRibbon");
    ribbon.setSize("100%", "94px");

    layout.addMember(ribbon);
View Full Code Here

Examples of org.geomajas.gwt.client.widget.MapWidget

    layout.setMargin(5);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    final MapWidget map = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    VLayout mapLayout = new VLayout();
    mapLayout.setShowResizeBar(true);
    mapLayout.setResizeBarTarget("tabs");
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");
    tabSet.setTabBarPosition(Side.TOP);
    tabSet.setWidth100();
    tabSet.setHeight("35%");
    tabSet.setID("tabs");

    VLayout leftLayout = new VLayout();
    leftLayout.setShowEdges(true);
    leftLayout.addMember(mapLayout);
    leftLayout.addMember(tabSet);

    layout.addMember(leftLayout);

    // ---------------------------------------------------------------------
    // Create the right-side (overview map, layer-tree, legend):
    // ---------------------------------------------------------------------
    final SectionStack sectionStack = new SectionStack();
    sectionStack.setShowEdges(true);
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setCanReorderSections(true);
    sectionStack.setCanResizeSections(false);
    sectionStack.setSize("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
    layout.addMember(sectionStack);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.