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

家里的电脑怎样做网站赚钱wordpress 评论顶踩

家里的电脑怎样做网站赚钱,wordpress 评论顶踩,用c 做网站,办公软件官网demo地址: LineString Arrows 这篇介绍了在地图上绘制箭头。 创建一个矢量数据源,将其绑定为draw的数据源并展示在矢量图层上。 const source new VectorSource();const vector new VectorLayer({source: source,style: styleFunction,});map.ad…

官网demo地址:

LineString Arrows 

 这篇介绍了在地图上绘制箭头。

创建一个矢量数据源,将其绑定为draw的数据源并展示在矢量图层上。

  const source = new VectorSource();const vector = new VectorLayer({source: source,style: styleFunction,});map.addInteraction(new Draw({source: source,type: "LineString",}));

绘制直线时,通过style函数将直线的末端添加箭头图标。通过forEachSegment 函数拿到箭头的起点和终点坐标,使用 Math.atan2计算出箭头图标的旋转角度。 

const styleFunction = function (feature) {const geometry = feature.getGeometry();const styles = [new Style({stroke: new Stroke({color: "#ffcc33",width:2,}),}),];geometry.forEachSegment(function (start, end) {const dx = end[0] - start[0];const dy = end[1] - start[1];const rotation = Math.atan2(dy, dx);styles.push(new Style({geometry: new Point(end),image: new Icon({src: "https://openlayers.org/en/latest/examples/data/arrow.png",anchor: [0.75, 0.5],rotateWithView: true,rotation: -rotation,}),}));});return styles;};

完整代码:

<template><div class="box"><h1>LineString Arrows</h1><div id="map" class="map"></div></div>
</template><script>
import StadiaMaps from "ol/source/StadiaMaps.js";
import Draw from "ol/interaction/Draw.js";
import Map from "ol/Map.js";
import Point from "ol/geom/Point.js";
import View from "ol/View.js";
import { Icon, Stroke, Style } from "ol/style.js";
import { OSM, Vector as VectorSource } from "ol/source.js";
import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
import { get } from "ol/proj.js";
export default {name: "",components: {},data() {return {map: null,};},computed: {},created() {},mounted() {const layer = new TileLayer({source: new StadiaMaps({layer: "stamen_terrain_background",}),});const source = new VectorSource();const styleFunction = function (feature) {const geometry = feature.getGeometry();const styles = [new Style({stroke: new Stroke({color: "#ffcc33",width:2,}),}),];geometry.forEachSegment(function (start, end) {const dx = end[0] - start[0];const dy = end[1] - start[1];const rotation = Math.atan2(dy, dx);styles.push(new Style({geometry: new Point(end),image: new Icon({src: "https://openlayers.org/en/latest/examples/data/arrow.png",anchor: [0.75, 0.5],rotateWithView: true,rotation: -rotation,}),}));});return styles;};const vector = new VectorLayer({source: source,style: styleFunction,});const extent = get("EPSG:3857").getExtent().slice();extent[0] += extent[0];extent[2] += extent[2];const map = new Map({layers: [layer, vector],target: "map",view: new View({center: [-11000000, 4600000],zoom: 4,extent,}),});map.addInteraction(new Draw({source: source,type: "LineString",}));},methods: {},
};
</script><style lang="scss" scoped>
#map {width: 100%;height: 500px;
}
.box {height: 100%;
}</style>

 

http://www.yayakq.cn/news/875874/

相关文章:

  • category wordpress厦门seo收费
  • 网站换友链平台营销型网站建设一般多少钱
  • 佛山网站优化推广方案网页编辑器安卓
  • 人人做免费网站简单的电商网站
  • 广州站图片宁陵网站建设
  • 网站模板 带后台成品短视频app下载有哪些软件好
  • 金华公司建站模板WordPress文章怎么折叠
  • 网站个人和公司有什么区别是什么顺德搜索seo网络推广
  • 做网站seo的公司哪家好wordpress网址修改
  • html5自建网站网络改造实施方案
  • 做网站的网页设计用cdr吗电商网站话费充值怎么做
  • 泉州建站公司模板悦昂网站建设
  • 济南企业营销型网站建设html留言簿网站基本框架搭建
  • wordpress下载站会员系统dedecms 网站地图插件
  • 网站建设难吗网页开发入门
  • 佛山个人制作网站公司二级子域名查询
  • 网站规划步骤特色食品网站建设策划书
  • 网站开发四川vs做网站的书籍
  • 网页制作素材搜索途径有哪些杭州百度seo代理
  • 成都大型网站建设计算机网页设计培训
  • 做网站可以用电脑当服务器吗wordpress 太原
  • 直播网站建设中企业网站建设
  • 电商网站 费用开封旅游网站建设网页推广
  • 电脑店免费建站建立读音
  • 网站建设需求意见征求表网站设置兼容模式怎么弄
  • 没网站怎么做京东联盟长沙平台搭建公司
  • 酒泉网站建设平台如何制作自己的网页
  • 学了网站建设的心得体会安徽做网站公司哪家好一点
  • 佛山网站搭建公司哪家好dz论坛做视频网站教程
  • 网络公司给我做网站我有没有源代码版权吗?家用电脑做网站