Package com.google.gwt.maps.client.base

Examples of com.google.gwt.maps.client.base.LatLng


    private void sortStoreListOnLocation() {
        Collections.sort(stores, new Comparator<Store>() {
            @Override
            public int compare(Store one, Store two) {
                LatLng storeOneLocation = LatLng.newInstance(one.getLatitude(), one.getLongitude());
                LatLng storeTwoLocation = LatLng.newInstance(two.getLatitude(), two.getLongitude());

                double distanceOne = SphericalUtils.computeDistanceBetween(storeOneLocation, here);
                double distanceTwo = SphericalUtils.computeDistanceBetween(storeTwoLocation, here);

                return distanceOne < distanceTwo ? -1 : distanceOne == distanceTwo ? 0 : 1;
View Full Code Here


                        types[0] = AutocompleteType.ESTABLISHMENT;
                        types[1] = AutocompleteType.GEOCODE;

                        AutocompleteOptions options = AutocompleteOptions.newInstance();
                        options.setTypes(types);
                        LatLng sw = LatLng.newInstance(extent.getLowerLeftX(), extent.getLowerLeftY());
                        LatLng ne = LatLng.newInstance(extent.getUpperRightX(), extent.getUpperRightY());
                        options.setBounds(LatLngBounds.newInstance(sw, ne));

                        final Autocomplete autoComplete = Autocomplete.newInstance(locationSearchBox.getElement(), options);

                        autoComplete.addPlaceChangeHandler(new PlaceChangeMapHandler() {
                            @Override
                            public void onEvent(PlaceChangeMapEvent event) {
                                PlaceResult result = autoComplete.getPlace();
                                PlaceGeometry geometry = result.getGeometry();
                                LatLng center = geometry.getLocation();

                                Store store = storeBinder.getModel();
                                store.setName(result.getName());
                                store.setAddress(result.getFormatted_Address());
                                store.setLatitude(center.getLatitude());
                                store.setLongitude(center.getLongitude());
                                store.setRadius(DEFAULT_RADIUS);

                                placeMarkerAtStoreLocation(map);
                            }
                        });
View Full Code Here

        if (marker != null) {
            markers.removeMarker(marker);
            marker = null;
        }

        LatLng center = getStoreLocation();
        if (center != null) {
            Size size = new Size(25, 22);
            Pixel pixel = new Pixel(-15, -11);
            Icon icon = new Icon("img/marker.png", size, pixel);
            marker = new Marker(convertPoint(map.getProjection(), center), icon);
View Full Code Here

  private void sortStoreListOnLocation() {
    Collections.sort(stores, new Comparator<Store>() {
      @Override
      public int compare(Store one, Store two) {
        LatLng storeOneLocation = LatLng.newInstance(one.getLatitude(), one.getLongitude());
        LatLng storeTwoLocation = LatLng.newInstance(two.getLatitude(), two.getLongitude());

        double distanceOne = SphericalUtils.computeDistanceBetween(storeOneLocation, here);
        double distanceTwo = SphericalUtils.computeDistanceBetween(storeTwoLocation, here);

        return distanceOne < distanceTwo ? -1 : distanceOne == distanceTwo ? 0 : 1;
View Full Code Here

            types[0] = AutocompleteType.ESTABLISHMENT;
            types[1] = AutocompleteType.GEOCODE;

            AutocompleteOptions options = AutocompleteOptions.newInstance();
            options.setTypes(types);
            LatLng sw = LatLng.newInstance(extent.getLowerLeftX(), extent.getLowerLeftY());
            LatLng ne = LatLng.newInstance(extent.getUpperRightX(), extent.getUpperRightY());
            options.setBounds(LatLngBounds.newInstance(sw, ne));

            final Autocomplete autoComplete = Autocomplete.newInstance(locationSearchBox.getElement(), options);

            autoComplete.addPlaceChangeHandler(new PlaceChangeMapHandler() {
              @Override
              public void onEvent(PlaceChangeMapEvent event) {
                PlaceResult result = autoComplete.getPlace();
                PlaceGeometry geometry = result.getGeometry();
                LatLng center = geometry.getLocation();

                Store store = storeBinder.getModel();
                store.setName(result.getName());
                store.setAddress(result.getFormatted_Address());
                store.setLatitude(center.getLatitude());
                store.setLongitude(center.getLongitude());
                store.setRadius(DEFAULT_RADIUS);

                placeMarkerAtStoreLocation(map);
              }
            });
View Full Code Here

    if (marker != null) {
      markers.removeMarker(marker);
      marker = null;
    }

    LatLng center = getStoreLocation();
    if (center != null) {
      Size size = new Size(25, 22);
      Pixel pixel = new Pixel(-15, -11);
      Icon icon = new Icon("img/marker.png", size, pixel);
      marker = new Marker(convertPoint(map.getProjection(), center), icon);
View Full Code Here

TOP

Related Classes of com.google.gwt.maps.client.base.LatLng

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.