Beispiel #1
0
  private void updateSearchMarkers() {

    markerLayer.clearLayers();

    List<LocationDTO> locations = Lists.reverse(searchPresenter.getStore().getModels());
    LatLngBounds bounds = new LatLngBounds();

    boolean empty = true;
    for (LocationDTO location : locations) {
      if (location.hasCoordinates()) {
        LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());

        Marker marker = createMarker(latLng, location.getMarker());
        markerLayer.addLayer(marker);

        bounds.extend(latLng);
        bindClickEvent(location, marker);

        empty = false;
      }
    }

    if (empty) {
      if (searchPresenter.getBounds() != null) {
        bounds = LeafletUtil.newLatLngBounds(searchPresenter.getBounds());
      } else {
        bounds = LeafletUtil.newLatLngBounds(searchPresenter.getCountry().getBounds());
      }
    }
    int effectiveZoom = Math.min(8, map.getBoundsZoom(bounds, false));
    map.setView(bounds.getCenter(), effectiveZoom, false);
    map.fitBounds(bounds);
  }
 public a a(LatLng paramLatLng)
 {
   a = Math.min(a, a);
   b = Math.max(b, a);
   double d1 = b;
   if (Double.isNaN(c))
   {
     c = d1;
     d = d1;
   }
   while (a(d1)) {
     return this;
   }
   if (LatLngBounds.a(c, d1) < LatLngBounds.b(d, d1))
   {
     c = d1;
     return this;
   }
   d = d1;
   return this;
 }
 public boolean equals(Object obj) {
   if (this != obj) {
     if (!(obj instanceof VisibleRegion)) {
       return false;
     }
     obj = (VisibleRegion) obj;
     if (!nearLeft.equals(((VisibleRegion) (obj)).nearLeft)
         || !nearRight.equals(((VisibleRegion) (obj)).nearRight)
         || !farLeft.equals(((VisibleRegion) (obj)).farLeft)
         || !farRight.equals(((VisibleRegion) (obj)).farRight)
         || !latLngBounds.equals(((VisibleRegion) (obj)).latLngBounds)) {
       return false;
     }
   }
   return true;
 }
 public final boolean equals(Object obj)
 {
     if (this == obj)
     {
         return true;
     }
     if (!(obj instanceof VisibleRegion))
     {
         return false;
     }
     obj = (VisibleRegion)obj;
     return FG.equals(((VisibleRegion) (obj)).FG) && FH.equals(((VisibleRegion) (obj)).FH) && FI.equals(((VisibleRegion) (obj)).FI) && FJ.equals(((VisibleRegion) (obj)).FJ) && FK.equals(((VisibleRegion) (obj)).FK);
 }