- Timestamp:
- Jun 8, 2013, 3:44:33 PM (11 years ago)
- Location:
- trunk/BNC/src/map
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/map/bncmapwin.cpp
r5178 r5180 47 47 const int ww = QFontMetrics(font()).width('w'); 48 48 49 setWindowTitle("Map View"); 49 setWindowTitle("BNC: Map View"); 50 51 // BKG Coordinates 52 // --------------- 53 _currLat = 50.090956; 54 _currLon = 8.663283; 50 55 51 56 _webView = new QWebView(this); 52 57 connect(_webView, SIGNAL(loadFinished(bool)), this, SLOT(slotInitMap(bool))); 53 58 54 /// _webView->load(QUrl("http://igs.bkg.bund.de/ntrip/ppp#Scene6"));55 59 loadHtmlPage(); 56 60 57 61 _webView->show(); 58 62 59 QVBoxLayout* dlgLayout = new QVBoxLayout; 60 dlgLayout->addWidget(_webView); 63 // Test 64 // ---- 65 QPushButton* testButton = new QPushButton(tr("Test")); 66 testButton->setMaximumWidth(10*ww); 67 connect(testButton, SIGNAL(clicked()), this, SLOT(slotTest())); 61 68 62 setLayout(dlgLayout); 69 // Layout 70 // ------ 71 QHBoxLayout* buttonLayout = new QHBoxLayout; 72 buttonLayout->addWidget(testButton); 73 74 QVBoxLayout* mainLayout = new QVBoxLayout(this); 75 mainLayout->addWidget(_webView); 76 mainLayout->addLayout(buttonLayout); 77 78 setLayout(mainLayout); 63 79 resize(60*ww, 60*ww); 80 64 81 show(); 65 66 _currLat = 50.090956; // BKG67 _currLon = 8.663283; // BKG68 //// beg test69 slotGotoLocation();70 //// end test71 82 } 72 83 … … 104 115 // 105 116 //////////////////////////////////////////////////////////////////////////// 106 void bncMapWin::slotGotoLocation() { 117 void bncMapWin::slotGotoLocation(double lat, double lon) { 118 _currLat = lat; 119 _currLon = lon; 107 120 QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8); 108 121 _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location)); 109 //// beg test 122 } 123 124 // 125 //////////////////////////////////////////////////////////////////////////// 126 void bncMapWin::slotTest() { 110 127 _currLat += 0.00001; 111 128 _currLon += 0.00001; 112 QTimer::singleShot(100, this, SLOT(slotGotoLocation()));113 //// end test129 slotGotoLocation(_currLat, _currLon); 130 QTimer::singleShot(100, this, SLOT(slotTest())); 114 131 } -
trunk/BNC/src/map/bncmapwin.h
r5177 r5180 39 39 40 40 public slots: 41 void slotGotoLocation( );41 void slotGotoLocation(double lat, double lon); 42 42 43 43 private slots: 44 44 void slotInitMap(bool isOk); 45 void slotTest(); 45 46 46 47 private:
Note:
See TracChangeset
for help on using the changeset viewer.