Package com.danhaywood.isis.wicket.gmap3.ui.collectioncontents

Examples of com.danhaywood.isis.wicket.gmap3.ui.collectioncontents.CollectionOfEntitiesAsLocatables


        return new GMarker(markerOptions);
    }

    private GMarkerOptions buildMarkerOptions(GMap map, ObjectAdapter adapter) {
       
        final Locatable locatable = (Locatable) adapter.getObject();
       
        final ResourceReference imageResource = determineImageResource(adapter);
        final String urlFor = (String)urlFor(imageResource, new PageParameters());
        @SuppressWarnings("unused")
        final GIcon gicon = new GIcon(urlFor);
View Full Code Here


        return new GMarker(markerOptions);
    }

    private GMarkerOptions buildMarkerOptions(GMap map, ObjectAdapter adapter) {
       
        final Locatable locatable = (Locatable) adapter.getObject();
       
        final ResourceReference imageResource = determineImageResource(adapter);
        final String urlFor = (String)urlFor(imageResource, new PageParameters());
        @SuppressWarnings("unused")
        final GIcon gicon = new GIcon(urlFor);
View Full Code Here

        return new GMarker(markerOptions);
    }

    private GMarkerOptions buildMarkerOptions(GMap map, ObjectAdapter adapter) {
       
        final Locatable locatable = (Locatable) adapter.getObject();
       
        final ResourceReference imageResource = determineImageResource(adapter);
        final String urlFor = (String)urlFor(imageResource, new PageParameters());
        @SuppressWarnings("unused")
        final GIcon gicon = new GIcon(urlFor);
View Full Code Here

    locationLookupService = new LocationLookupService();
  }
 
  @Test
  public void whenValid() {
    Location location = locationLookupService.lookup("10 Downing Street,London,UK");
    assertThat(location, is(not(nullValue())));
    assertEquals(51.503, location.getLatitude(), 0.01);
    assertEquals(-0.128, location.getLongitude(), 0.01);
  }
View Full Code Here

    assertEquals(-0.128, location.getLongitude(), 0.01);
  }

  @Test
  public void whenInvalid() {
    Location location = locationLookupService.lookup("$%$%^Y%^fgnsdlfk glfg");
    assertThat(location, is(nullValue()));
  }
View Full Code Here

                adapter.titleString()   ).draggable(false);
        return markerOptions;
    }

    private GLatLng asGLatLng(Locatable locatable) {
        final Location location = locatable.getLocation();
        return location!=null?new GLatLng(location.getLatitude(), location.getLongitude()):null;
    }
View Full Code Here

            //    String locStr2 = String.format("%6f;%6f", 123.456, -30.415);
            // because it is a different string for Arabic !!!
            //    String displayLanguage = locale.getDisplayLanguage();
            //    System.out.printf("%3s : %-20s : %12s : %12s : %s\n", locale.getLanguage(), displayLanguage, locStr, locStr2, (locStr.equals(locStr2)? "": "DIFFERENT!!!"));

            final Location location = Location.fromString(locStr);
            assertThat(location.getLatitude(), is(closeTo(123.456, 0.0001)));
            assertThat(location.getLongitude(), is(closeTo(-30.415, 0.0001)));
        }
    }
View Full Code Here

    }

    @Test
    public void testFromString_ifForeign() {
        Locale.setDefault(Locale.ENGLISH);
        final Location location = Location.fromString("123,456;-30,415");
        assertThat(location.getLatitude(), is(closeTo(123.456, 0.0001)));
        assertThat(location.getLongitude(), is(closeTo(-30.415, 0.0001)));
    }
View Full Code Here

    final NumberFormat nf = NumberFormat.getInstance();
    nf.setMinimumFractionDigits(6);
    nf.setMaximumFractionDigits(6);

    final String expectedResult = nf.format(123.456) + ";" + nf.format(-30.415);
        final Location location = new Location(123.456, -30.415);
        final String string = location.toString();

        assertThat(string, is(expectedResult));
    }
View Full Code Here

    locationLookupService = new LocationLookupService();
  }
 
  @Test
  public void whenValid() {
    Location location = locationLookupService.lookup("10 Downing Street,London,UK");
    assertThat(location, is(not(nullValue())));
    assertEquals(51.503, location.getLatitude(), 0.01);
    assertEquals(-0.128, location.getLongitude(), 0.01);
  }
View Full Code Here

TOP

Related Classes of com.danhaywood.isis.wicket.gmap3.ui.collectioncontents.CollectionOfEntitiesAsLocatables

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.