Examples of GMap2


Examples of wicket.contrib.gmap.GMap2

  private static final long serialVersionUID = 1L;

  public HomePage()
  {
    final GMap2 map = new GMap2("topPanel", GMapExampleApplication.get()
        .getGoogleMapsAPIkey());
    map.enableGoogleBar(true);
    add(map);
  }
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  private static final long serialVersionUID = 1L;

  public SimplePage()
  {
    GMap2 map = new GMap2("map", GMapExampleApplication.get()
        .getGoogleMapsAPIkey());
    map.setCenter(new GLatLng(52.37649, 4.888573));
    add(map);
  }
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  private WebMarkupContainer n, ne, e, se, s, sw, w, nw;

  public ManyPanel(String id, String gMapKey)
  {
    super(id);
    gMap = new GMap2("gMap", gMapKey);
    gMap.setZoom(7);
    gMap.setOutputMarkupId(true);
    add(gMap);
    final AjaxFallbackLink<Void> normal = new AjaxFallbackLink<Void>("normal")
    {
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  private static final long serialVersionUID = 1L;

  public HomePage()
  {
    final GMap2 map = new GMap2("topPanel", GMapExampleApplication.get()
        .getGoogleMapsAPIkey());
    map.addControl(GControl.GMapTypeControl);
    add(map);

    final WebMarkupContainer zoomIn = new WebMarkupContainer("zoomIn");
    zoomIn.add(map.new ZoomInBehavior("onclick"));
    add(zoomIn);
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  {
    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);
    add(feedback);

    final GMap2 bottomMap = new GMap2("bottomPanel", new GMapHeaderContributor(
        GMapExampleApplication.get().getGoogleMapsAPIkey()));
    bottomMap.setOutputMarkupId(true);
    bottomMap.setMapType(GMapType.G_SATELLITE_MAP);
    bottomMap.addControl(GControl.GSmallMapControl);
    add(bottomMap);

    Form<Object> geocodeForm = new Form<Object>("geocoder");
    add(geocodeForm);

    final TextField<String> addressTextField = new TextField<String>("address",
        new Model<String>(""));
    geocodeForm.add(addressTextField);

    Button button = new Button("client");
    // Using GClientGeocoder the geocoding request
    // is performed on the client using JavaScript
    button.add(new GClientGeocoder("onclick", addressTextField, GMapExampleApplication.get()
        .getGoogleMapsAPIkey())
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onGeoCode(AjaxRequestTarget target, int status, String address,
          GLatLng latLng)
      {
        if (status == GeocoderException.G_GEO_SUCCESS)
        {
          bottomMap.getInfoWindow().open(latLng,
              new GInfoWindowTab(address, new Label(address, address)));
        }
        else
        {
          error("Unable to geocode (" + status + ")");
          target.addComponent(feedback);
        }
      };
    });
    geocodeForm.add(button);

    // Using ServerGeocoder the geocoding request
    // is performed on the server using Googles HTTP interface.
    // http://www.google.com/apis/maps/documentation/services.html#Geocoding_Direct
    geocodeForm.add(new AjaxButton("server", geocodeForm)
    {

      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        try
        {
          String address = addressTextField.getDefaultModelObjectAsString();

          GLatLng latLng = GeoCodeGMapApplication.get().getServerGeocoder().findAddress(address);

          bottomMap.getInfoWindow().open(latLng,
              new GInfoWindowTab(address, new Label(address, address)));
        }
        catch (IOException e)
        {
          target.appendJavaScript("Unable to geocode (" + e.getMessage() + ")");
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  {
    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);
    add(feedback);

    map = new GMap2("bottomPanel", new GMapHeaderContributor(GMapExampleApplication
        .get().getGoogleMapsAPIkey()));
    map.setOutputMarkupId(true);
    map.setMapType(GMapType.G_SATELLITE_MAP);
    map.setScrollWheelZoomEnabled(true);
    map.add(new ClickListener()
View Full Code Here

Examples of wicket.contrib.gmap.GMap2

  private static final long serialVersionUID = 1L;

  public CustomPointPage()
  {
    GMap2 map = new GMap2("map", GMapExampleApplication.get()
        .getGoogleMapsAPIkey());
    map.setCenter(new GLatLng(52.37649, 4.888573));
    add(map);

    GIcon icon = new GIcon(urlFor(new PackageResourceReference(CustomPointPage.class, "image.gif"), null)
        .toString(), urlFor(new PackageResourceReference(CustomPointPage.class, "shadow.png"), null)
        .toString()).iconSize(new GSize(64, 64)).shadowSize(new GSize(64, 64)).iconAnchor(
        new GPoint(19, 40)).infoWindowAnchor(new GPoint(9, 2)).infoShadowAnchor(
        new GPoint(18, 25));

    GOverlay marker = new GMarker(new GLatLng(52.37649, 4.888573), new GMarkerOptions(
        "My Title", icon));

    map.addOverlay(marker);
  }
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.