One, foreword

Line charts the most widely used is also used to draw all kinds of trajectory, behind the line chart is a dynamic trajectory graph, aircraft route chart’s predecessor, a method of public addPolyline, line chart can set the color, thickness, properties such as transparency, if open the suspended the drawing toolbar, may also directly click in the toolbar line chart drawing tools, Direct dynamic drawing.

Two, functional characteristics

  1. Both online map and offline map modes are supported.
  2. Support webKit kernel, WebEngine kernel, miniblink kernel, IE kernel.
  3. You can set multiple annotation points, including name, address, longitude and latitude.
  4. You can set whether the map can be zoomed by clicking, dragging or mouse wheel.

.

3. Experience address

  1. Experience address: pan.baidu.com/s/1ZxG-oyUK… Extraction code: O05q File name: bin_map.zip
  2. Domestic site: gitee.com/feiyangqing…
  3. International site: github.com/feiyangqing…
  4. Profile: blog.csdn.net/feiyangqing…
  5. Zhihu homepage: www.zhihu.com/people/feiy…

Four, effect drawing

5. Relevant codes

void MapBaiDu::addPolyline(QStringList &list)
{
    // Dynamically add foldslist << QString(" function addPolyline(points, color, weight, opacity) {"); list << QString(" var pts = getPoints(points);" ); list << QString(" var property = getProperty(color, weight, opacity);" ); list << QString(" var polyline =new%1.Polyline(pts, property);" ).arg(mapFlag); list << QString(" map.addOverlay(polyline);" ); list << QString(" }"); }void frmMapBaiDu::on_btnDrawRoute_clicked()
{
    if(routeDatas. The count () = = 0) {QUIHelper: : showMessageBoxError (" please click on the route query for route the coordinates of the point set!" );return; } // Clear runJs("deleteOverlay('Polyline')"); / / will receive path point collection points line drawing foreach (QStringList data, routeDatas) {QString points = data. Join (" | "); QString js = QString("addPolyline('%1', '#ff0000')").arg(points); runJs(js); }}Copy the code