Openlayers6之地图覆盖物Overlay详解及使用,地图标注及弹窗查看详情(结合React)

news2024/9/28 17:32:18

demo案例:用户实现地图加载人员位置定位,并设置人员图片文字等标注,点击定位点查看人员详情。
在这里插入图片描述
主要通过ol/geom Point设置Styleol/Overlay实现。主要实现步骤:

  1. 实现图文标注的实质是添加点时设置Ponit的样式,图片标注就是在Style中添加Image,文字标注就是在Style中添加Text;
  2. 实现详情弹窗实质就是是通过创建Overlay,并将其添加到地图上。在用户点击到对应的点位后,设置Overlay指定的DOM元素的内容,设置position显示Overlay

overlay简述

什么是地图覆盖物Overlay?地图覆盖物主要是放置一些和地图位置相关的元素,常见的地图覆盖物有三种类型,如:popup 弹窗、label标注信息、text文本信息等,而这些覆盖物都是和html中的element等价的,通过Overlay的属性element和html元素绑定的同时设定坐标参数来达到将html元素放到地图上的位置,在平移缩放的时候html元素也会随着地图的移动而移动。Overlay的优势是可以自定义各种css样式,所以也有人使用Overlay来渲染定位

overlay API说明

Overlay初始化时可以接受很多配置参数,常用的属性有:

  • id:为对应的Overlay设置一个id,便于使用ol.MapgetOverlayById方法获取相应的overlay。
  • element:Overlay包含的DOM element,及指定Overlay使用的DOM元素。
  • offset:偏移量,像素为单位,Overlay相对于放置位置position的偏移量,默认值是 [0, 0],正值分别向右和向下偏移。
  • position:在地图所在的坐标系框架下,Overlay放置的位置。
  • positioning:根据position的位置来进行相对定位,可能的值包括bottom-leftbottom-centerbottom-rightcenter-leftcenter-centercenter-righttop-lefttop-centertop-right,默认是top-left,也就是element左上角与position重合。
  • stopEvent:地图的事件传播是否停止,默认是 true,即阻止传播,可能不太好理解,举个例子,当鼠标滚轮在地图上滚动时,会触发地图缩放事件,如果在Overlay之上滚动滚轮,并不会触发缩放事件,如果想鼠标在Overlay 之上也支持缩放,那么将该属性设置为false即可。
  • insertFirst:是否应该先添加到其所在的容器,当stopEvent设置为true时,Overlay和Openlayers的控件(controls)是放于一个容器的,此时将insertFirst设置为 true ,Overlay会首先添加到容器,这样,Overlay默认在控件的下一层(CSS z-index),所以,当stopEvent和insertFirst都采用默认值时,Overlay默认在控件的下一层。
  • autoPan:当触发Overlay setPosition方法时触发,当Overlay超出地图边界时,地图自动移动,以保证 Overlay全部可见。
  • autoPanAnimation:设置autoPan的效果动画。
  • autoPanMargin:地图自动平移时,地图边缘与Overlay的留白(空隙),单位是像素,默认是 20像素。

overlay特有方法,主要有:

  • getElement:取得包含overlay的DOM元素。隐藏Overlay时可使用Overlay.getElement.style.display = 'null'.
  • getId:取得overlay的id。
  • getMap:获取与overlay关联的map对象。
  • getOffset:获取offset属性。
  • getPosition:获取position属性.
  • getPositioning:获取positioning属性。
  • setElement:设置overlay的element。
  • setMap:设置与overlay的map对象。彻底删除Overlay使用Overlay.setMap(null)。需要注意的是删除Overlay时,Overlay创建时指定的DOM元素也一并被删除。
  • setOffset:设置offset。
  • setPosition:设置position属性。但只是将指定的DOM元素放在地图指定的位置上,DOM元素的样式和内容需要我们自己实现。
  • setPositioning:设置positioning属性。

Point图文标注实现

1. 添加点要素。

let personData = [
    {
        id: 1,
        name: '张三',
        position: [104.0641, 30.5973],
        color: 1,
        sex: 1
    }
];
// 根据positions创建一个新的数据源和要素数组,
let source = new VectorSource();
let feature = new Feature({
    geometry: new Point([104.0641, 30.5973])
});
source.addFeature(feature);
// 创建带有数据源的矢量图层
let layer = new VectorLayer({
    source: source,
    name:'pointLayer'
});
// 将矢量图层添加到Map上
map.addLayer(layer);

2. 设置feature样式。主要采用IconText

new Style({
    image: new Icon({
        scale: 0.5,
        src: '图片地址',
        anchor: [0.5, 1]
    }),
    text: new Text({
        text: '需要展示的文字', // 只能传入字符串
        fill: new Fill({
            color: '#FFFFFF'
        }),
        backgroundFill: new Fill({
            color: '#555555'
        }),
        padding: [2, 2, 0, 4],
        offsetY: -48,
        scale: 1.4
    })
});

图文标注完整代码

// 引入模块
import { Feature } from 'ol'; // 地图Collection
import { Vector as VectorLayer } from 'ol/layer';
import { Vector as VectorSource } from 'ol/source';
import { Point } from 'ol/geom';
import { Style, Icon, Fill, Text } from 'ol/style';

// 模拟数据
let personData = [
    {
        id: 1,
        name: '张三',
        position: [104.0641, 30.5973],
        color: 1,
        sex: 1
    }
];

// 设置feature样式
function setFeatureStyle(feature) {
    feature.setStyle(
        new Style({
            image: new Icon({
                scale: 0.5,
                src: '图片路径',
                anchor: [0.5, 1]
            }),
             new Text({
                text: '展示文字', // 只能传入字符串
                fill: new Fill({
                    color: '#FFFFFF'
                }),
                backgroundFill: new Fill({
                    color: '#555555'
                }),
                padding: [2, 2, 0, 4],
                offsetY: -48,
                scale: 1.4
            })
        });
    );
}
useEffect(() => {
    if (map) {
        // 如果layer已经存在,就先删除,再绘制
        if (layer) {
            layer.getSource().clear();
            map.removeLayer(layer);
            layer = null;
        }
        // 根据position创建一个新的数据源和要素数组
        let source = new VectorSource();
        for (let i = 0; i < personData.length; i++) {
            const item = personData[i];
            let feature = new Feature({
                // ol.proj.fromLonLat用于将经纬度坐标从 WGS84 坐标系转换为地图投影坐标系
                geometry: new Point(Proj.fromLonLat(item.position)),
                type: 'point'
            });
            // 设置feature样式
            setFeatureStyle(feature);
            source.addFeature(feature);
        }
        // 创建带有数据源的矢量图层
        let layer = new VectorLayer({
            source: source,
            name: 'pointLayer'
        });
        // 将矢量图层添加到Map上
        map.addLayer(layer);
    }
}, [map]);   

Overlay详情弹窗实现

上面已经讲述过详情弹窗的实质,创建的具体步骤:

1. 创建一个DOM元素,通常为div及包含的子元素。

<div className='overlayBox' id='overlayBox'>
    {/* 关闭按钮 */}
    <CloseOutlined className="close" onClick={closeOverlay} />
</div>

2. 创建一个Overlay实例并将DOM元素挂载。

// 创建一个弹窗 Overlay对象
let overlayDom = document.getElementById('overlayBox');
overlay = new Overlay({
    element: overlayDom,
    autoPan: true, 
    positioning: 'center-center', 
    offset: [0, -120],
    stopEvent: true 
});
// 将弹窗添加到Map中
map.addOverlay(overlay);

3. 监听地图点击事件。

map.on('click', (evt) => {
    // 根据点位像素位置,获取此位置的要素feature
    const feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
        return feature;
    });
    if (feature) {}
});

4. 点击地图中的要素时读取信息并向地图Map中添加Overlay。

// 设置弹出框的位置为点击的位置 
overlay.setPosition(coordinates);

弹出窗完整代码

// 引入模块
import Overlay from 'ol/Overlay'; // 弹框

let overlay;

// 关闭弹窗
function closeOverlay() {
    overlay.setPosition(undefined);
}
useEffect(() => {
    if (map) {
        // 创建一个弹窗 Overlay对象
        let overlayDom = document.getElementById('overlayBox');
        overlay = new Overlay({
            element: overlayDom,
            autoPan: true,
            positioning: 'center-center',
            offset: [0, -120], 
            stopEvent: true
        });
        // 将弹窗添加到Map中
        map.addOverlay(overlay);

        // 监听鼠标点击
        map.on('click', (evt) => {
            // 根据点位像素位置,获取此位置的要素feature
            const feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
                return feature;
            });
            if (feature) {
                // 获取要素的坐标
                const coordinates = feature.getGeometry().getCoordinates();
                if (overlay) {
                    // 设置弹出框的位置为点击的位置 
                    overlay.setPosition(coordinates);
                }
            } else {
                // 如果没有点击到要素,隐藏弹出框
                overlay.setPosition(undefined);
            }
        });
    }
}, [map]);

return <div className='map_container'>
    <div id='map' style={{ width: '100%', height: '100%' }}></div>
    <div className='overlayBox' id='overlayBox'>
        <CloseOutlined className="close" onClick={closeOverlay} />
    </div>
</div>;

demo实例完整代码

地图点击事件我采用了Openlayersol/interaction/Select选中实现,也可是使用监听map click实现。

import React, { useState, useEffect } from 'react';
import { CloseOutlined } from '@ant-design/icons';
import { Map, View, Feature } from 'ol'; // 地图Collection
import * as Proj from 'ol/proj'; // 转化
import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer'; // 图层
import { XYZ, Vector as VectorSource } from 'ol/source'; // 资源
import { Point } from 'ol/geom';
import { Style, Icon, Fill, Text } from 'ol/style'; // 样式
import Overlay from 'ol/Overlay'; // 弹框
import { Select } from 'ol/interaction';
import { click } from 'ol/events/condition';
import redImg from '@/static/image/red.png';
import blueImg from '@/static/image/blue.png';
import whiteImg from '@/static/image/white.png';
import orangeImg from '@/static/image/orange.png';
import grayImg from '@/static/image/gray.png';

let source;
let layer;
let overlay;

const OpenlayerOverlay = () => {
    const [map, setMap] = useState(null); // 地图
    const [view, setView] = useState(null); // 地图视图
    const [curInfo, setCurInfo] = useState(null); // 当前查看信息

    let personData = [
        {
            id: 1,
            name: '张三',
            position: [104.0641, 30.5973],
            color: 1,
            sex: 1
        },
        {
            id: 2,
            name: '李四',
            position: [104.0622, 30.5954],
            color: 2,
            sex: 2
        },
        {
            id: 3,
            name: '王五',
            position: [104.0722, 30.5960],
            color: 3,
            sex: 1
        },
        {
            id: 4,
            name: '张麻子',
            position: [104.0634, 30.5958],
            color: 4,
            sex: 1
        },
    ];

    // 设置feature样式
    function setFeatureStyle(feature, data) {
        if (data.color === 1) {
            feature.setStyle(
                new Style({
                    image: new Icon({
                        scale: 0.5,
                        src: redImg,
                        anchor: [0.5, 1]
                    })
                })
            );
        } else if (data.color === 2) {
            feature.setStyle(
                new Style({
                    image: new Icon({
                        scale: 0.5,
                        src: blueImg,
                        anchor: [0.5, 1]
                    })
                })
            );
        } else if (data.color === 3) {
            feature.setStyle(
                new Style({
                    image: new Icon({
                        scale: 0.5,
                        src: whiteImg,
                        anchor: [0.5, 1]
                    })
                })
            );
        } else if (data.color === 4) {
            feature.setStyle(
                new Style({
                    image: new Icon({
                        scale: 0.5,
                        src: orangeImg,
                        anchor: [0.5, 1]
                    })
                })
            );
        } else {
            feature.setStyle(
                new Style({
                    image: new Icon({
                        scale: 0.5,
                        src: grayImg,
                        anchor: [0.5, 1]
                    })
                })
            );
        }
        feature.getStyle().setText(
            new Text({
                text: data.name, // 只能传入字符串
                fill: new Fill({
                    color: '#FFFFFF'
                }),
                backgroundFill: new Fill({
                    color: '#555555'
                }),
                padding: [2, 2, 0, 4],
                offsetY: -48,
                scale: 1.4
            })
        );
    }
    // 关闭弹窗
    function closeOverlay() {
        overlay.setPosition(undefined);
    }
    useEffect(() => {
        if (map) {
            // 创建一个弹窗 Overlay对象
            let overlayDom = document.getElementById('overlayBox');
            overlay = new Overlay({
                element: overlayDom,
                autoPan: true, // 弹出窗口在边缘点击时候显示不完整,设置自动平移效果
                positioning: 'center-center', // 根据position属性的位置来进行相对定位, 默认为top-left
                offset: [0, -120], // 偏移量,像素为单位,Overlay 相对于放置位置(position)的偏移量,默认值是 [0, 0],正值分别向右和向下偏移;
                stopEvent: true // 地图的事件传播是否停止,默认是 true,即阻止传播,可能不太好理解,举个例子,当鼠标滚轮在地图上滚动时,会触发地图缩放事件,如果在 overlay 之上滚动滚轮,并不会触发缩放事件,如果想鼠标在 overlay 之上也支持缩放,那么将该属性设置为 false 即可;
            });
            // 将弹窗添加到Map中
            map.addOverlay(overlay);

            // 添加交互行为
            let selectClick = new Select({
                condition: click, // 事件类型
                style: false, // 被选中后的样式  如果不写style,将为默认样式(不是自己设置的样式,而是opelayers自带的样式),设置为false或者null将保持自己设置的样式
                // 指定图层
                filter: (feature, layer) => {
                    console.log(layer);
                    return layer;
                }
            });
            map.addInteraction(selectClick);
            // 获取当前点击元素信息,并设置弹窗显示位置
            selectClick.on("select", (e) => {
                if (e.selected.length > 0) {
                    // 获取当前点击要素信息
                    let clickPointInfo = e.selected[0].getProperties();
                    // 设置当前数据
                    setCurInfo(clickPointInfo);
                    // 设置弹出窗的位置为当前数据定位位置
                    overlay.setPosition(Proj.fromLonLat(clickPointInfo.position));
                } else {
                    setCurInfo(null);
                    overlay.setPosition(undefined);
                }
            })
        }
    }, [map]);

    useEffect(() => {
        if (map) {
            // 如果layer已经存在,就先删除,再绘制
            if (layer) {
                layer.getSource().clear();
                map.removeLayer(layer);
                layer = null;
            }
            // 根据position创建一个新的数据源和要素数组
            source = new VectorSource();
            for (let i = 0; i < personData.length; i++) {
                const item = personData[i];
                let feature = new Feature({
                    // ol.proj.fromLonLat用于将经纬度坐标从 WGS84 坐标系转换为地图投影坐标系
                    geometry: new Point(Proj.fromLonLat(item.position)),
                    id: item.id,
                    color: item.color,
                    sex: item.sex,
                    position: item.position,
                    name: item.name,
                    type: 'point'
                });
                // 设置feature样式
                setFeatureStyle(feature, item);
                source.addFeature(feature);
            }
            // 创建带有数据源的矢量图层
            layer = new VectorLayer({
                source: source,
                name: 'pointLayer'
            });
            // 将矢量图层添加到Map上
            map.addLayer(layer);
        }
    }, [map, personData]);

    // 地图鼠标样式调整
    useEffect(() => {
        if (map) {
            // 给地图绑定鼠标移动事件,检测鼠标位置所在是否存在feature来改变鼠标输入样式
            map.on('pointermove', (e) => {
                // 获取像素位置
                let pixel = map.getEventPixel(e.originalEvent);
                // 根据点位像素位置,获取此位置的要素feature
                let feature = map.forEachFeatureAtPixel(pixel, (featureOther) => {
                    return featureOther;
                });
                // 要素存在,并且是需要改变鼠标样式为pointer的feature,鼠标样式变为pointer,否则auto
                if (feature === undefined) {
                    map.getTargetElement().style.cursor = "auto";
                } else {
                    map.getTargetElement().style.cursor = "pointer";
                }
            });
        }
    }, [map]);

    useEffect(() => {
        // 监听地图视图,创建地图
        if (view) {
            // 使用高德图层
            const tileLayer = new TileLayer({
                source: new XYZ({
                    url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&scl=1&size=1&style=7&x={x}&y={y}&z={z}'
                }),
                name: 'mapLayer'
            });
            // 创建实例
            const _map = new Map({
                target: 'map',
                layers: [tileLayer], // 使用高德图层
                view: view
            });
            setMap(_map);
        }
    }, [view]);

    useEffect(() => {
        // View用于创建2D视图
        const viewObj = new View({
            // 设定中心点,因为默认坐标系为 3587,所以要将我们常用的经纬度坐标系4326 转换为 3587坐标系
            center: Proj.transform([104.06403453968424, 30.597419070782898], 'EPSG:4326', 'EPSG:3857'),
            zoom: 16
        });
        setView(viewObj);
    }, []);
    useEffect(() => {
        return () => {
            layer = null;
            source = null;
            // 删除Overlay
            // overlay.setMap(null);
            overlay = null;
            setMap(null);
            setView(null);
            setCurInfo(null);
        }
    }, []);

    return <div className='map_container'>
        <div id='map' style={{ width: '100%', height: '100%' }}></div>
        <div className='overlayBox' id='overlayBox'>
            {/* 关闭按钮 */}
            <CloseOutlined className="close" onClick={closeOverlay} />
            <div>姓名:{curInfo && curInfo.name}</div>
            <div>性别:{curInfo && curInfo.sex === 1 ? '男' : '女'}</div>
            <div>位置:{curInfo && curInfo.position[0]}, {curInfo && curInfo.position[1]}</div>
        </div>
    </div>;
}
export default OpenlayerOverlay;

采用监听Map鼠标点击事件实现demo,

// 监听鼠标点击
map.on('click', (evt) => {
    // 根据点位像素位置,获取此位置的要素feature
    const feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
        return feature;
    });
    if (feature) {
        // 获取要素的坐标
        const coordinates = feature.getGeometry().getCoordinates();
        // 获取当前点击要素的信息
        let clickPointInfo = feature.getProperties();
        // 设置当前点击点位数据
        setCurInfo(clickPointInfo);
        if (overlay) {
            // 设置弹出框的位置为点击的位置 
            overlay.setPosition(coordinates);
        }
    } else {
        // 如果没有点击到要素,隐藏弹出框
        overlay.setPosition(undefined);
        setCurInfo(null);
    }
});

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

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

相关文章

浅谈安科瑞智慧用电系统在电气火灾中的应用

摘要&#xff1a;为了对电气火灾事故进行预测和预警&#xff0c;同时为了对电气火灾事故的应急救援提供 支持&#xff0c;将智慧用电监控系统应用于电气火灾中。该系统利用物联网、移动互联网、云平台、大数据技术&#xff0c;实现对电气线路电流、漏电、温度、谐波等参数进行…

leetcode日记(66)子集

实际上和上一题差不多&#xff0c;可以直接套用上一题回溯递归的函数写出来&#xff0c;复杂度比较高&#xff0c;因为是按照数字个数依次代入函数&#xff0c;然后通通放入一个vector中。 class Solution { public:vector<vector<int>> subsets(vector<int>…

Linux 实验基础环境准备(外网篇)

1.关闭禁用防火墙和selinux systemctl disable firewalld --now sed -i s/SELINUXenforcing/SELINUXdisabled/ /etc/selinux/config2.保证可以连接外网 ping -c3 www.baidu.com 3.配置yum为阿里仓库并下载epel源 mkdir /etc/yum.repos.d/bak/; mv /etc/yum.repos.d/*.repo /e…

【AI-16】浅显易懂说一下RNN和Transformer

循环神经网络&#xff08;RNN&#xff09;曾经是自然语言处理领域的主流&#xff0c;但它们面临着长距离依赖和梯度消失等问题&#xff0c;限制了其在处理长文本序列时的表现。随后&#xff0c;Transformer模型的出现改变了这一局面。 循环神经网络&#xff08;RNN&#xff09…

实施MES管理系统的过程中可能会遇到的风险

在制造业的数字化转型浪潮中&#xff0c;MES管理系统的部署成为了企业提升生产效率、优化资源配置的关键一环。然而&#xff0c;这一过程的复杂性和潜在风险不容忽视。本文将从多个维度探讨实施MES管理系统的过程中可能面临的挑战&#xff0c;并提出一系列策略以应对这些挑战&a…

工作随记:我在OL8.8部署oracle rac遇到的问题

文章目录 一、安装篇问题1&#xff1a;[INS-08101] Unexpected error while executing the action at state:supportedosCheck问题1解决办法&#xff1a;问题2&#xff1a;[INS-06003] Failed to setup passwordless SSH connectivity with thefollowing nodeis): [xxxx1, xxxx…

天玑9400新猛料:CPU性能提升30%,同场景仅需8G3 30%功耗

年底的手机市场的新消息简直让人应接不暇&#xff0c;而其中最令人期待的&#xff0c;无疑是天玑9400旗舰芯。这款芯片据说性能提升了30%&#xff0c;在相同场景下功耗却降低到了8G3的30%。网友们纷纷表示&#xff1a;“发哥这次真的稳住了&#xff0c;天玑系列越来越给力&…

Python中的类多态之方法重写和动态绑定使用详解

概要 多态(Polymorphism)是面向对象编程的核心特性之一,它允许同一接口在不同的类中具有不同的实现。多态通过方法重写和动态绑定来实现,使得代码更加灵活和可扩展。本文将详细介绍Python中的类多态,包括方法重写和动态绑定,涵盖基本概念、具体用法和实际应用示例。 多态…

Linux磁盘管理与文件结构(一):磁盘、MBR与分区和文件系统

文章目录 1、磁盘结构物理结构数据结构硬盘存储容量数据区域定位磁盘接口类型 2、MBR与磁盘分区表示主引导记录&#xff08;MBR&#xff09;磁盘分区结构示例 磁盘分区表示 3、文件系统类型XFS 文件系统Swap 交换文件系统Linux 支持的其他文件系统类型 1、磁盘结构 物理结构 …

vue前端自适应布局,一步到位所有自适应

页面展示 实现内容 1&#xff0c;左右布局 左侧固定宽带&#xff0c;右侧自适应剩余的宽度。中间一条分割线&#xff0c;可以拖拉&#xff0c;自适应调整左右侧的宽度。左侧的高度超长自动出现横向滚动条&#xff0c;左侧宽度超长&#xff0c;自动出现竖向滚动条。 2&#x…

栈的实现及括号匹配问题

一、栈的概念及结构 栈是一种特殊的线性表&#xff0c;只允许在固定的一端进行插入删除元素操作。 进行数据插入和删除操作的一端称为栈顶&#xff0c;另一端称为栈底。 栈中的数据元素遵循后进先出LIFO&#xff08;Last In First Out&#xff09;的原则。 压栈&#xff1a…

Linux/C 高级——shell脚本

1. shell脚本基础概念 1.1概念 shell使用方式&#xff1a;手动下命令和脚本 脚本本质是一个文件&#xff0c;文件里面存放的是特定格式的指令&#xff0c;系统可以使用脚本解析器翻译或解析指令并执行&#xff08;它不需要编译&#xff09;。 shell脚本本质&#xff1a;shell命…

浅谈 Spring AOP框架 (2)——Spring统一功能处理

文章目录 一、AOP实战——SpringBoot统一功能处理1.1、使用拦截器实现用户登录权限的统一验证1.1.1、使用原生Spring AOP实现统一拦截的难点1.1.2、Spring 拦截器1.1.2.1、Spring拦截器 使用步骤1.1.2.2、拦截器实现原理 1.2、统一数据格式返回1.2.1、为什么要返回统一的数据格…

Linux/C 高级——条件编译

1.根据宏是否定义 #define 宏名 #ifdef 宏名 /*code1*/ #else /*code2*/ #endif 执行顺序&#xff1a;宏名如果定义则编译code1&#xff0c;否则编译code2 例子&#xff1a; 2.根据宏值 #define 宏名 值 #if 宏名 /*code1*/ #else /*code2*/ #endif 执行顺序&#xff1a;宏的值…

真值表编程

打开真值表进行编辑 在图表中创建并标记真值表后&#xff0c;您可以指定其逻辑行为。要打开真值表&#xff0c;请双击真值表函数。 默认情况下&#xff0c;真值表包含一个条件表和一个动作表&#xff0c;每个表都有一行。条件表包含一个决策列D1和一个动作行。 选择动作语言 …

达梦数据库 数据类型

达梦数据类型 1.背景2.要求3.描述与使用3.1 常规数据类型3.1.1 字符数据类型3.1.1.1 CHAR类型3.1.1.2 CHARACTER类型3.1.1.3 VARCHAR类型 3.1.2 数值数据类型3.1.2.1 NUMERIC类型3.1.2.2 DECIMAL类型3.1.2.3 DEC类型3.1.2.4 NUMBER类型3.1.2.5 INTEGER类型3.1.2.6 INT类型3.1.2…

VC++_opencv插件ImageWatch的安装和使用

1、插件安装 以VS2015为例&#xff1a; 进入扩展和更新界面&#xff0c;点“联机”&#xff0c;然后输入“ImageWatch”进行搜索&#xff1a; 2、安装完毕后重启VisualStudio 如下图在菜单“视图\其他窗口”找到“ImageWatch”这个栏目 然后点开&#xff1a; 也可让其停靠在Vi…

c++----初识模板

大家好&#xff0c;这篇博客想与大家分享一些我们c中比较好用的知识点。模板。首先咧&#xff0c;我们都知道模板嘛&#xff0c;就是以前人的经验总结出来的知识。方便我们使用。这里的模板也是一样的。当我们学习过后&#xff0c;对于一些在c中的自定义函数&#xff0c;我们在…

QList 的访问方式list.at(index) 和 list[index] 对比

QList 是 Qt 框架中提供的一个模板容器类&#xff0c;用于存储和操作一系列元素。它提供了两种不同的方式来访问容器中的元素&#xff1a;.at()成员函数和下标运算符 []。以下是这两种方式的区别&#xff1a; 1. QList::at() 方法 at()是一个成员函数&#xff0c;它允许通过索…

04--Docker

前言&#xff1a;前面写过关于DockerKubernetes的部署&#xff0c;主要是针对国产化linux系统的适配问题&#xff0c;并没有对docker进行复习。这里整理一下docker的知识点&#xff0c;用作容器化微服务的起点&#xff0c;主要为日常工作配置使用&#xff0c;本章可能有点长&am…