OpenLayers 加载测量控件

news2025/5/25 15:03:15

注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key

地图控件是一些用来与地图进行简单交互的工具,地图库预先封装好,可以供开发者直接使用。OpenLayers具有大部分常用的控件,如缩放、导航、鹰眼、比例尺、旋转、鼠标位置等。

这些控件都是基于 ol.control.Control基类进行封装的,可以通过Map对象的controls属性或者调用addControl方法添加到地图中。地图控件通过HTML插入到Map页面,可以利用CSS调整地图控件样式。OpenLayers初始化地图时利用ol.control.default默认加载了缩放控件(ol.control.Zoom

本节主要介绍创建测量控件

1. 创建绘制对象结构

创建绘制对象结构

<div class="measure-control" id="measure-control">
  <label>Geometry type &nbsp;</label>
  <select id="select-type">
    <option value="length">Length</option>
    <option value="area">Area</option>
  </select>
  <label class="checkbox">
    <input type="checkbox" id="geodesic"/>use geodesic measures
  </label>
</div>

测量工具及测量提示框样式。

.measure-control {
  position: relative;
  background: #434343a8;
  width: 30%;
  margin: 0 auto;
  top: 19px;
  padding: 5px 10px;
  border-radius: 5px;
  color: #fff;
}

/*提示框信息样式*/
.tooltip{
    position:relative;
    background:rgba(0,0,0,.5);
    border-radius:4px;
    color:#ffffff;
    padding:4px 8px;
    opacity:0.7;
    white-space:nowrap
}
.tooltip-measure{
    opacity:1;
    font-weight:bold
}
.tooltip-static{
    background-color:#ffcc33;
    color:black;
    border:1px solid white
}
.tooltip-measure:before,.tooltip-static:before{
    border-top: 6px solid rgba(0, 0, 0, 0.5);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    content: "";
    position: absolute;
    bottom: -6px;
    margin-left: -7px;
    left: 50%;
}
.tooltip-static:before {
    border-top-color: #ffcc33;
}

2. 创建矢量图层

创建矢量图层需要添加矢量数据源,然后添加矢量图层并设置其样式。

// 创建矢量图层
const vectorSource = new ol.source.Vector()
const vectorLayer = new ol.layer.Vector({
    source: vectorSource,
    style: new ol.style.Style({
        fill: new ol.style.Fill({
            // 填充色
            color:'rgba(255,255,255,0.2)'
        }),
        stroke: new ol.style.Stroke({
            color: '#ffcc33', // 边线颜色
            width: 2.5    // 边线宽度
        }),
        // 圆形点样式
        image: new ol.style.Circle({
            radius: 7, // 圆形点半径
            fill: new ol.style.Fill({
                color:'#ffcc33' // 圆形点填充色
            })
        })
    })
})
map.addLayer(vectorLayer)

3. 添加绘制交互对象

监听选择绘制类型,根据不同类型绘制几何对象

function addInteraction() {
      const type = selectType.value === 'area' ? 'Polygon' : 'LineString'
      draw = new ol.interaction.Draw({
          source: vectorSource,
          type: type,
          style: new ol.style.Style({
              fill: new ol.style.Fill({
                  color:"rgba(255,255,255,0.2)"
              }),
              stroke: new ol.style.Stroke({
                  color:"#ffcc33",
                  lineDash:[10,10],
                  width:2
              }),
              image: new ol.style.Circle({
                  radius: 5,
                  fill: new ol.style.Fill({
                      color:'rgba(255,255,255,0.2)'
                  })
              })
          })
      })
      map.addInteraction(draw)
      createMeasureTooltip() // 测量工具提示框
      createHelpTooltip() // 帮助信息提示框框
      let listener = null
      // 监听开始绘制事件
      draw.on('drawstart', function (evt) {
          // 绘制要素
          sketch = evt.feature
          // 绘制坐标
          let tooltipCoord = evt.coordinate
          // 绑定change事件,根据绘制几何图形类型得到测量距离或者面积,并将其添加到测量工具提示框
          listener = sketch.getGeometry().on('change', evt=> {
              // 绘制的几何对象
              const geom = evt.target
              let output = 0
              if (geom instanceof ol.geom.Polygon) {
                  output = formatArea(geom)
                  tooltipCoord = geom.getInteriorPoint().getCoordinates()
              } else {
                  output = formatLength(geom)
                  tooltipCoord = geom.getLastCoordinate()
              }
              // 将测量值添加到提示框
              measureTooltipElement.innerHTML = output
              // 设置测量提示工具框的位置
              measureTooltip.setPosition(tooltipCoord)
          })
      }, this)

      draw.on('drawend', function(evt) {
          measureTooltipElement.className = 'tooltip tooltip-static'
          measureTooltip.setOffset([0, -7])
          sketch = null
          measureTooltipElement = null
          createMeasureTooltip()
          ol.Observable.unByKey(listener)
      },this)
}

4. 创建帮助信息提示框

function createHelpTooltip() {
    if (helpTooltip) {
        helpTooltipElement.parentNode.removeChild(helpTooltipElement)
    }
    helpTooltipElement = document.createElement('div')
    helpTooltipElement.className = 'tooltip hidden'

    helpTooltip = new ol.Overlay({
        element: helpTooltipElement,
        offset: [15, 0],
        positioning:'center-left'
    })
    map.addOverlay(helpTooltip)
}

5. 创建测量提示框

function createMeasureTooltip() {
    if (measureTooltipElement) {
        measureTooltipElement.parentNode.removeChild(measureTooltipElement)
    }
    measureTooltipElement = document.createElement('div') 
    measureTooltipElement.className = 'tooltip tooltip-measure'
    measureTooltip = new ol.Overlay({
        element: measureTooltipElement,
        offset: [0, -15],
        positioning:'bottom-center'
    })
    map.addOverlay(measureTooltip)
}

6. 创建面积与长度测量方法

// 创建距离测算方法
function formatLength(line) {
    let length = 0
    if (geodesicCheckBox.checked) {
        // 经纬度测量,曲面面积
        const sourcePrj = map.getView().getProjection()
        length = ol.sphere.getLength(line,{'projection':sourcePrj,'radius':678137})
    } else {
        length = Math.round(line.getLength()*100)/100
    }
    let output = 0;
    if (length > 100) {
        output = (Math.round(length / 1000 * 100) / 100) + ' ' + 'km'; //换算成KM单位
    } else {
        output = (Math.round(length * 100) / 100) + ' ' + 'm'; //m为单位
    }
    return output;//返回线的长度
}
// 创建面积测算方法
function formatArea (polygon) {
    let area = 0;
    if (geodesicCheckBox.checked) {//若使用测地学方法测量
        const sourceProj = map.getView().getProjection();//地图数据源投影坐标系
        const geom = (polygon.clone().transform(sourceProj, 'EPSG:4326')); //将多边形要素坐标系投影为EPSG:4326
        area = Math.abs(ol.sphere.getArea(geom, { "projection": sourceProj, "radius": 6378137 })); //获取面积
    } else {
        area = polygon.getArea();//直接获取多边形的面积
    }
    let output = 0;
    if (area > 10000) {
        output = (Math.round(area / 1000000 * 100) / 100) + ' ' + 'km<sup>2</sup>'; //换算成KM单位
    } else {
        output = (Math.round(area * 100) / 100) + ' ' + 'm<sup>2</sup>';//m为单位
    }
    return output; //返回多边形的面积
};

7. 监听鼠标移动事件

// 添加地图鼠标移动事件
const drawPolygonMsg = "Click to continue drawing the polygon"
const drawLineMsg = "Click to continue drawing the line"
// 鼠标移动事件处理函数
const pointerMoveHandler = evt=> {
    if (evt.dragging) {
        return
    }
    let helpMsg = "Click to start drawing" // 默认提示信息
    // 判断绘制的几何类型,设置对应信息提示框
    if (sketch) {
        const geom = sketch.getGeometry()
        if (geom instanceof ol.geom.Polygon) {
            helpMsg = drawPolygonMsg
        } else if (geom instanceof ol.geom.LineString) {
            helpMsg = drawLineMsg
        }
    }
    helpTooltipElement.innerHTML = helpMsg // 

    helpTooltip.setPosition(evt.coordinate)
    $(helpTooltipElement).removeClass('hidden') // 移除隐藏样式

}
map.on('pointermove', pointerMoveHandler) // 绑定鼠标移动事件,动态显示帮助信息提示框
$(map.getViewport()).on('mouseout', evt=> {
    $(helpTooltipElement).addClass('hidden')
})

8. 完整代码

其中libs文件夹下的包需要更换为自己下载的本地包或者引用在线资源。

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>加载测量控件</title>
    <meta charset="utf-8" />
    <script src="../libs/js/ol-5.3.3.js"></script>
    <script src="../libs/js/jquery-2.1.1.min.js"></script>
    <link rel="stylesheet" href="../libs/css//ol.css">
    <style>
        * {
            padding: 0;
            margin: 0;
            font-size: 14px;
            font-family: '微软雅黑';
        }
        html,body{
            width:100%;
            height:100%;
        }
        #map {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .measure-control {
            position: relative;
            background: #434343a8;
            width: 30%;
            margin: 0 auto;
            top: 19px;
            padding: 5px 10px;
            border-radius: 5px;
            color: #fff;
        }

        /*提示框信息样式*/
        .tooltip{
            position:relative;
            background:rgba(0,0,0,.5);
            border-radius:4px;
            color:#ffffff;
            padding:4px 8px;
            opacity:0.7;
            white-space:nowrap
        }
        .tooltip-measure{
            opacity:1;
            font-weight:bold
        }
        .tooltip-static{
            background-color:#ffcc33;
            color:black;
            border:1px solid white
        }
        .tooltip-measure:before,.tooltip-static:before{
            border-top: 6px solid rgba(0, 0, 0, 0.5);
            border-right: 6px solid transparent;
            border-left: 6px solid transparent;
            content: "";
            position: absolute;
            bottom: -6px;
            margin-left: -7px;
            left: 50%;
        }
        .tooltip-static:before {
            border-top-color: #ffcc33;
         }
    </style>
</head>
<body>
    <div id="map" title="地图显示"></div>
    <div class="measure-control" id="measure-control">
        <label>Geometry type &nbsp;</label>
        <select id="select-type">
            <option value="length">Length</option>
            <option value="area">Area</option>
        </select>
        <label class="checkbox">
            <input type="checkbox" id="geodesic"/>use geodesic measures
        </label>
    </div>
</body>
</html>
<script>

    //==============================================================================//
    //============================天地图服务参数简单介绍============================//
    //================================vec:矢量图层=================================//
    //================================img:影像图层=================================//
    //================================cva:注记图层=================================//
    //=========================其中:_c表示经纬度,_w表示投影=======================//
    //==============================================================================//
    const TDTImgLayer = new ol.layer.Tile({
        title: "天地图影像图层",
        source: new ol.source.XYZ({
            url: "http://t0.tianditu.com/DataServer?T=img_c&x={x}&y={y}&l={z}&tk=2a890fe711a79cafebca446a5447cfb2",
            attibutions: "天地图注记描述",
            crossOrigin: "anoymous",
            wrapX: false
        })
    })
    const TDTVecLayer = new ol.layer.Tile({
        title: "天地图矢量图层",
        source: new ol.source.XYZ({
            url: "http://t0.tianditu.com/DataServer?T=vec_c&x={x}&y={y}&l={z}&tk=2a890fe711a79cafebca446a5447cfb2",
            attibutions: "天地图注记描述",
            crossOrigin: "anoymous",
            wrapX: false
        })
    })

    const map = new ol.Map({
        target: "map",
        loadTilesWhileInteracting: true,
        view: new ol.View({
            // center: [11444274, 12707441],
            center: [12992990, 13789010],
            // center: ol.proj.fromLonLat([102,25.5]),
            zoom: 15,
            worldsWrap: true,
            minZoom: 1,
            maxZoom: 20,
        }),
        controls: ol.control.defaults().extend([
            new ol.control.MousePosition()
        ])
    })
    map.addLayer(TDTVecLayer)
    map.addLayer(TDTImgLayer)

    // 创建矢量图层
    const vectorSource = new ol.source.Vector()
    const vectorLayer = new ol.layer.Vector({
        source: vectorSource,
        style: new ol.style.Style({
            fill: new ol.style.Fill({
                // 填充色
                color:'rgba(255,255,255,0.2)'
            }),
            stroke: new ol.style.Stroke({
                color: '#ffcc33', // 边线颜色
                width: 2.5// 边线宽度
            }),
            // 顶点样式
            image: new ol.style.Circle({
                radius: 7,
                fill: new ol.style.Fill({
                    color:'#ffcc33'
                })
            })
        })
    })
    map.addLayer(vectorLayer)

    let draw = null // 绘制对象
    let sketch = null // 当前绘制要素

    let helpTooltipElement = null // 创建提示框
    let helpTooltip = null

    // 创建测量工具提示框
    let measureTooltipElement = null
    let measureTooltip = null

    const geodesicCheckBox = document.getElementById('geodesic')
    // 创建测量交互函数
    const selectType = document.getElementById('select-type')
    selectType.onchange = evt=> {
        // 移除交互式控件
        if (draw) {
            map.removeInteraction(draw)
        }
        // 添加交互式控件进行测量
        addInteraction()
    }
    addInteraction()

    function addInteraction() {
        const type = selectType.value === 'area' ? 'Polygon' : 'LineString'
        draw = new ol.interaction.Draw({
            source: vectorSource,
            type: type,
            style: new ol.style.Style({
                fill: new ol.style.Fill({
                    color:"rgba(255,255,255,0.2)"
                }),
                stroke: new ol.style.Stroke({
                    color:"#ffcc33",
                    lineDash:[10,10],
                    width:2
                }),
                image: new ol.style.Circle({
                    radius: 5,
                    fill: new ol.style.Fill({
                        color:'rgba(255,255,255,0.2)'
                    })
                })
            })
        })
        map.addInteraction(draw)
        createMeasureTooltip() // 测量工具提示框
        createHelpTooltip() // 帮助信息提示框框
        let listener = null
        // 监听开始绘制事件
        draw.on('drawstart', function (evt) {
            // 绘制要素
            sketch = evt.feature
            // 绘制坐标
            let tooltipCoord = evt.coordinate
            // 绑定change事件,根据绘制几何图形类型得到测量距离或者面积,并将其添加到测量工具提示框
            listener = sketch.getGeometry().on('change', evt=> {
                // 绘制的几何对象
                const geom = evt.target
                let output = 0
                if (geom instanceof ol.geom.Polygon) {
                    output = formatArea(geom)
                    tooltipCoord = geom.getInteriorPoint().getCoordinates()
                } else {
                    output = formatLength(geom)
                    tooltipCoord = geom.getLastCoordinate()
                }
                // 将测量值添加到提示框
                measureTooltipElement.innerHTML = output
                // 设置测量提示工具框的位置
                measureTooltip.setPosition(tooltipCoord)
            })
        }, this)

        draw.on('drawend', function(evt) {
            measureTooltipElement.className = 'tooltip tooltip-static'
            measureTooltip.setOffset([0, -7])
            sketch = null
            measureTooltipElement = null
            createMeasureTooltip()
            ol.Observable.unByKey(listener)
        },this)
    }

    function createHelpTooltip() {
        if (helpTooltip) {
            helpTooltipElement.parentNode.removeChild(helpTooltipElement)
        }
        helpTooltipElement = document.createElement('div')
        helpTooltipElement.className = 'tooltip hidden'

        helpTooltip = new ol.Overlay({
            element: helpTooltipElement,
            offset: [15, 0],
            positioning:'center-left'
        })
        map.addOverlay(helpTooltip)
    }

    function createMeasureTooltip() {
        if (measureTooltipElement) {
            measureTooltipElement.parentNode.removeChild(measureTooltipElement)
        }
        measureTooltipElement = document.createElement('div') 
        measureTooltipElement.className = 'tooltip tooltip-measure'
        measureTooltip = new ol.Overlay({
            element: measureTooltipElement,
            offset: [0, -15],
            positioning:'bottom-center'
        })
        map.addOverlay(measureTooltip)
    }

    // 创建面积与距离测算方法

    function formatLength(line) {
        let length = 0
        if (geodesicCheckBox.checked) {
            // 经纬度测量,曲面面积
            const sourcePrj = map.getView().getProjection()
            length = ol.sphere.getLength(line,{'projection':sourcePrj,'radius':678137})
        } else {
            length = Math.round(line.getLength()*100)/100
        }
        let output = 0;
        if (length > 100) {
            output = (Math.round(length / 1000 * 100) / 100) + ' ' + 'km'; //换算成KM单位
        } else {
            output = (Math.round(length * 100) / 100) + ' ' + 'm'; //m为单位
        }
        return output;//返回线的长度
    }

    function formatArea (polygon) {
        let area = 0;
        if (geodesicCheckBox.checked) {//若使用测地学方法测量
            const sourceProj = map.getView().getProjection();//地图数据源投影坐标系
            const geom = (polygon.clone().transform(sourceProj, 'EPSG:4326')); //将多边形要素坐标系投影为EPSG:4326
            area = Math.abs(ol.sphere.getArea(geom, { "projection": sourceProj, "radius": 6378137 })); //获取面积
        } else {
            area = polygon.getArea();//直接获取多边形的面积
        }
        let output = 0;
        if (area > 10000) {
            output = (Math.round(area / 1000000 * 100) / 100) + ' ' + 'km<sup>2</sup>'; //换算成KM单位
        } else {
            output = (Math.round(area * 100) / 100) + ' ' + 'm<sup>2</sup>';//m为单位
        }
        return output; //返回多边形的面积
    };

    // 添加地图鼠标移动事件
    const drawPolygonMsg = "Click to continue drawing the polygon"
    const drawLineMsg = "Click to continue drawing the line"
    // 鼠标移动事件处理函数
    const pointerMoveHandler = evt=> {
        if (evt.dragging) {
            return
        }
        let helpMsg = "Click to start drawing" // 默认提示信息
        // 判断绘制的几何类型,设置对应信息提示框
        if (sketch) {
            const geom = sketch.getGeometry()
            if (geom instanceof ol.geom.Polygon) {
                helpMsg = drawPolygonMsg
            } else if (geom instanceof ol.geom.LineString) {
                helpMsg = drawLineMsg
            }
        }
        helpTooltipElement.innerHTML = helpMsg // 

        helpTooltip.setPosition(evt.coordinate)
        $(helpTooltipElement).removeClass('hidden') // 移除隐藏样式

    }
    map.on('pointermove', pointerMoveHandler) // 绑定鼠标移动事件,动态显示帮助信息提示框
    $(map.getViewport()).on('mouseout', evt=> {
        $(helpTooltipElement).addClass('hidden')
    })
</script>

OpenLayers示例数据下载,请回复关键字:ol数据

全国信息化工程师-GIS 应用水平考试资料,请回复关键字:GIS考试

【GIS之路】 已经接入了智能助手,欢迎关注,欢迎提问。

欢迎访问我的博客网站-长谈GIShttp://shanhaitalk.com

都看到这了,不要忘记点赞、收藏 + 关注

本号不定时更新有关 GIS开发 相关内容,欢迎关注 !

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2385417.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

算法学习——从零实现循环神经网络

从零实现循环神经网络 一、任务背景二、数据读取与准备1. 词元化2. 构建词表 三、参数初始化与训练1. 参数初始化2. 模型训练 四、预测总结 一、任务背景 对于序列文本来说&#xff0c;如何通过输入的几个词来得到后面的词一直是大家关注的任务之一&#xff0c;即&#xff1a;…

win10使用nginx做简单负载均衡测试

一、首先安装Nginx&#xff1a; 官网链接&#xff1a;https://nginx.org/en/download.html 下载完成后&#xff0c;在本地文件中解压。 解压完成之后&#xff0c;打开conf --> nginx.config 文件 1、在 http 里面加入以下代码 upstream GY{#Nginx是如何实现负载均衡的&a…

2025电工杯数学建模B题思路数模AI提示词工程

我发布的智能体链接&#xff1a;数模AI扣子是新一代 AI 大模型智能体开发平台。整合了插件、长短期记忆、工作流、卡片等丰富能力&#xff0c;扣子能帮你低门槛、快速搭建个性化或具备商业价值的智能体&#xff0c;并发布到豆包、飞书等各个平台。https://www.coze.cn/search/n…

【日志软件】hoo wintail 的替代

hoo wintail 的替代 主要问题是日志大了以后会卡有时候日志覆盖后&#xff0c;改变了&#xff0c;更新了&#xff0c;hoo wintail可能无法识别需要重新打开。 有很多类似的日志监控软件可以替代。以下是一些推荐的选项&#xff1a; 免费软件 BareTail 轻量级的实时日志查看…

Ollama-OCR:基于Ollama多模态大模型的端到端文档解析和处理

基本介绍 Ollama-OCR是一个Python的OCR解析库&#xff0c;结合了Ollama的模型能力&#xff0c;可以直接处理 PDF 文件无需额外转换&#xff0c;轻松从扫描版或原生 PDF 文档中提取文本和数据。根据使用的视觉模型和自定义提示词&#xff0c;Ollama-OCR 可支持多种语言&#xf…

OpenCV CUDA 模块中图像过滤------创建一个拉普拉斯(Laplacian)滤波器函数createLaplacianFilter()

操作系统&#xff1a;ubuntu22.04 OpenCV版本&#xff1a;OpenCV4.9 IDE:Visual Studio Code 编程语言&#xff1a;C11 算法描述 cv::cuda::createLaplacianFilter 是 OpenCV CUDA 模块中的一个函数&#xff0c;用于创建一个 拉普拉斯&#xff08;Laplacian&#xff09;滤波器…

图论学习笔记 3

自认为写了很多&#xff0c;后面会出 仙人掌、最小树形图 学习笔记。 多图警告。 众所周知王老师有一句话&#xff1a; ⼀篇⽂章不宜过⻓&#xff0c;不然之后再修改使⽤的时候&#xff0c;在其中找想找的东⻄就有点麻烦了。当然⽂章也不宜过多&#xff0c;不然想要的⽂章也不…

【将WPS设置为默认打开方式】--突然无法用WPS打开文件

1. 点击【开始】——【WPS Office】——【配置工具】&#xff1b; 2. 在出现的弹窗中&#xff0c;点击【高级】&#xff1b; 3. 在“兼容设置”中&#xff0c;将复选框勾上&#xff0c;点击【确定】。

电子人的分水岭-FPGA模电和数电

为什么模电这么难学&#xff1f;一文带你透彻理解模电 ——FPGA是“前期数电&#xff0c;后期模电”的典型代表 在电子工程的世界里&#xff0c;有两门基础课程让无数学生“闻之色变”&#xff1a;数字电路&#xff08;数电&#xff09; 和 模拟电路&#xff08;模电&#xff0…

(6)python爬虫--selenium

文章目录 前言一、初识selenium二、安装selenium2.1 查看chrome版本并禁止chrome自动更新2.1.1 查看chrome版本2.1.2 禁止chrome更新自动更新 2.2 安装对应版本的驱动程序2.3安装selenium包 三、selenium关于浏览器的使用3.1 创建浏览器、设置、打开3.2 打开/关闭网页及浏览器3…

Python之两个爬虫案例实战(澎湃新闻+网易每日简报):附源码+解释

目录 一、案例一&#xff1a;澎湃新闻时政爬取 &#xff08;1&#xff09;数据采集网站 &#xff08;2&#xff09;数据介绍 &#xff08;3&#xff09;数据采集方法 &#xff08;4&#xff09;数据采集过程 二、案例二&#xff1a;网易每日新闻简报爬取 &#xff08;1&#x…

✨ PLSQL卡顿优化

✨ PLSQL卡顿优化 1.&#x1f4c2; 打开首选项2.&#x1f527; Oracle连接配置3.⛔ 关闭更新和新闻 1.&#x1f4c2; 打开首选项 2.&#x1f527; Oracle连接配置 3.⛔ 关闭更新和新闻

python+vlisp实现对多段线范围内土方体积的计算

#在工程中&#xff0c;经常用到计算土方回填、土方开挖的体积。就是在一个范围内&#xff0c;计算土被挖走&#xff0c;或者填多少&#xff0c;这个需要测量挖填前后这个范围内的高程点。为此&#xff0c;我开发一个app&#xff0c;可以直接在autocad上提取高程点&#xff0c;然…

APM32小系统键盘PCB原理图设计详解

APM32小系统键盘PCB原理图设计详解 一、APM32小系统简介 APM32微控制器是国内半导体厂商推出的一款高性能ARM Cortex-M3内核微控制器&#xff0c;与STM32高度兼容&#xff0c;非常适合DIY爱好者用于自制键盘、开发板等电子项目。本文将详细讲解如何基于APM32 CBT6芯片设计一款…

对象存储(Minio)使用

目录 1.安装 MinIO&#xff08;Windows&#xff09; 2.启动minio服务&#xff1a; 3.界面访问 4.进入界面 5.前后端代码配置 1)minio前端配置 2&#xff09;minio后端配置 1.安装 MinIO&#xff08;Windows&#xff09; 官方下载地址&#xff1a;[Download High-Perform…

yolov11使用记录(训练自己的数据集)

官方&#xff1a;Ultralytics YOLO11 -Ultralytics YOLO 文档 1、安装 Anaconda Anaconda安装与使用_anaconda安装好了怎么用python-CSDN博客 2、 创建虚拟环境 安装好 Anaconda 后&#xff0c;打开 Anaconda 控制台 创建环境 conda create -n yolov11 python3.10 创建完后&…

知识宇宙:技术文档该如何写?

名人说&#xff1a;博观而约取&#xff0c;厚积而薄发。——苏轼《稼说送张琥》 创作者&#xff1a;Code_流苏(CSDN)&#xff08;一个喜欢古诗词和编程的Coder&#x1f60a;&#xff09; 目录 一、技术文档的价值与挑战1. 为什么技术文档如此重要2. 技术文档面临的挑战 二、撰…

技嘉主板怎么开启vt虚拟化功能_技嘉主板开启vt虚拟化教程(附intel和amd开启方法)

最近使用技嘉主板的小伙伴们问我&#xff0c;技嘉主板怎么开启vt虚拟。大多数可以在Bios中开启vt虚拟化技术&#xff0c;当CPU支持VT-x虚拟化技术&#xff0c;有些电脑会自动开启VT-x虚拟化技术功能。而大部分的电脑则需要在Bios Setup界面中&#xff0c;手动进行设置&#xff…

Java 并发编程高级技巧:CyclicBarrier、CountDownLatch 和 Semaphore 的高级应用

Java 并发编程高级技巧&#xff1a;CyclicBarrier、CountDownLatch 和 Semaphore 的高级应用 一、引言 在 Java 并发编程中&#xff0c;CyclicBarrier、CountDownLatch 和 Semaphore 是三个常用且强大的并发工具类。它们在多线程场景下能够帮助我们实现复杂的线程协调与资源控…

PT5F2307触摸A/D型8-Bit MCU

1. 产品概述 ● PT5F2307是一款51内核的触控A/D型8位MCU&#xff0c;内置16K*8bit FLASH、内部256*8bit SRAM、外部512*8bit SRAM、触控检测、12位高精度ADC、RTC、PWM等功能&#xff0c;抗干扰能力强&#xff0c;适用于滑条遥控器、智能门锁、消费类电子产品等电子应用领域。 …