. 标记
GeoDataPlacemark *place = new GeoDataPlacemark( "Bucharest" );
place->setCoordinate( 25.97, 44.43, 0.0, GeoDataCoordinates::Degree );
place->setPopulation( );
place->setCountryCode ( "Romania" ); GeoDataDocument *document = new GeoDataDocument;
document->append( place ); // Add the document to MarbleWidget's tree model
mapWidget->model()->treeModel()->addDocument( document ); . 初始位置
GeoDataCoordinates home(, 30.0, 10.0, GeoDataCoordinates::Degree);
mapWidget->centerOn(home); .鼠标当前位置
// Connect the map widget to the position label.
QObject::connect(mapWidget, SIGNAL(mouseMoveGeoPosition(QString)),
positionLabel, SLOT(setText(QString)));
4.设置投影
   mapWidget->setProjection( Mercator ); 5.获取设置控件
  foreach ( AbstractFloatItem * floatItem, mapWidget->floatItems() )
        if ( floatItem && floatItem->nameId() == "compass" ) {
 
// Put the compass onto the left hand side
floatItem->setPosition( QPoint( 10, 10 ) );
// Make the content size of the compass smaller
floatItem->setContentSize( QSize( 50, 50 ) );
}
 6.绘制标记

  void MyMarbleWidget::customPaint(GeoPainter* painter)
  {
    GeoDataCoordinates home(8.4, 49.0, 0.0, GeoDataCoordinates::Degree);
    painter->setPen(Qt::green);
    painter->drawEllipse(home, 17, 17);
    painter->setPen(Qt::red);
    painter->drawText(home, "Hello Marble!");
  }

 

最新文章

  1. Linux实战教学笔记07:Linux系统目录结构介绍
  2. Asp.net 面向接口可扩展框架之业务规则引擎扩展组件
  3. linux学习日记之老男孩
  4. 详解JavaScript中的this
  5. django的信号
  6. Hadoop组件之-HDFS(HA实现细节)
  7. paip.一千 常用汉字 高频汉字 覆盖率90%
  8. HDU 5821 Ball (排序)
  9. ionic默认样式android和ios的一些不同(当时真是纠结啊~)
  10. 移动Web开发,4行代码检测浏览器是否支持position:fixed
  11. 用Jpush极光推送实现抓取特定某个用户Log到七牛云服务器
  12. ThinkPHP - 查询语句
  13. apache 安装[转]
  14. MongoDB 学习笔记(原创)
  15. 单词计数,杭电0j-2072
  16. log4j日志框架学习
  17. JDBC 连接Oracle
  18. MacPro4,1升级到MacPro5,1
  19. 给定一个只包含正整数的非空数组,返回该数组中重复次数最多的前N个数字 ,返回的结果按重复次数从多到少降序排列(N不存在取值非法的情况)
  20. 解决方案:ppt打不开,显示发现文件中的内容有问题。可尝试修复此演示文稿

热门文章

  1. C# 语言规范_版本5.0 (第20章 附录B_语法)
  2. ios微信支付成功后点击左上角返回不走回调的问题
  3. CodeForces 707C Pythagorean Triples
  4. google 技巧
  5. javascript和jquery比较中学习
  6. How to fix 'sudo: no tty present and no askpass program'以及硬盘序列号的读写
  7. IIS SSL取消证书合法性验证
  8. .net 可枚举类型的构建方法
  9. jQuery(7)——jQuery与Ajax的应用
  10. linux虚拟机正常安装完成后获取不到IP的解决办法