当前位置: 首页 > news >正文

自己的网站怎么开太原互联网推广公司

自己的网站怎么开,太原互联网推广公司,网站备案填了虚假座机能过吗,嘉定网站设计公司效果&#xff1a;点击表格可实现选中地图点位&#xff0c;删除按钮点击可删除对应点位并且重新绘制线段&#xff0c;点击确定按钮 保存已经绘制的点位信息传给父组件 并且该组件已实现回显 完整的组件代码如下 文件名称为&#xff1a; leafletMakePointYt <!--* Descripti…

 效果:点击表格可实现选中地图点位,删除按钮点击可删除对应点位并且重新绘制线段,点击确定按钮 保存已经绘制的点位信息传给父组件 并且该组件已实现回显 

 

 完整的组件代码如下  文件名称为:

leafletMakePointYt
<!--* @Description: leaflet 地图选择点位 实现画线 页面* @Author: mhf* @Date: 2023-05-30 18:23:37
-->
<template><el-dialogwidth="1300px"append-to-bodyv-dialog-outv-if="dialogVisible":title="title":visible.sync="dialogVisible":close-on-click-modal="false":before-close="hideDialog"><div><!-- 地图盒子 --><div id="map"></div><!-- 左侧坐标展示框 --><div class="points-box"><!-- 顶部标题 --><div class="points-box-title"><span> 线路坐标 </span></div><!-- 坐标展示表 --><div class="points-box-table"><el-tablehighlight-current-row@current-change="handleCurrentChange":data="pointsArr"style="width: 100%":height="tableHeight"><el-table-column label="#" type="index" /><el-table-column prop="lat" label="经度" width="158" /><el-table-column prop="lng" label="纬度" width="158" /><el-table-columnlabel="操作"width="60"fixed="right"v-if="showBtn"><template slot-scope="scope"><el-button type="text" size="small" @click="delRow(scope)">删除</el-button></template></el-table-column></el-table></div><!-- 坐标盒子 底部按钮组 --><div v-if="showBtn" class="points-box-btn"><el-button type="" size="" @click="clearMapLine"> 清除</el-button><el-button type="primary" size="" @click="makeMapLine">开始</el-button><el-button type="primary" size="" @click="endMakeLine">结束</el-button></div></div></div><!-- 弹窗底部按钮组 --><div v-if="showBtn" slot="footer" class="dialog-footer"><el-button @click="hideDialog">取 消</el-button><el-button type="primary" @click="submitPoints()">确 定</el-button></div></el-dialog>
</template><script>
import L from "leaflet";
import "leaflet/dist/leaflet.css";
//  引入互联网地图插件
require("@/utils/leftletMap/leaflet.ChineseTmsProviders.js");
require("@/utils/leftletMap/tileLayer.baidu.js");
// 引入互联网地图纠偏插件
require("@/utils/leftletMap/leaflet.mapCorrection.min.js");export default {name: "leafletMakePointYt",components: {},props: {showBtn: {type: Boolean,default: true,},},data() {return {dialogVisible: false,title: "",map: null,iconStyle: {icon: L.icon({iconUrl: require("/public/img/mapIcon/point.png"),iconSize: [12, 12],// iconAnchor: [19, 19],// popupAnchor: [0, -10]}),}, // 点位图标样式chooseIconStyle: {icon: L.icon({iconUrl: require("/public/img/mapIcon/marker.png"),iconSize: [30, 30],iconAnchor: [18, 22],}),}, // 表格中选中的点位图标样式startIconStyle: {icon: L.icon({iconUrl: require("/public/img/mapIcon/startPoint.png"),iconSize: [30, 30],iconAnchor: [18, 22],}),}, // 起点点位图标样式endIconStyle: {icon: L.icon({iconUrl: require("/public/img/mapIcon/endPoint.png"),iconSize: [30, 30],iconAnchor: [18, 22],}),}, // 终点点位图标样式polylineStyle: {color: "#FF6B00",weight: 4,}, // 线条样式pointsArr: [], // 标记点位列表 [{lat: 30, lng: 120}, {lat: 31, lng: 121}]pointsArrMarker: [], // 已经绘制的点位polylineArr: [], // 已经绘制多条线段chooseMarker: undefined, // 当前选中的点位tableHeight: 440,loading: false, // loading 动画loadingInstance: null,};},methods: {hideDialog() {this.dialogVisible = false;this.map.remove();this.map = null;},submitPoints() {if (this.pointsArr.length < 2) {this.$message.warning("请先绘制线路");} else {this.$emit("on-response", this.pointsArr); // 将绘制好的坐标传递给父组件this.hideDialog();}},showDialog(data) {this.dialogVisible = true;this.title = data.title;this.$nextTick(() => {/* 避免重复渲染 */if (!this.map) this.initMap();this.handleResize();if (data.data) {this.pointsArr = JSON.parse(data.data);/* 线段回显 */var polyline = L.polyline(this.pointsArr, this.polylineStyle).addTo(this.map);this.polylineArr.push(polyline);/* 点位回显 */this.pointsArr.forEach((item, index) => {var marker = L.marker([item.lat, item.lng], this.iconStyle).addTo(this.map); // 添加标记点this.pointsArrMarker.push(marker);});}});},/*** @Event 方法* @description: 初始化 leaflet 地图* */initMap() {this.map = L.map("map", {center: [30.194637, 120.122247],zoom: 13,attributionControl: false, // 隐藏logozoomControl: false, // 默认缩放控件(仅当创建地图时该 zoomControl 选项是 true)。crs: L.CRS.Baidu, // 用于 WMS 请求的坐标参考系统,默认为映射 CRS。 如果您不确定它的含义,请不要更改它。});L.control.zoom({position: "bottomright",}).addTo(this.map);L.tileLayer.baidu({ layer: "vec" }).addTo(this.map); // 添加底图},/*** @Event 方法* @description: 开始画线* */makeMapLine() {this.map.getContainer().style.cursor = "crosshair"; // 更改鼠标样式// let index = -1var marker, polyline;this.map.on("click", (e) => {// index++// if (index === 0) {/* 设置起点 */// L.marker([e.latlng.lat, e.latlng.lng], this.startIconStyle).addTo(this.map);/* 设置起点 */// } else {marker = L.marker([e.latlng.lat, e.latlng.lng], this.iconStyle).addTo(this.map); // 添加标记点// }this.pointsArrMarker.push(marker);this.pointsArr.push(e.latlng); // 添加点位坐标至点位数组polyline = L.polyline(this.pointsArr, this.polylineStyle).addTo(this.map); // 创建单条线段this.polylineArr.push(polyline);});},/*** @Event 方法* @description: 结束画线* */endMakeLine() {if (this.pointsArr === [] || this.pointsArr.length === 0) {this.$message.warning("请先绘制线路");} else {this.map.getContainer().style.cursor = "grab"; // 更改鼠标样式this.map.fitBounds(this.polylineArr[this.polylineArr.length - 1].getBounds()); // 缩放地图以适应标记和线条this.map.on("mousedown", (e) => {this.map.getContainer().style.cursor = "grabbing"; // 更改鼠标样式});this.map.on("mouseup", (e) => {this.map.getContainer().style.cursor = "grab"; // 更改鼠标样式});this.map.off("click"); // 关闭点击事件}},/*** @Event 方法* @description: 移除线段和点位* */clearMapLine() {if (this.pointsArr === [] || this.pointsArr.length === 0) {} else {/* 移除点位 */this.pointsArrMarker.forEach((marker) => {this.map.removeLayer(marker);});/* 移除线段 */this.polylineArr.forEach((polyline) => {polyline.remove();});this.endMakeLine(); // 结束画线this.polylineArr = [];this.pointsArr = [];}},/*** @Event 方法* @description: 动态改变表格的高度* */handleResize() {const height = document.querySelector(".points-box-table").offsetHeight;this.tableHeight = height - 10;},/*** @Event 方法* @description: 表格单行选中事件,实现每次点击时都能删除上一次点击的图标* */handleCurrentChange(row) {if (this.chooseMarker) {this.map.removeLayer(this.chooseMarker);}this.chooseMarker = L.marker([row.lat, row.lng],this.chooseIconStyle).addTo(this.map); // 添加标记点},/*** @Event 方法* @description: 删除表格单行数据并且移除该点位* */delRow(row) {this.loading = true;this.$nextTick(() => {const target = document.querySelector(".el-dialog__body");let options = {lock: true,text: "重新绘制中...",spinner: "el-icon-loading",background: "rgba(0, 0, 0, 0.7)",};this.loadingInstance = this.$loading(options, target);});setTimeout(() => {this.loading = false;this.loadingInstance.close();/* 删除点位 */this.map.removeLayer(this.pointsArrMarker[row.$index]);this.pointsArrMarker.splice(row.$index, 1); // 已经绘制的点位this.pointsArr.splice(row.$index, 1); // 标记点位列表/* 删除点位 *//* 删除线段 */this.polylineArr.forEach((polyline) => {polyline.remove();});var polyline = L.polyline(this.pointsArr, this.polylineStyle).addTo(this.map);this.polylineArr.push(polyline);/* 删除线段 */}, 500);},},created() {},mounted() {window.addEventListener("resize", this.handleResize);},destroyed() {window.removeEventListener("resize", this.handleResize);},
};
</script><style lang="scss" scoped>
.dialog-footer {text-align: center;
}#map {height: 68vh;
}.points-box {width: 426px;height: 570px;position: absolute;top: 100px;z-index: 99999 !important;background-color: #fff;left: 40px;&-title {height: 40px;background-color: #1492ff;font-size: 18px;color: #ffffff;line-height: 40px;padding: 0 20px;}&-table {height: 490px;}&-btn {height: 50px;position: absolute;padding-bottom: 18px;bottom: 0;left: 0;right: 0;margin: auto;width: 80%;display: flex;justify-content: space-around;align-items: center;}
}
</style>
<el-form-item label="线路轨迹 : " prop="assetSection.point"><el-inputv-model="formData.assetSection.point"disabledplaceholder=""><template slot="append"><div class="choose-class" @click="showLeafletMap"><i class="iconfont if-ditudingwei" /> <span>选择</span></div></template></el-input></el-form-item><leafletMakePointYt ref="leafletMakePointYt" @on-response="getPoints" />// 打开弹窗 showLeafletMap() {let passData = {title: "选择线路轨迹",data: this.formData.assetSection.point,};this.$refs.leafletMakePointYt.showDialog(passData);},// passData: {
title: "选择线路轨迹",
data: "[{"lat":30.19398904706604,"lng":120.1454230189172},{"lat":30.204226626758985,"lng":120.19285355280543},{"lat":30.22270148713875,"lng":120.13162504542244},{"lat":30.189494160206575,"lng":120.15490912569484}]"
}// 接收弹窗的点位数据getPoints(data) {this.$set(this.formData.assetSection, "point", JSON.stringify(data));this.$set(this.formData.assetSection, "startLongitude", data[0].lng);this.$set(this.formData.assetSection, "startLatitude", data[0].lat);this.$set(this.formData.assetSection,"endLongitude",data[data.length - 1].lng);this.$set(this.formData.assetSection,"endLatitude",data[data.length - 1].lat);},


文章转载自:
http://dinncorheotrope.stkw.cn
http://dinncorubdown.stkw.cn
http://dinncoflashtube.stkw.cn
http://dinncomenopausic.stkw.cn
http://dinncotextualist.stkw.cn
http://dinncolanarkshire.stkw.cn
http://dinncopashalik.stkw.cn
http://dinncolimpen.stkw.cn
http://dinncomelanin.stkw.cn
http://dinncofyke.stkw.cn
http://dinncochinese.stkw.cn
http://dinncoeluent.stkw.cn
http://dinncodevalorize.stkw.cn
http://dinncoexhibitionism.stkw.cn
http://dinncopseudocoelomate.stkw.cn
http://dinncogrisgris.stkw.cn
http://dinncodocete.stkw.cn
http://dinncoart.stkw.cn
http://dinncomissy.stkw.cn
http://dinncoinnerve.stkw.cn
http://dinncosquelcher.stkw.cn
http://dinncoshuck.stkw.cn
http://dinncobowstring.stkw.cn
http://dinncopurgee.stkw.cn
http://dinncoshareware.stkw.cn
http://dinncojavan.stkw.cn
http://dinncomisinformation.stkw.cn
http://dinncointeroceptive.stkw.cn
http://dinncosingapore.stkw.cn
http://dinncoarousal.stkw.cn
http://dinncoskimming.stkw.cn
http://dinncobabi.stkw.cn
http://dinncobondman.stkw.cn
http://dinncowap.stkw.cn
http://dinncocreasy.stkw.cn
http://dinncoerose.stkw.cn
http://dinncodisembargo.stkw.cn
http://dinncofinch.stkw.cn
http://dinncostraw.stkw.cn
http://dinncoscion.stkw.cn
http://dinncovalvulitis.stkw.cn
http://dinncolaver.stkw.cn
http://dinncolapland.stkw.cn
http://dinnconepheline.stkw.cn
http://dinncoplanchet.stkw.cn
http://dinncosouthdown.stkw.cn
http://dinncolatteen.stkw.cn
http://dinncosympathetectomy.stkw.cn
http://dinncoparasympathetic.stkw.cn
http://dinncoepicritic.stkw.cn
http://dinncotrunk.stkw.cn
http://dinncosenti.stkw.cn
http://dinncodisrespect.stkw.cn
http://dinncoglengarry.stkw.cn
http://dinncoholmia.stkw.cn
http://dinncodisrepute.stkw.cn
http://dinncobezel.stkw.cn
http://dinncopyrenees.stkw.cn
http://dinncorepone.stkw.cn
http://dinncohospltaler.stkw.cn
http://dinncorevocative.stkw.cn
http://dinncostamping.stkw.cn
http://dinncoapophyge.stkw.cn
http://dinncoknacker.stkw.cn
http://dinncoshoot.stkw.cn
http://dinncosexagesimal.stkw.cn
http://dinnconegrohead.stkw.cn
http://dinncoillutation.stkw.cn
http://dinncolitteratim.stkw.cn
http://dinncotour.stkw.cn
http://dinncohardtack.stkw.cn
http://dinncoborder.stkw.cn
http://dinncopropulsor.stkw.cn
http://dinnconoah.stkw.cn
http://dinncoayc.stkw.cn
http://dinncostuffless.stkw.cn
http://dinncojesuitism.stkw.cn
http://dinncoaerification.stkw.cn
http://dinncogarlicky.stkw.cn
http://dinncotawdrily.stkw.cn
http://dinncoyellowcake.stkw.cn
http://dinncobelie.stkw.cn
http://dinncodeadlight.stkw.cn
http://dinncoflyblown.stkw.cn
http://dinncoebullioscopy.stkw.cn
http://dinncowollaston.stkw.cn
http://dinncoadvancer.stkw.cn
http://dinncoushership.stkw.cn
http://dinncofrightfulness.stkw.cn
http://dinncomechanic.stkw.cn
http://dinncoacquirement.stkw.cn
http://dinncohavre.stkw.cn
http://dinncotetrazolium.stkw.cn
http://dinncokewpie.stkw.cn
http://dinncoabetment.stkw.cn
http://dinncoheliosis.stkw.cn
http://dinncoprometal.stkw.cn
http://dinncoalienation.stkw.cn
http://dinncoodalisk.stkw.cn
http://dinncoimbrue.stkw.cn
http://www.dinnco.com/news/147728.html

相关文章:

  • 买域名做网站表白app引导页模板html
  • 做地方门户网站的排名怎么开自己的网站
  • 诚讯通网站口碑营销的步骤
  • 厦门网站开发比较大的公司自己网站怎么推广
  • 摄影网站建设方案seo中国官网
  • 网站建设 注意事项网络营销考试题目及答案2022
  • 门户网站手机版朋友圈软文范例
  • 两个域名同一个网站做优化连云港百度推广总代理
  • 如何做建筑一体化的网站网络营销可以做什么工作
  • wordpress公告栏插件新乡网站优化公司
  • 专门做棋牌广告广告的网站seo网站推广软件
  • 专业建站公司主要做什么线上营销模式
  • 成都专业手机网站建设推广百度app安装免费下载
  • 通辽做网站制作公司软文推广发稿平台
  • 用明星名字做网站沈阳网站seo
  • 用ps切片做网站能不能完成企业宣传方式有哪些
  • 看房自己的网站建设多少钱产品如何推广
  • 拜年小程序制作深圳网站优化推广方案
  • 网站建设百强企业服装店营销策划方案
  • 网站已经建好 可以换空间供应商么南昌seo优化公司
  • 佛山网站优化怎么做免费seo技术教程
  • 网站备案黑名单seo外包推广
  • 扬州网站建设费用seo网站优化培训找哪些
  • 网站制作jian she网络游戏推广
  • 新网站的建设工作网站搜索关键词优化
  • 作品设计方案怎么写免费seo优化工具
  • 公司网页设计费用东莞市网络seo推广价格
  • 谷歌做新媒体运营的网站石家庄关键词优化报价
  • 长沙哪里有创建网站的公司nba体育新闻
  • 如何做ppt的模板下载网站计算机培训班培训费用