基于openlayers 开发vue地图组件

先看效果
在这里插入图片描述
在这里插入图片描述

主要功能如下:

  • 测量
  • 图源更换
  • 放大缩小
  • 地图添加点
  • hover点数据
  • 切换到地图位置;也设定层级
  • 2D3D切换,3D为cesium开发,
  • 技术交流可以加V:bloxed
    地图工具做了插槽,分为toolbar(左上角工具) 和mode(右下角功能区),对应mapTools.vue和mapMode.vue 文件
    上代码:
    commonmap.vue文件
<!--* @Author: shangyc* @Date: 2024-011-07 09:54:54* @LastEditors: shangyc* @LastEditTime: 2024-011-07 09:54:54* @Description: file content
-->
<template><div class="map-container h100 w100"><div class="mouseInfo" v-show="mouseInfo.scale"><span  class="btn-item">坐标:{{ mouseInfo.coords }}</span><span class="btn-item">比例尺:{{ mouseInfo.scale }}</span><span class="btn-item">视野:{{ mouseInfo.zoom }}</span></div><div id="map" class="map h100"></div><slot name="toolbar" ></slot><slot name="mode"></slot><!-- tooltip --><div ref="tooltip" class="tooltip" v-if="tooltipVisible"><el-row v-if="tooltipContents.length"><el-col v-for="item in tooltipContents" :key="item.value" @click="tooltipClick" class="content-col"><span>{{ item.name }}</span><span>{{ item.value }}</span><span>&nbsp;{{ item.unit ?? "" }}</span></el-col></el-row><el-row v-else><el-col class="content-col">暂无数据</el-col></el-row></div><!--end  --></div>
</template><script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import Map from "ol/Map";
import TileLayer from "ol/layer/Tile";
import View from "ol/View";
import { defaults as defaultControls } from "ol/control";import { Overlay } from "ol";
import { fromLonLat, get as getProjection, toLonLat } from "ol/proj";
import { Cluster, Vector as SourceVector, XYZ } from "ol/source";
import { Vector as LayerVector } from "ol/layer";
import GeoJSON from "ol/format/GeoJSON";
import { Fill, Icon, Stroke, Style, Text } from "ol/style";
import CircleStyle from "ol/style/Circle";
import { Polygon } from "ol/geom";
import LineString from "ol/geom/LineString";
import { getArea, getLength } from "ol/sphere";
import GeometryType from "ol/geom/GeometryType";
import { Draw } from "ol/interaction";
import { unByKey } from "ol/Observable";
import OverlayPositioning from "ol/OverlayPositioning";
import areaLabel from "/@/assets/map/areaLabel.png";import Mask from "ol-ext/filter/Mask";
import Crop from "ol-ext/filter/Crop";
import { getVectorContext } from "ol/render";const { VITE_APP_2DMAP_URL } = import.meta.env;
const tooltipVisible = ref<boolean>(false);
const props = defineProps({imageSource: {type: String,default: "img",},toolBox: {type: Boolean,default: true,},
});
const imgSource = ref<string>("yx");
const emit = defineEmits(["mapSingleClick"]); // 自定义事件 会回传也是point数据
const center:any = [];
// start地图以及图层显示
const map = ref<any>(null);
//鼠标信息
const mouseInfo = reactive<any>({coords: "",scale: "",zoom: "",
});
let vector: any;
const drawObj = ref<any>(null);
const helpTooltipElement = ref<any>(null);
const helpTooltip = ref<any>(null);
const measureTooltipElement = ref<any>(null);
const measureTooltip = ref<any>(null);
let timer = null;
let flashTimer = null;
const clickPoint = ref<any>();const tooltip = ref(null);
const tooltipContents = ref<any[]>([]);
//底图图源
const env = import.meta.env.VITE_APP_ENV;
const imgpublicUrl =  `${VITE_APP_2DMAP_URL}/yx/{z}/{x}/{-y}.png`;
const cvapublicUrl =  `${VITE_APP_2DMAP_URL}/dz/{z}/{x}/{-y}.png`;
const imgLayer = ref<any>(new TileLayer({source: new XYZ({// wrapX: true,url: imgpublicUrl}),visible: true})
);
const vecLayer = ref<any>(new TileLayer({source: new XYZ({url: cvapublicUrl,projection: getProjection("EPSG:3857"),// wrapX: true}),visible: true})
);// 用于存储事件监听器键的数组
const eventKeys = ref<any[]>([]);let start = new Date().getTime();
const disableMapEvent = ref<boolean>(false); // 关闭地图上面事件//地图操作事件
const zoomInOut = (number: any) => {if (map.value) {const view = map.value.getView();const zoom = view.getZoom();view.setZoom(zoom + number);}
};
const toCenter = (coordinates?: any[]) => {if (map.value) {map.value.getView().animate({center: fromLonLat(coordinates ?? center),duration: 2500, // 动画持续时间,单位为毫秒(这里设置为2秒)});}
};
const points: any = {type: "FeatureCollection",features: [],
};
//查询到站点添加到地图
const addStation = (stations: any[]) => {mapInteractionSource.value.clear();map.value?.getOverlays().clear();points.features = [];stations.forEach((point, index) => {point.lng &&point.lat &&points.features.push({type: "Feature",geometry: {type: "Point",coordinates: fromLonLat([point.lng, point.lat]),},properties: {id: index + point.stcd,name: point.stnm,type: point.sttp,info: point,icon: point.icon,},id: index + point.stcd,});});new GeoJSON({ featureProjection: "EPSG:4326" }).readFeatures({type: "FeatureCollection",features: [...points.features],}).forEach((item: any) => {mapInteractionSource.value.addFeature(item);});
};
const mapInteractionSource = ref<any>(new SourceVector({ wrapX: false }));
const imagSourceClick = (type: any) => {imgSource.value = type;if (type == "yx") {imgLayer.value.setVisible(true);vecLayer.value.setVisible(false);} else {imgLayer.value.setVisible(false);vecLayer.value.setVisible(true);}
};
const initMap = () => {if (map.value) {map.value.setTarget(null);}// 聚合var cluster = new Cluster({source: mapInteractionSource.value,distance: 30,});const cluster1Style = (feature: any, resolution: any) => {const { name, icon } = feature.get("features")[0].getProperties();return new Style({//把点的样式换成ICON图标fill: new Fill({//填充颜色color: "rgba(37,241,239,0.2)",}),//图形样式,主要适用于点样式image: new Icon({opacity: 1,scale: 0.5,src: icon ?? areaLabel,}),text: new Text({// 字体与大小font: "bold 13px Microsoft YaHei",//文字填充色fill: new Fill({color: "#fff",}),// 显示文本,数字需要转换为文本string类型!text: name,offsetY: -35,}),});};map.value = new Map({layers: [vecLayer.value,imgLayer.value,new LayerVector({source: cluster,style: cluster1Style,}),],keyboardEventTarget: document,target: "map", // 对应页面里 id 为 map 的元素view: new View({center: fromLonLat([110.105931,22.422299]),zoom: 15,}),//控件初始默认不显示controls: defaultControls({attribution: false,zoom: false,rotate: false,}).extend([]),});const tdtStyle = new Style({fill: new Fill({color: "black",}),});imgLayer.value.on("postrender", (e: any) => {const vectorContext = getVectorContext(e);e.context.globalCompositeOperation = "destination-in";e.context.globalCompositeOperation = "source-over";});map.value.on("pointermove", handleMouseMove);map.value.on("pointermove", (evt: any) => {const pixel = map?.value?.getEventPixel(evt.originalEvent);const hit = map?.value?.hasFeatureAtPixel(pixel);map.value.forEachFeatureAtPixel(evt.pixel, function (feature: any) {let geometry: any = null;try {geometry = JSON.parse(new GeoJSON().writeFeature(feature));} catch (error) {geometry = feature;}if (geometry.geometry.type == "Point") {const coordinate = geometry.geometry.coordinates;const data =geometry.properties?.features[0]?.values_?.info?.data || [];if (data.length) {clickPoint.value = geometry.properties?.features[0]?.values_?.info;tooltipContents.value = data;tooltipVisible.value = true;try {map.value.addOverlay(new Overlay({position: coordinate,offset: [0, 0],element: tooltip.value,stopEvent: true,}));} catch (error) {console.warn(error);}}}});});map.value.on("singleclick", (evt: any) => {var pixel = map?.value?.getEventPixel(evt.originalEvent);var hit = map?.value?.hasFeatureAtPixel(pixel);map.value.forEachFeatureAtPixel(evt.pixel, function (feature: any) {let geometry: any = null;try {geometry = JSON.parse(new GeoJSON().writeFeature(feature));} catch (error) {geometry = feature;}if (geometry.geometry.type == "Point") {const coordinate = geometry.geometry.coordinates;mapSingleClick(geometry.properties?.features[0]?.values_?.info);const data =geometry.properties?.features[0]?.values_?.info?.data || [];if (data.length) {clickPoint.value = geometry.properties?.features[0]?.values_?.info;tooltipClick();}}});});
};
const mapSingleClick = (point: any) => {emit("mapSingleClick", point);
};
const handleMouseMove = (event: any) => {const coordinate = event.coordinate;const lonLat = toLonLat(map.value?.getCoordinateFromPixel(event.pixel));const scale = map.value?.getView().getResolution(); // 近似计算比例尺(米)const zoom = map.value?.getView().getZoom();mouseInfo.coords = ` ${lonLat[0].toFixed(5)},  ${lonLat[1].toFixed(5)}`;mouseInfo.scale = `1:${ Math.round(scale * 10000) / 100} m`;mouseInfo.zoom = `${zoom.toFixed(0)}`;
};
/*** 绘画* @param measureType line*/
const draw = (measureType: any) => {// 移除所有事件监听器// eventKeys.value.forEach(key => unByKey(key));// eventKeys.value = []; // 清空数组,以便后续可能重新添加事件if (disableMapEvent.value) {return ElMessage.warning("请先结束之前的绘制");}drawObj.value && map.value.removeInteraction(drawObj.value);const source = new SourceVector();// if (!vector) {vector = new LayerVector({name: "drawLayer",zIndex: 10000,source: source,style: new Style({fill: new Fill({color: "rgba(255, 255, 255, 0.2)",}),stroke: new Stroke({color: "#ffcc33",width: 2,}),image: new CircleStyle({radius: 7,fill: new Fill({color: "#ffcc33",}),}),}),});map.value.addLayer(vector);// }/*** Currently drawn feature.* @type {module:ol/Feature~Feature}*/let sketch: any = null;/*** Message to show when the user is drawing a polygon.* @type {string}*/const continuePolygonMsg = "继续点击绘制多边形";/*** Message to show when the user is drawing a line.* @type {string}*/const continueLineMsg = "继续点击绘制线";/*** Handle pointer move.* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt The event.*/const pointerMoveHandler = (evt: any) => {if (evt.dragging) {return;}/** @type {string} */let helpMsg = "请点击开始绘制";if (sketch) {const geom = sketch.getGeometry();if (geom instanceof Polygon) {helpMsg = continuePolygonMsg;} else if (geom instanceof LineString) {helpMsg = continueLineMsg;}}helpTooltipElement.value.innerHTML = `<div style="color:#fff;background-color: rgba(0,0,0,0.6);padding: 4px;border-radius: 6px">${helpMsg}</div>`;helpTooltip.value.setPosition(evt.coordinate);helpTooltipElement.value?.lassList?.remove("hidden");};map.value.on("pointermove", pointerMoveHandler);map.value.getViewport().addEventListener("mouseout", function () {helpTooltipElement.value?.classList?.add("hidden");});const formatLength = (line: any) => {const sourceProj = map.value.getView().getProjection();// @ts-ignoreconst length = getLength(line, { projection: sourceProj });let output;if (length > 100) {output = Math.round((length / 1000) * 100) / 100 + " " + "km";} else {output = Math.round(length * 100) / 100 + " " + "m";}return output;};const formatArea = (polygon: any) => {const area = getArea(polygon, {projection: "EPSG:4326",});let output;if (area > 10000) {output =Math.round((area / 1000000) * 100) / 100 + " " + "km<sup>2</sup>";} else {output = Math.round(area * 100) / 100 + " " + "m<sup>2</sup>";}return output;};const addInteraction = () => {const type =measureType == "area" ? GeometryType.POLYGON : GeometryType.LINE_STRING;drawObj.value = new Draw({source: source,type: type,// condition: mouseOnly,// freehandCondition: noModifierKeys,style: new Style({fill: new Fill({color: "rgba(255, 255, 255, 0.2)",}),stroke: new Stroke({color: "red",lineDash: [10, 10],width: 2,}),image: new CircleStyle({radius: 5,stroke: new Stroke({color: "red",}),fill: new Fill({color: "rgba(255, 255, 255, 0.2)",}),}),}),});map.value.addInteraction(drawObj.value);createHelpTooltip();let listener: any;drawObj.value.on("drawstart", function (evt: any) {createMeasureTooltip();disableMapEvent.value = true;// set sketchsketch = evt.feature;/** @type {module:ol/coordinate~Coordinate|undefined} */let tooltipCoord: any;listener = sketch.getGeometry()?.on("change", function (evt: any) {const geom = evt.target;let output = "";if (geom instanceof Polygon) {output = formatArea(geom);tooltipCoord = geom.getInteriorPoint().getCoordinates();} else if (geom instanceof LineString) {output = formatLength(geom);tooltipCoord = geom.getLastCoordinate();}measureTooltipElement.value.innerHTML = output;measureTooltip.value.setPosition(tooltipCoord);});});drawObj.value.on("drawend", function () {disableMapEvent.value = false;measureTooltip.value.setOffset([0, -7]);// unset sketchsketch.dispose();// unset tooltip so that a new one can be createdmeasureTooltipElement.value = document.createElement("div");listener && unByKey(listener);});};const createHelpTooltip = () => {helpTooltipElement.value?.parentNode?.removeChild(helpTooltipElement.value);helpTooltipElement.value = document.createElement("div");helpTooltipElement.value.className = "tooltip hidden";helpTooltip.value = new Overlay({id: "helpTooltip",element: helpTooltipElement.value,offset: [15, 0],zIndex: 10000,positioning: OverlayPositioning.CENTER_LEFT,});map.value.addOverlay(helpTooltip.value);};const createMeasureTooltip = () => {// measureTooltipElement?.parentNode?.removeChild(measureTooltipElement);measureTooltipElement.value = document.createElement("div");measureTooltipElement.value.className = "ol-tooltip ol-tooltip-measure";// measureTooltipElement.setAttribute('class', comStyle['ol-tooltip-measure']);measureTooltip.value = new Overlay({oId: "measureTooltip",element: measureTooltipElement.value,offset: [0, -15],zIndex: 10000,positioning: OverlayPositioning.BOTTOM_CENTER,});map.value.addOverlay(measureTooltip.value);//@ts-ignorewindow["measureTooltip"] = measureTooltip.value;};addInteraction();
};
/*** 清除*/
const clear = () => {disableMapEvent.value = false;drawObj.value && map.value.removeInteraction(drawObj.value);vector && map.value.removeLayer(vector);const overlays = map.value.getOverlays().getArray();if (overlays) {overlays.filter((o: any) =>o &&(o.options?.oId === "measureTooltip" || o.getId() === "helpTooltip")).forEach(function (o: any) {map.value.removeOverlay(o);});}const layers = map.value.getLayers();if (layers) {layers.getArray().filter((o: any) => o?.get("name") === "drawLayer").forEach(function (o: any) {o.getSource().clear();map.value.removeLayer(o);});}drawObj.value = null;
};
const tooltipClick = () => {
};
onMounted(() => {initMap();
});
defineExpose({map, //地图/**@desc 添加站点 @param [{stcd:0000,stnm:"xxxx",sttp:'',icon:'xxxx',lng:number,lat:number}data:[{name:'xx',value:'',unit:''}]  //data地图鼠标悬浮展示内容}]*/addStation,  /*** 缩放 地图* @param {number} zoom 缩放级别*/zoomInOut, /*** 地图中心点* @param {number} center 地图中心点参数格式 [lng,lat]* @param {number} zoom 缩放级别 15*/ toCenter,  /*** 清除地图分析*/clear,/*** 地图分析* @param {string} type 分析类型  'area' 面积  'line' 距离*/draw,  /*** 图源切换事件* @param {string} type 图层类型*/imagSourceClick});
</script><style scoped lang="less">
.map-container {height: 100%;position: relative;background: url("/@/assets/map/mapbg.png");.btn {position: absolute;z-index: 10;top: 20px;left: 10px;.btn-item {background-color: #139eb1;margin: 0px 10px;color: #fff;border: none;height: 30px;border-radius: 4px 4px 4px 4px;}}.mouseInfo {position: absolute;z-index: 10;left: 40%;bottom: 20px;pointer-events: none;.btn-item {margin: 0px 10px;color: #fff;border: none;height: 30px;border-radius: 4px 4px 4px 4px;}}.map {height: 100%;}.tooltip {position: absolute;width: 250px;background: rgba(255, 255, 255, 0.9);box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.25);border-radius: 4px 4px 4px 4px;padding: 5px 12px;border-top: 4px solid #0fe2ff;.content-col {margin-top: 8px;font-family:PingFang SC,PingFang SC;font-weight: 400;font-size: 14px;color: #666666;line-height: 16px;text-align: left;font-style: normal;text-transform: none;border-radius: 4px 4px 0px 0px;}}:deep(.ant-popover, .ant-popover-content) {border-radius: 10px;}
}.tyxz {border-radius: 10px;.tybox {cursor: pointer;padding-left: 5px;padding-top: 5px;}.desc {text-align: center;font-size: 12px;margin-top: 5px;}.activeimg {background: #139eb1;color: #fff;}
}
</style>

maptools.vue 文件

<template><div><el-popover  placement="top" :width="160"><template #reference><el-button  size="small" type="primary"  v-show="mapType=='2D'" > 图源选择 </el-button></template><el-row :gutter="20" style="width: 280px" class="tyxz"><el-col :span="12" :class="'tybox ' + (imgSource == 'dz' ? ' activeimg' : '')"@click="imagSourceClick('dz')"><img :src="dzs" alt="" width="120" height="120" srcset="" /><p class="desc">电子</p></el-col><el-col :span="12" :class="'tybox ' + (imgSource == 'yx' ? ' activeimg' : '')"@click="imagSourceClick('yx')"><img :src="yxs" alt="" srcset="" width="120" height="120" /><p class="desc">影像</p>    </el-col></el-row></el-popover><el-button size="small" type="primary" v-for="item in tools" v-show="item.type.indexOf(mapType) > -1" @click="item.click" :key="item.id">{{ item.name }}</el-button></div>
</template>
<script lang="ts" setup>
import dzs from "/@/assets/map/dz.png";
import yxs from "/@/assets/map/yx.png";
const props = defineProps({map:Object,mapType:{type:String,default:'3D'}
})
const mapType = ref(props.mapType);
const tools = [{id:1,name:'点位',type:'3D',click:()=>{measurePoint()}},{id:2,name:'距离',type:'2D,3D',click:()=>{measureLine()}},{id:2,name:'高度',type:'3D',click:()=>{measureHeight()}},{id:3,name:'面积',type:'2D,3D',click:()=>{measureArea()}},// {id:6,name:"挖坑",type:'3D',click:()=>{console.log('点击了')}},{id:7,name:"体积",type:'3D',click:()=>{measureVolume()}},{id:8,name:"清除测量",type:'2D,3D',click:()=>{clear()}}]
const imgSource = ref<string>("yx");
const imagSourceClick = (type:any) => {imgSource.value = type;props.map?.imagSourceClick(type)
};
const measurePoint = () => {props.map?.draw('point');
}
const measureHeight = () => {props.map?.draw('height');
}
const measureLine = () => {props.map?.draw('line');
}const measureArea = () => {props.map?.draw('area');
}
const measureVolume = () => {props.map?.draw('volume');
}
const clear = () => {props.map?.clear();
}
</script>
<style scoped lang="scss">
.tyxz {border-radius: 10px;.tybox {cursor: pointer;padding-left: 5px;padding-top: 5px;}.desc {text-align: center;font-size: 12px;margin-top: 5px;}.activeimg {background: #139eb1;color: #fff;}
}
</style>

mapMode.vue文件

<template><div class="map-mode"><el-icon class="icon" @click="toCenter"><Promotion /></el-icon><el-icon  class="icon" @click="zoomIn"><CirclePlusFilled /></el-icon><el-icon  class="icon" @click="zoomOut"><RemoveFilled /></el-icon><span  v-if="mapType==='3D'" class="icon D23" @click="changeMapType('2D')">2D</span><span v-if="mapType==='2D'" class="icon D23" @click="changeMapType('3D')">3D</span></div>
</template>
<script lang="ts" setup>
const props = defineProps({map:Object,mapType:{type:String,default:'2D'}
})
const mapType = ref(props.mapType);
const emit = defineEmits(['changeMapType'])
const changeMapType = (type:string) =>{mapType.value = type;emit('changeMapType',type)
}
const  zoomIn = () =>{props.map?.zoomInOut(0.5);
}
const zoomOut = () =>{props.map?.zoomInOut(-0.5);
}
const toCenter = () =>{props.map?.toCenter([110.105931,22.422299],16);
}
</script>
<style scoped lang="scss">
.map-mode{display: flex;flex-direction: column;align-items: center;background-color: rgba(31,60,113,.66);padding: 5px;border-radius: 5px;.icon{font-size: 20px;cursor: pointer;margin:10px 0px;color: #00cdff;font-weight: bold;}.D23{font-size: 15px;}
}
</style>```

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

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

相关文章

人工智能ACA(六)--计算机视觉基础

一、计算机视觉概述 1. 计算机视觉定义 人工智能&#xff08;AI&#xff09;的一个重要分支旨在使计算机和系统能够从图像或多维数据中“理解”和“解释”视觉世界通过模拟人类视觉系统&#xff0c;计算机视觉技术能够自动执行诸如识别、分类、检测和跟踪等任务。 2. 计算机…

叉车作业如何确认安全距离——UWB测距防撞系统的应用

叉车在工业环境中运行&#xff0c;常常需要在狭窄的空间内完成货物的搬运和堆垛&#xff0c;这对操作员的技术水平和安全意识提出了极高的要求。传统的叉车作业依赖操作员的经验和视觉判断来确认安全距离&#xff0c;然而这种方式往往存在误差&#xff0c;特别是在视线受阻或光…

基于深度学习(HyperLPR3框架)的中文车牌识别系统-搭建开发环境

本篇内容为搭建开发环境。包括&#xff1a;python开发环境&#xff0c;Qt/C开发环境&#xff0c;以及用到的各个库的安装和配置。 一、Python开发环境搭建与配置 1、下载并安装Anaconda 我没有用最新的版本&#xff0c;安装的是 Anaconda3-2021.05-Windows-x86_64.exe&#…

神经网络-AlexNet

AlexNet是在2012年的ImageNet竞赛后&#xff0c;整理发表的文章&#xff0c;也是对CNN网络的衍生。 网络结构 AlexNet网络结构如下图所示&#xff0c;网络分为了上下两部分&#xff0c;对应两个不同的GPU训练&#xff0c;可以更好的利用GPU算力。只有在特殊的网络层后&#x…

【R语言遥感技术】“R+遥感”的水环境综合评价方法

R语言在遥感领域中是一个强大的工具&#xff0c;它提供了一系列的功能和优势&#xff0c;使得遥感数据的分析和应用更加高效和灵活。以下是R语言在遥感中的具体应用&#xff1a; 数据处理&#xff1a;R语言可以处理和清洗遥感数据&#xff0c;包括数据转换、滤波处理、去噪和数…

硬件模块常使用的外部中断

对于STM32来说&#xff0c;想要获取的信号是外部驱动的很快的突发信号 例1&#xff1a;旋转编码器的输出信号&#xff1a; 可能很久都不会拧它&#xff0c;不需要STM32做任何事情但是一拧它&#xff0c;就会有很多脉冲波形需要STM32接收信号是突发的&#xff0c;STM32不知道什…

TCN-Transformer+LSTM多变量回归预测(Matlab)添加气泡图、散点密度图

TCN-TransformerLSTM多变量回归预测&#xff08;Matlab&#xff09;添加气泡图、散点密度图 目录 TCN-TransformerLSTM多变量回归预测&#xff08;Matlab&#xff09;添加气泡图、散点密度图预测效果基本介绍程序设计参考资料 预测效果 基本介绍 基本介绍 1.双路创新&#xff…

基于AI IDE 打造快速化的游戏LUA脚本的生成系统

前面写了一篇关于使用AI IDE进行C安全开发的博客《使用AI IDE 助力 C 高性能安全开发&#xff01;》&#xff0c; 得到许多同学们的喜欢&#xff0c;今天我们来继续在游戏开发中扩展一下AI的能力&#xff0c;看看能不能给游戏研发团队一些启发。 在游戏研发中&#xff0c;Lua曾…

windows nacos安装配置

GitHub下载压缩包 解压目录&#xff08;注意不要用中文路径&#xff09; 在mysql先创建数据库nacos&#xff0c;再执行sql脚本 配置数据库 #*************** Config Module Related Configurations ***************# ### If use MySQL as datasource: ### Deprecated conf…

Redis 基本全局命令

个人主页&#xff1a;C忠实粉丝 欢迎 点赞&#x1f44d; 收藏✨ 留言✉ 加关注&#x1f493;本文由 C忠实粉丝 原创 Redis 基本全局命令 收录于专栏[redis] 本专栏旨在分享学习Redis的一点学习笔记&#xff0c;欢迎大家在评论区交流讨论&#x1f48c; 目录 KEYS EXISTS DEL…

qt QZipReader详解

1、概述 QZipReader 是 Qt 中用于从 .zip 文件中读取和提取文件内容的类。它提供了便捷的方法来访问压缩包中的文件和目录&#xff0c;并允许你解压缩单个或多个文件。通过 QZipReader&#xff0c;你可以以编程方式读取 .zip 文件中的内容&#xff0c;并提取它们到目标目录中。…

开发微信小程序的过程与心得

起因 作为家长&#xff0c;我近期参与了学校的护学岗工作。在这个过程中&#xff0c;我发现需要使用水印相机来记录护学活动&#xff0c;但市面上大多数水印相机应用都要求开通会员才能使用完整功能。作为一名程序员&#xff0c;我决定利用自己的技术背景&#xff0c;开发一个…

基于vue-popperjs的二次封装弹窗

前言&#xff1a; 基于vue-popperjs的二次封装代码 <template><!-- 1. :appendToBody"true"是否把位置加到body外层标签上饿了么UI和antD是true&#xff0c;iview和vuetifyjs是false2. trigger属性触发方式&#xff0c;常用hover悬浮触发、clickToOpen鼠标…

OpenAI 普及 ChatGPT,开通热线电话,近屿智能深耕AI培训

12月19日&#xff0c;在OpenAI直播活动的第10天&#xff0c;宣布允许用户通过电话或WhatsApp与ChatGPT进行交互。并在美国推出 ChatGPT 热线电话&#xff0c;用户拨打后可与 ChatGPT 进行语音对话。 这项服务的一个亮点在于它兼容各种类型的通信设备——不论是现代智能手机如iP…

黑马Java面试教程_P9_MySQL

系列博客目录 文章目录 系列博客目录前言1. 优化1.1 MySQL中&#xff0c;如何定位慢查询&#xff1f;面试文稿 1.2 面试官接着问&#xff1a;那这个SQL语句执行很慢,如何分析 ( 如何优化&#xff09;呢?面试文稿 1.3 了解过索引吗?(什么是索引)1.4 继续问 索引的底层数据结构…

Vue3+@antv/g2plot 生成词云图

antv/g2plot 是一个基于 AntV 的图表库属于antv库的一部分 用于快速创建各种类型的图表 支持折线图、柱状图、饼图、散点图等多种图表类型 antv/g2plot 属于antv库的一部分 g2plot是在g2基础上封装的 npm install antv/g2plot --save效果 所有值共享一个颜色并且每次刷新颜色随…

K线单边突破指标(附带源码)

编写需求&#xff1a; 今天我们来根据粉丝要求进行源码复现&#xff1a; 【请根据最近两根K线判断当下的行情做多&#xff0c;做空方向。用三个价格判断当前K线状态&#xff0c;最高价、最低价、收盘价都大于昨日对应价格&#xff0c;为上涨K线。用三个价格判断当前K线状态&a…

LabVIEW电机控制中的主动消抖

在LabVIEW电机控制系统中&#xff0c;抖动现象&#xff08;如控制信号波动或机械振动&#xff09;会影响系统的稳定性和精度。通过使用主动消抖算法&#xff0c;可以有效降低抖动&#xff0c;提高控制性能。本文将介绍几种主流的主动消抖算法&#xff0c;并结合具体应用案例进行…

【安全测试相关知识】

安全测试介绍 背景 在当前信息技术快速发展的背景下&#xff0c;网络安全问题日益严峻&#xff0c;数据泄露、黑客攻击、病毒传播等安全事件层出不穷&#xff0c;给个人、企业乃至国家带来严重威胁。所以安全测试已成为企业和国家关注的重心 作用 安全测试是确保软件系统安…