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

建设部网站申请表无法打印WordPress两种列表页

建设部网站申请表无法打印,WordPress两种列表页,网站建设哪家便,动漫制作专业在国企前端开发之在vue项目中使用openLayers 前言效果图在vue中渲染地图安装ol插件1、调用插件2、 初始话地图3、地图点击事件4、重置坐标5、通过坐标改变视图6、保存坐标点 vue中使用的源码 前言 本篇文章主要讲解openLayers的初步使用#xff0c;包括渲染地图、获取点坐标、标记点… 前端开发之在vue项目中使用openLayers 前言效果图在vue中渲染地图安装ol插件1、调用插件2、 初始话地图3、地图点击事件4、重置坐标5、通过坐标改变视图6、保存坐标点 vue中使用的源码 前言 本篇文章主要讲解openLayers的初步使用包括渲染地图、获取点坐标、标记点、中心位置的调整、以及获取到经纬度向后台发送请求 演示地址 官网 gitee链接 效果图 在vue中渲染地图 安装ol插件 npm install ol 1、调用插件 import “ol/ol.css”; import { Map, View, ol } from “ol”; import TileLayer from “ol/layer/Tile”; 2、 初始话地图 /*** 初始化地图*/initMap () {var that this// 创建地图中心点坐标const centerCoordinate [0, 0];// 初始化视图对象const view new View({center: centerCoordinate,zoom: 3,projection: EPSG:4326,});// 创建ArcGIS World Street Map图层const arcGISLayer new TileLayer({source: new XYZ({// url: https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}url: http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}})});// 初始化地图对象this.map new Map({target: this.$refs.mapContainer,layers: [arcGISLayer],view: view});//鼠标单击事件this.map.on(singleclick, function (e) {that.mapX e.coordinate[0]that.mapY e.coordinate[1]that.addVectorLabel(e.coordinate)});return this.map},3、地图点击事件 // 定义点createLabelStyle (feature) {return new Style({/**{olx.style.IconOptions}类型*/image: new Icon(({anchor: [0.5, 60],anchorOrigin: top-right,anchorXUnits: fraction,anchorYUnits: pixels,offsetOrigin: top-right,// offset:[0,10],//图标缩放比例scale: 0.1,//透明度opacity: 0.75,//图标的urlsrc: require(../assets/gd.png)}))});},// 添加坐标点addVectorLabel (coordinate) {if (this.vectorSource) {this.vectorSource.clear()} else {//矢量标注的数据源this.vectorSource new VectorSource({features: []})}// //矢量标注图层this.vectorLayer new VectorLayer({source: this.vectorSource});this.map.addLayer(this.vectorLayer);//新建一个要素var newFeature new Feature({//几何信息geometry: new Point(coordinate)});//设置要素的样式newFeature.setStyle(this.createLabelStyle(newFeature));this.vectorSource.addFeature(newFeature);}4、重置坐标 CZ () {this.vectorSource.clear()this.mapX this.mapY },5、通过坐标改变视图 DW () { var view this.map.getView(); var py ([parseInt(this.mapX), parseInt(this.mapY)]); //平移地图 view.setCenter(py); this.addVectorLabel([this.mapX, this.mapY]) view.setZoom(9); }, 6、保存坐标点 BC () {var parpms {mapX: this.mapX,mapY: this.mapY}const instance axios.create({baseURL: https://127.0.0.1});instance.post(/api/data, parpms).then(response {// response.data;//请求返回的数据}).catch(error {console.log(error);});},vue中使用的源码 templatedivdiv idmap-container refmapContainer classmap-container/divdiv classformListdiv classinputdiv classname北纬:/divel-input v-modelmapX placeholder请输入内容/el-input/divdiv classinputdiv classname东经/divel-input v-modelmapY placeholder请输入内容/el-input/divdiv classbutton clickCZ重置/divdiv classbutton clickDW定位/divdiv classbutton clickBC保存/div/div/div/templatescript import ol/ol.css;import { fromLonLat } from ol/proj; import { OSM, Vector as VectorSource, Raster as RasterSource } from ol/source; import { Vector as VectorLayer } from ol/layer; import { Fill, Style, Stroke, Icon, Circle as CircleStyle } from ol/style; import { Point } from ol/geom; //标点,画线 import Feature from ol/Feature; import { Map, View, ol } from ol; import TileLayer from ol/layer/Tile; import XYZ from ol/source/XYZ; import axios from axios;export default {name: MapComponent,data () {return {mapX: ,mapY: ,};},mounted () {this.map this.initMap()},methods: {/*** 初始化地图*/initMap () {var that this// 创建地图中心点坐标const centerCoordinate [0, 0];// 初始化视图对象const view new View({center: centerCoordinate,zoom: 3,projection: EPSG:4326,});// 创建ArcGIS World Street Map图层const arcGISLayer new TileLayer({source: new XYZ({url: http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}})});// 初始化地图对象this.map new Map({target: this.$refs.mapContainer,layers: [arcGISLayer],view: view});//鼠标单击事件this.map.on(singleclick, function (e) {that.mapX e.coordinate[0]that.mapY e.coordinate[1]that.addVectorLabel(e.coordinate)});return this.map},CZ () {this.vectorSource.clear()this.mapX this.mapY },DW () {var view this.map.getView();var py ([parseInt(this.mapX), parseInt(this.mapY)]);//平移地图view.setCenter(py);this.addVectorLabel([this.mapX, this.mapY])view.setZoom(9);},BC () {var parpms {mapX: this.mapX,mapY: this.mapY}const instance axios.create({baseURL: https://127.0.0.1});instance.post(/api/data, parpms).then(response {// response.data;//请求返回的数据}).catch(error {console.log(error);});},// 定义点createLabelStyle (feature) {return new Style({/**{olx.style.IconOptions}类型*/image: new Icon(({anchor: [0.5, 60],anchorOrigin: top-right,anchorXUnits: fraction,anchorYUnits: pixels,offsetOrigin: top-right,// offset:[0,10],//图标缩放比例scale: 0.1,//透明度opacity: 0.75,//图标的urlsrc: require(../assets/gd.png)}))});},// 添加坐标点addVectorLabel (coordinate) {if (this.vectorSource) {this.vectorSource.clear()} else {//矢量标注的数据源this.vectorSource new VectorSource({features: []})}// //矢量标注图层this.vectorLayer new VectorLayer({source: this.vectorSource});this.map.addLayer(this.vectorLayer);//新建一个要素var newFeature new Feature({//几何信息geometry: new Point(coordinate)});//设置要素的样式newFeature.setStyle(this.createLabelStyle(newFeature));this.vectorSource.addFeature(newFeature);}} }; /scriptstyle .map-container {width: 100%;height: 100vh;margin: 0;padding: 0; }.formList {position: fixed;top: 10px;left: 50px;display: flex; }.formList div {margin-left: 20px; }.button {width: 50px;line-height: 40px;background-color: #f68e41;border-radius: 3px;color: #fff; }.input {display: flex; }.input .name {line-height: 40px;width: 25%; } /style
http://www.ho-use.cn/article/10814259.html

相关文章:

  • 易讯网络网站建设广州网站建设制作价格
  • 培训网站模板免费管理平台登录
  • 宁波网站排名优化费用wordpress防注册
  • 网站监控的软件怎么做亳州网站网站建设
  • 医院行业网站网站开发报价标准
  • 购物网站排名前十名网站及微站建设合同
  • 外贸网站建设 杭州app开发公司怎么选择
  • 专业的广州微网站建设网络营销案例介绍
  • 百度网站建设要多少钱石家庄哪里做网站比较好
  • 闸北企业网站制作做网站都是怎么收费
  • 字体升级wordpress长沙seo袁飞
  • 网站不备案可以上线吗如何开展网站推广
  • 石家庄营销网站建设价格地宝网 网站建设
  • 哪个购物网站最便宜广州网站建设服务哪家好
  • 门户网站建设如何入账建e室内设计网官网图库
  • 万网虚拟机怎么做两个网站公司网站数据分析
  • 可以做外链的图片网站天辰建设信息网
  • 郑州学校网站建设网易企业邮箱名称
  • 域名抢注网站陕西建设厅执业资格注册中心网站
  • 怎么才能打开一些网站电子商务与网站建设课程
  • 长沙网站模板建设建设电商网站的总结
  • 网站建设策划书 范文高权重网站收录问题
  • 软文推广发布asp网站做seo
  • 国外设计网站都有哪些福建省建设执业继续教育网站
  • 个人网站制作教程视频平面设计免费软件有哪些
  • 陕煤化建设集团网站矿建二公司多语种网站建设
  • 网站建设首页步骤网店托管代运营费用多少钱
  • 手机网站合同网站素材模板 站长
  • 网站建设如何跑单子网页设计软件dw免费下载
  • 做动画的网站有哪些类似淘宝商城网站建设方案