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 // 设置斜体

                                            }
                                     }
                           }


           }
       }

在这里插入图片描述

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值