Package org.wicketstuff.gmap.api

Examples of org.wicketstuff.gmap.api.GLatLng


    private static final long serialVersionUID = 1L;

    public CustomPointPage()
    {
        GMap map = new GMap("map");
        map.setCenter(new GLatLng(52.37649, 4.888573));
        add(map);

        GIcon icon =
                new GIcon("/pin.gif").setScaledSize(
                new GSize(64, 64)).setSize(new GSize(64, 64));
        GIcon shadow =
                new GIcon("/shadow.png").setScaledSize(
                new GSize(64, 64)).setSize(new GSize(64, 64));
        GOverlay marker = new GMarker(new GMarkerOptions(map, new GLatLng(52.37649, 4.888573), "My Title", icon, shadow));

        map.addOverlay(marker);
    }
View Full Code Here


    @Override
    protected final void onEvent(AjaxRequestTarget target)
    {
        Request request = RequestCycle.get().getRequest();
        NumberFormat fmt = DecimalFormat.getInstance(Locale.US);
        GLatLng latLng = null;
        String latStr = request.getRequestParameters().getParameterValue("lat").toString();
        String lngStr = request.getRequestParameters().getParameterValue("lng").toString();
        Double lat = null;
        Double lng = null;
        try
        {
          lat = fmt.parse(latStr).doubleValue();
          lng = fmt.parse(lngStr).doubleValue();
        } catch (ParseException e)
        {
          throw new StringValueConversionException("Unable to convert 'lat/lng' to a double value", e);
        }
        latLng = new GLatLng(lat, lng);

        onDblClick(target, latLng);
    }
View Full Code Here

    @Override
    protected void onEvent(AjaxRequestTarget target)
    {
        Request request = RequestCycle.get().getRequest();
        NumberFormat fmt = DecimalFormat.getInstance(Locale.US);
        GLatLng latLng = null;

        String latStr = request.getRequestParameters().getParameterValue("lat").toString();
        String lngStr = request.getRequestParameters().getParameterValue("lng").toString();
        Double lat = null;
        Double lng = null;
        try
        {
          lat = fmt.parse(latStr).doubleValue();
          lng = fmt.parse(lngStr).doubleValue();
        } catch (ParseException e)
        {
          throw new StringValueConversionException("Unable to convert 'lat/lng' to a double value", e);
        }
        latLng = new GLatLng(lat, lng);

        onClick(target, latLng);
    }
View Full Code Here

    @Test
    public void testGeocoding() throws Exception {
        System.out.println("geocoding");
        Geocoder coder = new Geocoder();
        GLatLng result = coder.geocode("Salzburgerstraße 205, 4030 Linz, Österreich");
        Assert.assertNotNull(result);
        Assert.assertEquals(48.25763170, result.getLat(), 0.00001);
        Assert.assertEquals(14.29231840, result.getLng(), 0.00001);
    }
View Full Code Here

    private static final long serialVersionUID = 1L;

    public PolygonesPage()
    {
        GMap map = new GMap("topPanel");
        map.addOverlay(new GPolygon("#000000", 4, 0.7f, "#E9601A", 0.7f, new GLatLng(37.3, -122.4), new GLatLng(37.2, -122.2),
                new GLatLng(37.3, -122.0), new GLatLng(37.4, -122.2), new GLatLng(37.3, -122.4)));
        map.addOverlay(new GPolyline("#FFFFFF", 8, 1.0f, new GLatLng(37.35, -122.3), new GLatLng(37.25, -122.25), new GLatLng(
                37.3, -122.2), new GLatLng(37.25, -122.15), new GLatLng(37.35, -122.1)));
        map.setZoom(10);
        add(map);
    }
View Full Code Here

    {
        GMap map = new GMap("map");
        map.setStreetViewControlEnabled(false);
        map.setScaleControlEnabled(true);
        map.setScrollWheelZoomEnabled(true);
        map.setCenter(new GLatLng(52.47649, 13.228573));       
        add(map);
    }
View Full Code Here

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

    GMap map = new GMap("topPanel");
    GRectangle rectangle = new GRectangle(new GLatLngBounds(new GLatLng(37.35, -121.9), new GLatLng(37.45, -121.8)), "#000000", 4, 0.7f, "#E9601A", 0.7f);
    rectangle.setEditable(true);
    rectangle.setDraggable(true);
    GEventHandler eventHandler = new GEventHandler()
    {
      @Override
View Full Code Here

        for(int i=0; i<1000; i++)
        {
            double latitude = minLat + (double)(Math.random() * ((maxLat - minLat) + 1));
            double longitude = minLon + (double)(Math.random() * ((maxLon - minLon) + 1));
         
            GLatLng glatlng = new GLatLng(latitude, longitude);
            markersToShow.add(glatlng);
           
            map.addOverlay(new GMarker("marker"+i, new GMarkerOptions(map, glatlng)));
            mapDefault.addOverlay(new GMarker("marker"+i, new GMarkerOptions(mapDefault, glatlng)));
        }
View Full Code Here

            protected void onSubmit(AjaxRequestTarget target, Form<?> form)
            {
                try
                {
                    String address = addressTextField.getDefaultModelObjectAsString();
                    GLatLng latLng = new ServerGeocoder().findAddress(address);
                    bottomMap.addOverlay(new GInfoWindow(latLng, "address: " + address));
                    target.add(feedback);
                }
                catch (Exception e)
                {
View Full Code Here

    public RefreshPointPage()
    {
        map = new GMap("map");
        add(map);

        GOverlay overlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573), "pin.gif", "shadow.png");

        map.addOverlay(overlay);

        map.add(new AbstractAjaxTimerBehavior(Duration.seconds(5))
        {
            private static final long serialVersionUID = 1L;
            private int i = 1;

            @Override
            protected void onTimer(AjaxRequestTarget target)
            {
                if (updateOverlays)
                {
                    GOverlay newOverlay;
                    if (i % 3 == 0)
                    {
                        newOverlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573), "pin.gif", "shadow.png");
                        i = 0;
                    }
                    else if (i % 3 == 1)
                    {
                        newOverlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573), "pin2.gif", "shadow2.png");
                    }
                    else
                    {
                        newOverlay = createOverlay("Toulouse", new GLatLng(43.604363, 1.442951), "pin2.gif", "shadow2.png");
                    }
                    i++;
                    map.setOverlays(Collections.singletonList(newOverlay));
                }
            }
View Full Code Here

TOP

Related Classes of org.wicketstuff.gmap.api.GLatLng

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.