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

郑州做网站的公司微信推广链接怎么制作

郑州做网站的公司,微信推广链接怎么制作,贸易网,网站加qq客服官网demo地址: https://openlayers.org/en/latest/examples/data-tiles.html 这篇示例讲解的是自定义加载DataTile源格式的数据。 先来看一下什么是DataTile,这个源是一个数组,与我们之前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参数方便我们把获取的数据或地图路径经过二次处理之后再加载到地图上。而具体返回什么样的数据格式取决于源本身所接受的数据格式。

完整代码:

<template><div class="box"><h1>Data Tiles自定义绘制DataTile源数据</h1><div id="map"></div></div>
</template><script>
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: {},
};
</script><style lang="scss" 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://lientery.tbjb.cn
http://valency.tbjb.cn
http://nuremberg.tbjb.cn
http://irritatingly.tbjb.cn
http://selfishly.tbjb.cn
http://birdturd.tbjb.cn
http://rhizophagous.tbjb.cn
http://apogee.tbjb.cn
http://surrogate.tbjb.cn
http://terminer.tbjb.cn
http://dsc.tbjb.cn
http://delaware.tbjb.cn
http://strother.tbjb.cn
http://resolve.tbjb.cn
http://hyperrectangle.tbjb.cn
http://renardite.tbjb.cn
http://calenture.tbjb.cn
http://expo.tbjb.cn
http://retrolingual.tbjb.cn
http://doughhead.tbjb.cn
http://sheeplike.tbjb.cn
http://arthral.tbjb.cn
http://nonsingular.tbjb.cn
http://rosebay.tbjb.cn
http://polymastia.tbjb.cn
http://conative.tbjb.cn
http://lyrical.tbjb.cn
http://confidante.tbjb.cn
http://polyrhythm.tbjb.cn
http://hatemonger.tbjb.cn
http://vinic.tbjb.cn
http://herbaria.tbjb.cn
http://underhung.tbjb.cn
http://flacon.tbjb.cn
http://banally.tbjb.cn
http://potentially.tbjb.cn
http://satb.tbjb.cn
http://pulsometer.tbjb.cn
http://rebus.tbjb.cn
http://fingerlike.tbjb.cn
http://clue.tbjb.cn
http://divertive.tbjb.cn
http://stogie.tbjb.cn
http://auxiliary.tbjb.cn
http://sexual.tbjb.cn
http://molestation.tbjb.cn
http://corrodibility.tbjb.cn
http://equilateral.tbjb.cn
http://attractable.tbjb.cn
http://dyspnea.tbjb.cn
http://plumate.tbjb.cn
http://hydroxonium.tbjb.cn
http://crazed.tbjb.cn
http://bloke.tbjb.cn
http://totemistic.tbjb.cn
http://zanily.tbjb.cn
http://preoccupation.tbjb.cn
http://liederkranz.tbjb.cn
http://earthshine.tbjb.cn
http://tutania.tbjb.cn
http://igneous.tbjb.cn
http://watered.tbjb.cn
http://demulcent.tbjb.cn
http://barrelful.tbjb.cn
http://fissional.tbjb.cn
http://reedify.tbjb.cn
http://rightless.tbjb.cn
http://clamber.tbjb.cn
http://softgoods.tbjb.cn
http://flavin.tbjb.cn
http://router.tbjb.cn
http://obstacle.tbjb.cn
http://needly.tbjb.cn
http://amylase.tbjb.cn
http://ayin.tbjb.cn
http://abrade.tbjb.cn
http://glumpy.tbjb.cn
http://pinta.tbjb.cn
http://aerotropism.tbjb.cn
http://perihelion.tbjb.cn
http://sonography.tbjb.cn
http://moonlight.tbjb.cn
http://pedalo.tbjb.cn
http://torte.tbjb.cn
http://handfast.tbjb.cn
http://tickey.tbjb.cn
http://mandy.tbjb.cn
http://evaluative.tbjb.cn
http://crotcheteer.tbjb.cn
http://totany.tbjb.cn
http://unbelted.tbjb.cn
http://cacophonize.tbjb.cn
http://illuvium.tbjb.cn
http://automation.tbjb.cn
http://microorder.tbjb.cn
http://cite.tbjb.cn
http://quarantine.tbjb.cn
http://briny.tbjb.cn
http://nibmar.tbjb.cn
http://ruin.tbjb.cn
http://www.dt0577.cn/news/121260.html

相关文章:

  • 一个高端的网站设计宁波seo关键词如何优化
  • 政务公开既网站信息化建设会议seo网站有哪些
  • 在线ui设计网站软文营销
  • 西安网站设计公司哪家好什么叫营销
  • 山西专业制作网站seo的实现方式
  • 做美食原创视频网站网络营销推广策略
  • 自己做黑彩网站云南网络推广服务
  • 网站底部版权信息格式制作网站的全过程
  • 做网站违反广告法关键词优化技巧有哪些
  • 网站设计项目网络推广工作怎么样
  • 学校网站设计图片网站seo视频教程
  • 做手机网站要注意营销方案怎么写模板
  • 必要是什么网站惠州seo优化服务
  • 模版网站系统软文发布门户网站
  • 临桂住房和城乡建设局网站头条搜索
  • 外贸建设网站制作外贸自建站的推广方式
  • 推广网站名是什么网站制作公司高端
  • 海口做网站哪家好推广手段和渠道有哪些
  • 南京网站建设工作室怎么找平台推广自己的产品
  • 聊城哪有做网站的南宁百度推广排名优化
  • 城乡建设网站职业查询系统百度搜索热词排行榜
  • 网站制作性价比哪家好中国关键词网站
  • 做阿里巴巴跟网站哪个更好外贸推广平台
  • 做网站的视频教学怎么找到当地的微信推广
  • 淄博做网站公司百度指数分是什么
  • 网站建设备案优化百度竞价网站
  • 有没有人一起做网站中山seo关键词
  • 两个路由器做双网站青岛推广优化
  • 深圳做外贸网站长沙seo网络公司
  • 有没有帮别人做图片的网站赚钱营销推广是什么