qml的离线瓦片地图生成一个图标,使用接口MapQuickItem

/***************生成飞机图标**********************/
    //这个飞机图标
    MapQuickItem{
            z:100
           //指示的坐标点
            coordinate: QtPositioning.coordinate(helicopter_qml.c_lat,helicopter_qml.c_longti)
           //sourceItem左上角相对于coordinate的偏移
           anchorPoint: Qt.point(sourceItem.width/2,sourceItem.height/2)
           //Qt Quick对象
           sourceItem: Image {
               id: ima
               visible: true
               width: 60
               height: 60
               source: "qrc:/new/prefix1/ui/res/image/helicopter.png"
               Rectangle{
                               id:rect_alarm
                               anchors.left: ima.left
                               anchors.top:ima.bottom
                               color: "transparent"
                               opacity: 0.8

                               radius: 10
                               width: 180
                               height: 220
                               border.color: '#fe0404'
                               border.width: 3

                               Text {
                                       id: showAlarmInfo
                                       property var air_alarm_info
                                       property var alarm_info_font_color
                                       anchors.left:parent.left
                                       anchors.top: parent.top
                                       anchors.right: parent.right
                                      // anchors.bottom: parent.bottom

                                       anchors.margins: 10

                                       wrapMode:Text.WordWrap

                                       text: air_alarm_info

                                       //红色 "185 175 15"
                                       //黑色 "#000000"
                                       //黄色 "#fff200"
                                      color:alarm_info_font_color

                                       font {
                                               family: "Arial" // 设置字体家族
                                               pointSize: 12 // 设置字体大小
                                               weight: Font.Bold // 设置字体粗细
                                               italic: false // 设置斜体

                                            }
                                     }
                               Text {
                                       id: showAlarmInfo2
                                       property var  text_name:helicopter_qml.helicopter_name
                                       property var  text_long:helicopter_qml.longtitude
                                       property var text_lati:helicopter_qml.latitude
                                       property var text_height:helicopter_qml.helicopter_height
                                       anchors.left:showAlarmInfo.left
                                       anchors.top: showAlarmInfo.bottom
                                       anchors.right: showAlarmInfo.right
                                       anchors.bottom: rect_alarm.bottom

                                      // anchors.margins: 10
                                       wrapMode:Text.WordWrap

                                       text: "机号:"+text_name+"\n"+
                                             "经度:"+text_long+"\n"+
                                             "纬度:"+text_lati+"\n"+
                                             "飞行高度:"+text_height+"\n"+
                                             "飞行速度:"+55.60+"\n"

                                       //黑色
                                       color: "#000000"
                                       font {
                                               family: "Arial" // 设置字体家族
                                               pointSize: 12 // 设置字体大小
                                               weight: Font.Bold // 设置字体粗细
                                               italic: false // 设置斜体

                                            }
                                     }
                           }


           }
       }

在这里插入图片描述

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-21 19:42:06       52 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-21 19:42:06       54 阅读
  3. 在Django里面运行非项目文件

    2024-07-21 19:42:06       45 阅读
  4. Python语言-面向对象

    2024-07-21 19:42:06       55 阅读

热门阅读

  1. 记一次通过udev自动加在i2c接口触摸驱动过程

    2024-07-21 19:42:06       16 阅读
  2. 优选算法之滑动窗口(下)

    2024-07-21 19:42:06       18 阅读
  3. Linux常用命令(备忘自查)

    2024-07-21 19:42:06       16 阅读
  4. 计算机视觉发展历程

    2024-07-21 19:42:06       17 阅读
  5. python中的fire和Linux shell中的参数传递

    2024-07-21 19:42:06       14 阅读
  6. Vue.js 首屏加载优化:实战与策略

    2024-07-21 19:42:06       13 阅读
  7. 《浔川 AI 五子棋 v5.0 上线倒计时》——浔川官方

    2024-07-21 19:42:06       18 阅读