Changeset 4656 in ntrip


Ignore:
Timestamp:
Sep 7, 2012, 3:34:07 PM (12 years ago)
Author:
weber
Message:

Distribution map design improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmap_svg.cpp

    r4654 r4656  
    170170  double height = _maxPointLat - _minPointLat;
    171171  if (width > 0 && height > 0) {
    172     double eps = 2.0;
    173     QRectF rect(_minPointLon-eps, _minPointLat-eps, width+2*eps, height+2*eps);
    174     _mapPlotZoomer->zoom(rect);
     172    double eps = 0.1;
     173    double epsLon = eps*(_maxPointLon - _minPointLon);
     174    double epsLat = eps*(_maxPointLat - _minPointLat);
     175    double minLon = _minPointLon - epsLon;
     176    double minLat = _minPointLat - epsLat;
     177    double widthExt = width + 2*epsLon;
     178    double heightExt = height + 2*epsLat;
     179    if (minLon < -180.) minLon = -180.;
     180    if (minLat <  -90.) minLat =  -90.;
     181    if (widthExt > 360.) widthExt = 360.;
     182    if (heightExt > 180.) heightExt = 180.;
     183    if (widthExt > 270. || heightExt > 135.) {
     184      QRectF rect(-180.,-90.,360.,180.);
     185      _mapPlotZoomer->zoom(rect);
     186    }
     187    else {
     188      QRectF rect(minLon, minLat, widthExt, heightExt);
     189      _mapPlotZoomer->zoom(rect);
     190    }
    175191  }
    176192  QDialog::showEvent(event);
Note: See TracChangeset for help on using the changeset viewer.