- Timestamp:
- Sep 12, 2013, 4:12:06 PM (11 years ago)
- Location:
- trunk/GnssCenter/map_stations
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/map_stations/worldplot.cpp
r5419 r5421 49 49 mapItem->attach(this); 50 50 51 // Minimal and Maximal Coordinates52 // -------------------------------53 _minPointLat = 0.0;54 _maxPointLat = 0.0;55 _minPointLon = 0.0;56 _maxPointLon = 0.0;57 58 51 // Important 59 52 // --------- … … 90 83 marker->setSymbol(symbol); 91 84 marker->attach(this); 92 93 // Remeber minimal and maximal coordinates94 // ---------------------------------------95 if (_minPointLat == 0.0 && _maxPointLat == 0.0 &&96 _minPointLon == 0.0 && _maxPointLon == 0.0) {97 _minPointLat = latDeg;98 _maxPointLat = latDeg;99 _minPointLon = lonDeg;100 _maxPointLon = lonDeg;101 }102 else {103 if (_maxPointLat < latDeg) {104 _maxPointLat = latDeg;105 }106 else if (_minPointLat > latDeg) {107 _minPointLat = latDeg;108 }109 if (_maxPointLon < lonDeg) {110 _maxPointLon = lonDeg;111 }112 else if (_minPointLon > lonDeg) {113 _minPointLon = lonDeg;114 }115 }116 85 } 117 118 ////119 //////////////////////////////////////////////////////////////////////////////120 //void t_worldPlot::showEvent(QShowEvent* event) {121 // double width = _maxPointLon - _minPointLon;122 // double height = _maxPointLat - _minPointLat;123 // if (width > 0 && height > 0) {124 //125 // // Extend plot area by 10 percent126 // // ------------------------------127 // double eps = 0.1;128 // double epsLon = eps * (_maxPointLon - _minPointLon);129 // double epsLat = eps * (_maxPointLat - _minPointLat);130 // double widthExt = width + 2 * epsLon;131 // double heightExt = height + 2 * epsLat;132 // double minLon = _minPointLon - epsLon;133 // double minLat = _minPointLat - epsLat;134 //135 // // Keep lat/lon relations136 // // ----------------------137 // double widthBorder = widthExt;138 // double heightBorder = heightExt;139 // double scale = widthExt/heightExt/2.;140 // if ( scale < 1.) {141 // widthBorder = widthExt / scale;142 // minLon = minLon - (widthBorder - widthExt)/2.;143 // }144 // else {145 // heightBorder = heightExt * scale;146 // minLat = minLat - (heightBorder - heightExt)/2.;147 // }148 //149 // // Borders shall not exceed min or max values150 // // ------------------------------------------151 // if (minLon < -180.) minLon = -180.;152 // if (minLat < -90.) minLat = -90.;153 // double maxLat = minLat + heightBorder;154 // if ( maxLat > 90) minLat = minLat - (maxLat - 90.);155 // double maxLon = minLon + widthBorder;156 // if ( maxLon > 180) minLon = minLon - (maxLon - 180.);157 //158 // // Area large enough to justify world map159 // // --------------------------------------160 // if (widthBorder < 270.0 && heightBorder < 135.0) {161 // QRectF rect(minLon, minLat, widthBorder, heightBorder);162 // _zoomer->zoom(rect);163 // }164 // }165 //}166 86 167 87 // Print the widget -
trunk/GnssCenter/map_stations/worldplot.h
r5419 r5421 20 20 private: 21 21 QwtPlotZoomer* _zoomer; 22 double _minPointLat;23 double _maxPointLat;24 double _minPointLon;25 double _maxPointLon;26 22 }; 27 23
Note:
See TracChangeset
for help on using the changeset viewer.