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

家用电脑搭建网站组织建设求是网

家用电脑搭建网站,组织建设求是网,企业手机网站源码下载,信誉好的郑州网站建设凸显出当前区域 需要当前地方的json数据 这个可以在阿里的这个阿里 看下效果图 遮盖层的逃命都是可以调的 引入 下面一段代码 import sx from /views/json/sx1.json; // 下载的json import GeoJSON from ol/format/GeoJSON; // ol的一些方法 imp…凸显出当前区域 需要当前地方的json数据 这个可以在阿里的这个阿里 看下效果图 遮盖层的逃命都是可以调的 引入 下面一段代码 import sx from /views/json/sx1.json; // 下载的json import GeoJSON from ol/format/GeoJSON; // ol的一些方法 import Polygon, { fromExtent } from ol/geom/Polygon; import LinearRing from ol/geom/LinearRing;templatediv classcontainerdiv idvue-openlayers classmap-x/divdividinfo-boxclassinfo-boxstylewidth: 100px; height: 100px/divdiv idcanv stylewidth: 100px; height: 100px/div/div /template script import ol/ol.css; import { Map, View, style, Feature, geom, Overlay } from ol; import TileLayer from ol/layer/Tile; import XYZ from ol/source/XYZ; import { Vector as VectorSource } from ol/source; import VectorLayer from ol/layer/Vector; import { Point, LineString } from ol/geom; import { Style, Icon, Stroke, Text, Fill } from ol/style; import logo from /assets/logo.png; import * as ol from ol; import ol-ext/dist/ol-ext.css;import sx from /views/json/sx1.json; import GeoJSON from ol/format/GeoJSON; import Polygon, { fromExtent } from ol/geom/Polygon; import LinearRing from ol/geom/LinearRing;export default {name: FirstMap,data() {return {map: null,draw: null,maskLayer: null,logo,layers: [],};},methods: {initMap() {let that this;// 将图标样式应用到点要素const features [];const point new Point([108.56, 34.15]); // 修改坐标格式const feature new Feature({geometry: point,custom: { data: 123, type: icon },type: icon,});feature.setStyle([new Style({image: new Icon({crossOrigin: anonymous,src: this.logo,// size: [40, 40],scale: 0.2, // 图标缩放比例}),}),]);features.push(feature);//设置地图的数据源const source new VectorSource({features,});let markLayerPoints new VectorLayer({source: source,});let map new Map({target: vue-openlayers,layers: [new TileLayer({source: new XYZ({url: https://gdtc.shipxy.com/tile.g?lenmdz{z}x{x}y{y},}),}),markLayerPoints, // 确保图层顺序正确// vectorLayers,],view: new View({projection: EPSG:4326,center: [108.56, 34.15], // 修改中心坐标格式zoom: 6,}),});this.map map;that.showSFArea() // 蓝色蒙层},// 移除图层方法removeFun(layerId) {const that this;const selArr that.map.getLayers().getArray(); // 获取所有图层selArr.map((item, index) {if (item.values_?.id layerId) {// 移除图层that.map.removeLayer(selArr[index]);}});},// 创建蒙层凸显区域showSFArea() {const initLayer new VectorLayer({name: blueLayer,// zIndex: 1,// opacity: 0.6,source: new VectorSource(),style: new Style({fill: new Fill({color: rgba(3, 44, 79, 1),}),stroke: new Stroke({color: rgba(0,0,0,0.8),width: 1})}),});this.map.addLayer(initLayer);this.addConver(initLayer);},// 添加遮罩addConver(converLayer) {let codeJson sx;var fts new GeoJSON().readFeatures(codeJson);const ft fts[0];const converGeom this.erase(ft.getGeometry());const convertFt new Feature({geometry: converGeom,});converLayer.getSource().addFeature(convertFt);},// 擦除操作生产遮罩范围erase(geom) {const extent [-180, -90, 180, 90];const polygonRing fromExtent(extent);const coords geom.getCoordinates();coords.forEach((coord) {const linearRing new LinearRing(coord[0]);polygonRing.appendLinearRing(linearRing);});return polygonRing;},},mounted() {this.initMap();}, }; /script style scoped langscss .input {position: fixed;top: 10px;right: 10px;border-radius: 10px;background: #fff;display: flex;flex-direction: column;padding: 5px;padding-bottom: 10px; * {margin-top: 10px;display: flex;align-items: center;} } /stylestyle scoped langscss .container {position: relative;.btn {position: absolute;left: 4%;top: 1%;} }#vue-openlayers {width: 100vw;height: 100vh; }h3 {line-height: 40px; }/* 隐藏信息盒子的初始样式 */ #info-box {display: none;position: absolute;background: white;border: 1px solid black;padding: 10px;border-radius: 5px;font-size: 14px;pointer-events: none; /* 防止信息盒子影响鼠标事件 */ } /style
http://www.hkea.cn/news/14496720/

相关文章:

  • 低价格网站建设查询个人公司注册公司
  • 专业营销网站带客建筑设计装修
  • 佛山网站搜索引擎优化wordpress vr
  • 网站建设都是需要什么青浦网站建设 迎鑫
  • 邯郸wap网站建设费用凉山网站建设
  • 权4网站怎么做肥西县建设发展局网站
  • 做品牌网站找谁上海建设网站哪家好
  • 山东省南水北调建设管理局网站公司内部网站一般都怎么维护
  • 电子商务网站开发岗位深圳网站建设服务平台
  • 学习资料黄页网站免费织梦导航网站模板
  • 做网站的流程是什么怎样制作网页木马
  • 做网站的是些什么公司wordpress本地怎么上传服务器
  • 成都html5网站建设wordpress 产品报价系统
  • 网站建设公司 信科便宜网站制作咨询电话
  • 网站建设公司怎么样网址大全下载app
  • 什么是自适应网站北京模板建站
  • dw网站的站点建设电影网站源码系统
  • 盐城市滨海县建设局网站东莞软件网站推广
  • 网站建设能赚钱吗随机置顶wordpress
  • 可以先做网站后备案吗三角镇建网站公司
  • 哪个公司网站建设好小程序开发平台怎么选择
  • 国外网站流量网站开发用
  • 产看网站权重广东省第二中医院官网进入公众号
  • 租车网站建设湖南seo服务
  • 网站优化成本网站规划与建设是什么样的
  • 做视频教育网站网站新闻发布后前台不显示
  • 猎头公司好做吗湖南关键词优化首选
  • 凡客网站网址wordpress 登陆logo
  • 完整的网站后台权限编码软件工程师招聘简章pdf免费
  • wp建站系统trellis wordpress