Git Product home page Git Product logo

lightmap's People

Contributors

wtpluscn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lightmap's Issues

坐标位置标记偏移

你好,在地图上输入成都原点坐标(104.07°,30.67°),map上标记的位置与城市实际地标有上千米的偏移。

runjavascript

你好:
目前想做一個關於GPS結合Qt的小專案,目前選擇Google Map作為我的地圖,在使用QWebengineView時事可以順利載入地圖的,但我無法使用 webview->page()->runjavascript() 去操作Javascript內的function 程式碼

  QUrl url("qrc:/map.html");

       QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::PluginsEnabled,true);
       QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled,true);
       QWebEnginePage *page = new QWebEnginePage(this);
       QWebChannel *channel = new QWebChannel(this);
       page->load(url);
       page->setWebChannel(channel);
       ui->widget->setPage(page);

        QString js=QString("var marker = new google.maps.Marker({ ")+
        QString("position: new google.maps.LatLng(24.705311, -74.2581939),")+
        QString(" map: map,")+
        QString("title: \"Marker A\",")+
        QString("   }); ");

       ui->widget->page()->runJavaScript(js,[](const QVariant &result){ qDebug() << result.toBool(); });
錯誤回報:
js: Uncaught ReferenceError: google is not defined

目前才剛接觸Qt 的Web功能和javascript,所以也不知道問題出在哪裡?
另外一定要使用Qt webchannel才能對javascript操作嗎?
謝謝!!

開發環境: 
Ubuntu 16.04
Qt 5.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.