Package com.googlecode.maps3.client.auto

Examples of com.googlecode.maps3.client.auto.Geocoder


   
    float lat = Float.parseFloat(split[0]);
    float lon = Float.parseFloat(split[1]);
    final LatLng point = LatLng.newInstance(lat, lon);
   
    infoWindow = new InfoWindow();
    infoWindow.setPosition(point);
  }
View Full Code Here


          {
            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

        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);
View Full Code Here

    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);
   
    infoWindow = new InfoWindow();
    infoWindow.setPosition(point);
  }
View Full Code Here

    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");
View Full Code Here

  /**
   * This is the entry point method.
   */
  public void onModuleLoad()
  {
    MapOptions opts = MapOptions.newInstance();
    opts.setMapTypeId();
//    opts.setCenter(LatLng.newInstance(37.760773,-122.434448));
//    opts.setZoom(14);
   
    DockLayoutPanel mainDock = new DockLayoutPanel(Unit.EM);
    RootLayoutPanel.get().add(mainDock);
View Full Code Here

   
    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

        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);
           
View Full Code Here

        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);
           
View Full Code Here

        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() {
View Full Code Here

TOP

Related Classes of com.googlecode.maps3.client.auto.Geocoder

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.