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

接单做效果图网站ios应用开发语言

接单做效果图网站,ios应用开发语言,免费注册二级域名网站,广东网站备案要求官网demo地址#xff1a; https://openlayers.org/en/latest/examples/data-tiles.html 这篇示例讲解的是自定义加载DataTile源格式的数据。 先来看一下什么是DataTile#xff0c;这个源是一个数组#xff0c;与我们之前XYZ切片源有所不同。DataTile主要适用于需要动态生成… 官网demo地址 https://openlayers.org/en/latest/examples/data-tiles.html 这篇示例讲解的是自定义加载DataTile源格式的数据。 先来看一下什么是DataTile这个源是一个数组与我们之前XYZ切片源有所不同。DataTile主要适用于需要动态生成、处理或渲染瓦片数据的复杂场景。 先新建一个canvas设置一下画布参数。 //256x256 像素是瓦片图层的常见尺寸const size 256;const canvas document.createElement(canvas);canvas.width size;canvas.height size;const context canvas.getContext(2d);//设置描边颜色为白色。context.strokeStyle white;//设置文本对齐方式为居中context.textAlign center;//设置字体为 24 像素的无衬线字体。context.font 24px sans-serif;//用于控制文本行高const lineHeight 30; loader 是一个自定义数据加载函数用于在需要时生成或获取瓦片数据。它的设计目的是为了处理动态生成的或特定格式的数据比如在运行时计算或从非标准源获取的数据。 new TileLayer({source: new DataTile({loader: function (z, x, y) {const half size / 2;//清除画布内容context.clearRect(0, 0, size, size);context.fillStyle rgba(100, 100, 100, 0.5);//填充整个画布context.fillRect(0, 0, size, size);context.fillStyle red;//绘制文字context.fillText(z: ${z}, half, half - lineHeight);context.fillText(x: ${x}, half, half);context.fillText(y: ${y}, half, half lineHeight);context.strokeRect(0, 0, size, size);//获取画布内容的像素数据const data context.getImageData(0, 0, size, size).data;// 转换为Uint8Array以提高浏览器兼容性return new Uint8Array(data.buffer);},//禁用不透明度过渡以避免在tile加载期间重叠标签transition: 0,}),}), 事实上很多源都提供loader参数方便我们把获取的数据或地图路径经过二次处理之后再加载到地图上。而具体返回什么样的数据格式取决于源本身所接受的数据格式。 完整代码 templatediv classboxh1Data Tiles自定义绘制DataTile源数据/h1div idmap/div/div /templatescript import DataTile from ol/source/DataTile.js; import Map from ol/Map.js; import TileLayer from ol/layer/WebGLTile.js; import View from ol/View.js; export default {name: ,components: {},data() {return {map: null,};},computed: {},created() {},mounted() {//256x256 像素是瓦片图层的常见尺寸const size 256;const canvas document.createElement(canvas);canvas.width size;canvas.height size;const context canvas.getContext(2d);//设置描边颜色为白色。context.strokeStyle white;//设置文本对齐方式为居中context.textAlign center;//设置字体为 24 像素的无衬线字体。context.font 24px sans-serif;//用于控制文本行高const lineHeight 30;const map new Map({target: map,layers: [new TileLayer({source: new DataTile({loader: function (z, x, y) {const half size / 2;//清除画布内容context.clearRect(0, 0, size, size);context.fillStyle rgba(100, 100, 100, 0.5);//填充整个画布context.fillRect(0, 0, size, size);context.fillStyle red;//绘制文字context.fillText(z: ${z}, half, half - lineHeight);context.fillText(x: ${x}, half, half);context.fillText(y: ${y}, half, half lineHeight);context.strokeRect(0, 0, size, size);//获取画布内容的像素数据const data context.getImageData(0, 0, size, size).data;// 转换为Uint8Array以提高浏览器兼容性return new Uint8Array(data.buffer);},//禁用不透明度过渡以避免在tile加载期间重叠标签transition: 0,}),}),],view: new View({center: [0, 0],zoom: 0,}),});},methods: {}, }; /scriptstyle langscss scoped #map {width: 100%;height: 500px; } .box {height: 100%; }#info {width: 100%;height: 24rem;overflow: scroll;display: flex;align-items: baseline;border: 1px solid black;justify-content: flex-start; } /style
http://www.w-s-a.com/news/599432/

相关文章:

  • 我要做个网站该怎么做怎么做电商平台网站
  • wordpress教程 网站标题莱芜大众网
  • 网站建设业务终止合作范本主机公园wordpress
  • 口碑好企业网站建设网站建设与什么专业有关
  • 助贷获客系统快速优化排名公司推荐
  • 重庆做网站优化推广的公司企业网站如何进行定位
  • 高密市赏旋网站设计有限公司山东广饶县建设局网站
  • 成都哪里有网站开发公司网业分离是什么
  • 购物导购网站开发女孩学建筑学好找工作吗
  • 做网站沈阳掌握夏邑进入公众号
  • 怎么做自动提卡网站谷歌推广怎么做
  • 大同网站建设熊掌号wordpress 首页单页
  • 青岛网站美工成都优秀网站建设
  • 聊城大型门户网站建设多版本wordpress
  • 建网站的公司 快云wordpress的搜索
  • 贷款网站模版东莞网站建设哪家专业
  • 做做网站已更新878网站正在建设中
  • dz旅游网站模板网站上做百度广告赚钱么
  • 青岛外贸假发网站建设seo优化名词解释
  • 四川建设厅网站施工员证查询网站建设行业政策
  • 网站全站出售dw怎么设计网页
  • 合肥网站建设方案服务网站建设推荐郑国华
  • 襄阳网站建设需要多少钱台州网站设计公司网站
  • 东莞专业拍摄做网站照片如何在百度上发布自己的广告
  • 网站建设费 科目做网站建设最好学什么
  • php商城网站建设多少钱深圳市建设
  • 有什么做糕点的视频网站黄岛做网站
  • 做视频课程网站建设一个普通网站需要多少钱
  • 专做化妆品的网站合肥做网站建设公司
  • 唐山企业网站网站建设费计入那个科目