Changeset 5180 in ntrip


Ignore:
Timestamp:
Jun 8, 2013, 3:44:33 PM (8 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/map
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/map/bncmapwin.cpp

    r5178 r5180  
    4747  const int ww = QFontMetrics(font()).width('w');
    4848
    49   setWindowTitle("Map View");
     49  setWindowTitle("BNC: Map View");
     50
     51  // BKG Coordinates
     52  // ---------------
     53  _currLat = 50.090956;
     54  _currLon =  8.663283;
    5055
    5156  _webView = new QWebView(this);
    5257  connect(_webView, SIGNAL(loadFinished(bool)), this, SLOT(slotInitMap(bool)));
    5358
    54   ///  _webView->load(QUrl("http://igs.bkg.bund.de/ntrip/ppp#Scene6"));
    5559  loadHtmlPage();
    5660
    5761  _webView->show(); 
    5862
    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()));
    6168
    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);
    6379  resize(60*ww, 60*ww);
     80
    6481  show();
    65 
    66   _currLat = 50.090956; // BKG
    67   _currLon =  8.663283; // BKG
    68   //// beg test
    69   slotGotoLocation();
    70   //// end test
    7182}
    7283
     
    104115//
    105116////////////////////////////////////////////////////////////////////////////
    106 void bncMapWin::slotGotoLocation() {
     117void bncMapWin::slotGotoLocation(double lat, double lon) {
     118  _currLat = lat;
     119  _currLon = lon;
    107120  QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8);
    108121  _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location));
    109   //// beg test
     122}
     123
     124//
     125////////////////////////////////////////////////////////////////////////////
     126void bncMapWin::slotTest() {
    110127  _currLat += 0.00001;
    111128  _currLon += 0.00001;
    112   QTimer::singleShot(100, this, SLOT(slotGotoLocation()));
    113   //// end test
     129  slotGotoLocation(_currLat, _currLon);
     130  QTimer::singleShot(100, this, SLOT(slotTest()));
    114131}
  • trunk/BNC/src/map/bncmapwin.h

    r5177 r5180  
    3939
    4040 public slots:
    41   void slotGotoLocation();
     41  void slotGotoLocation(double lat, double lon);
    4242
    4343 private slots:
    4444  void slotInitMap(bool isOk);
     45  void slotTest();
    4546
    4647 private:
Note: See TracChangeset for help on using the changeset viewer.