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

查pv uv的网站电子商务网站建设的步骤

查pv uv的网站,电子商务网站建设的步骤,泰安住房和城乡建设厅网站,企业文化的重要性使用addInteraction添加交互draw绘制&#xff0c;预期removeInteraction删除交互draw绘制时不再绘制&#xff0c;但是删除绘制不起作用&#xff0c;各种找原因&#xff0c;结果把data中的map变量注释掉即可&#xff0c;原因未知。 <template><div><div id"…

使用addInteraction添加交互draw绘制,预期removeInteraction删除交互draw绘制时不再绘制,但是删除绘制不起作用,各种找原因,结果把data中的map变量注释掉即可,原因未知。

<template><div><div id="map" style="position:absolute;width:100vw;height:100vh"></div><div style="position: absolute; left: 50px; top:10px"><el-button @click="addInteractions">绘制</el-button><el-button @click="removeInteractions">取消</el-button></div></div>
</template>
<script src="./index.js"></script>
<style lang="scss" src="./index.scss" scoped></style>
import "ol/ol.css";
import GeoJSON from 'ol/format/GeoJSON'
import { Map, View } from "ol";
import TileLayer from "ol/layer/Tile";
import { fromLonLat } from "ol/proj";
import { Select, Modify, Draw, Snap } from 'ol/interaction';
import { Tile, Vector as VectorLayer } from 'ol/layer'
import { Point } from 'ol/geom'
import { XYZ, TileWMS, Vector as VectorSource } from 'ol/source'
import MapOne from '@/components/MapOne/index.vue';export default {components: {MapOne},data() {return {// map: null, // 不要声明,否则removeInteraction不起作用}},computed: {},watch: {},mounted() {this.initMap()},created() {},methods: {initMap() {this.map = new Map({target: "map",view: new View({center: fromLonLat([113.53450137499999, 34.44104525]),zoom: 5}),layers: [new TileLayer({source: new XYZ({url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}'}),}),],});this.selectSource = new VectorSource({format: new GeoJSON(),})var selectLayer = new VectorLayer({source: this.selectSource,})this.map.addLayer(selectLayer)},addInteractions() {this.select = new Select({wrapX: false,});this.modify = new Modify({features: this.select.getFeatures(),});this.draw = new Draw({type: 'Polygon',source: this.selectSource,});this.snap = new Snap({source: this.selectSource,});this.changeInteractions('draw')},removeInteractions() {this.map.removeInteraction(this.modify);this.map.removeInteraction(this.select);this.map.removeInteraction(this.draw);this.map.removeInteraction(this.select);},changeInteractions(value) {this.removeInteractions();switch (value) {case 'draw': {this.map.addInteraction(this.draw);this.map.addInteraction(this.snap);break;}case 'modify': {this.map.addInteraction(this.select);this.map.addInteraction(this.modify);this.map.addInteraction(this.snap);break;}default: {// pass}}},}
}

http://www.shuangfujiaoyu.com/news/17826.html

相关文章:

  • wordpress 插件原理桂林网站优化
  • 做网站需要下载啥裤子seo关键词
  • 公司建立网站的目的seo站长工具查询
  • 网站开发公司 logo百度普通下载
  • 专业设计企业网站网络怎样做推广
  • 哪些香港网站不能访问家庭优化大师
  • 济南手机网站开发公司电话智能建站平台
  • 厦门制作公司网站哪家好百度推广账户怎么开
  • 怎么做交互式网站怎样创建网站
  • wordpress 全站sslseo排名优化是什么
  • 网站开发所得税创建网站花钱吗
  • 网站推广的常用方法建设网站
  • 深圳开发的相亲网站百度搜索推广技巧
  • 2022年注册公司流程汕头seo关键词排名
  • 政府门户网站信息建设自查软文写作发布
  • 合肥如何做百度的网站市场营销活动策划方案
  • 海拉尔做网站多少钱西安百度推广运营
  • wordpress页面模板是哪个文件白帽seo公司
  • 代做ppt网站好今日军事新闻视频
  • 网站点击后的loading是怎么做的西安优化网站公司
  • 自己做网站可以吗杭州网站seo推广
  • 西安php网站建设谷歌推广优化
  • psd做网站切片淘宝指数官网的网址
  • 网站建设 用英文怎么说大数据培训班出来能就业吗
  • 网站开发要求描述南宁推广软件
  • 北京网站高端定制全面落实疫情防控优化措施
  • 网站建设估价seo研究中心教程
  • 备案 网站 收录免费的网站软件
  • 做网站的骗术百度推广没有一点效果
  • 网站h1标签的应用seo中介平台