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

做彩票网站是违法的吗百度代理

做彩票网站是违法的吗,百度代理,怎么做国际网站,公司网站的建设内容怎么写这篇讲的是使用Draw绘制图形时根据绘制形状设置不同颜色。 根据下拉框中的值在styles对象中取对应的颜色对象,new Draw的时候将其设置为style参数。 const styles {Point: {"circle-radius": 5,"circle-fill-color": "red",},LineS…

这篇讲的是使用Draw绘制图形时根据绘制形状设置不同颜色。

根据下拉框中的值在styles对象中取对应的颜色对象,new Draw的时候将其设置为style参数。

 const styles = {Point: {"circle-radius": 5,"circle-fill-color": "red",},LineString: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "yellow","stroke-width": 2,},Polygon: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "yellow","stroke-width": 2,"fill-color": "blue",},Circle: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "blue","stroke-width": 2,"fill-color": "yellow",},};const typeSelect = document.getElementById("type");let draw; function addInteraction() {const value = typeSelect.value;if (value !== "None") {draw = new Draw({source: source,type: typeSelect.value,style: styles[value],});map.addInteraction(draw);}}

 需要注意的是这个style是绘制过程中的颜色,如果需要设置绘制完成后的颜色还得在图层中设置

  const source = new VectorSource({ wrapX: false });const vector = new VectorLayer({source: source,style:style});

 完整代码:

<template><div class="box"><h1>Drawing Features Style绘制不同颜色的图形</h1><div id="map"></div><div class="row"><div class="col-auto"><span class="input-group"><label class="input-group-text" for="type">Geometry type:</label><select class="form-select" id="type"><option value="Point">Point</option><option value="LineString">LineString</option><option value="Polygon">Polygon</option><option value="Circle">Circle</option><option value="None">None</option></select></span></div></div></div>
</template><script>
import Draw from "ol/interaction/Draw.js";
import Map from "ol/Map.js";
import View from "ol/View.js";
import { OSM, Vector as VectorSource } from "ol/source.js";
import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
export default {name: "",components: {},data() {return {map: null,};},computed: {},created() {},mounted() {const raster = new TileLayer({source: new OSM(),});const source = new VectorSource({ wrapX: false });const vector = new VectorLayer({source: source,});const map = new Map({layers: [raster, vector],target: "map",view: new View({center: [-11000000, 4600000],zoom: 4,}),});const styles = {Point: {"circle-radius": 5,"circle-fill-color": "red",},LineString: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "yellow","stroke-width": 2,},Polygon: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "yellow","stroke-width": 2,"fill-color": "blue",},Circle: {"circle-radius": 5,"circle-fill-color": "red","stroke-color": "blue","stroke-width": 2,"fill-color": "yellow",},};const typeSelect = document.getElementById("type");let draw; function addInteraction() {const value = typeSelect.value;if (value !== "None") {draw = new Draw({source: source,type: typeSelect.value,style: styles[value],});map.addInteraction(draw);}}typeSelect.onchange = function () {map.removeInteraction(draw);addInteraction();};addInteraction();},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://www.tj-hxxt.cn/news/62728.html

相关文章:

  • 厚街网站建设报价媒体软文推广平台
  • 常州做网站软件常德seo快速排名
  • 网站设计方案公司优化站点
  • 咋么做网站在电脑上泰安seo排名
  • 电子商务网站建设的要素b站推广软件
  • 网站如何添加qq客服下载百度app并安装
  • 阳江招聘网最新招聘找工作免费seo视频教程
  • 网站案例库域名注册局
  • 做网站最好用的软件百度网址查询
  • 镇江网站建设策划搜索量查询百度指数
  • 易语言如何做网站seo方法图片
  • 列出网站开发建设的步骤关键词首页排名优化平台
  • 做网站的空间厦门网站制作全程服务
  • 怎么做正规网站太原seo排名公司
  • 襄阳作风建设年活动网站掌门一对一辅导官网
  • 建站网站平台网站seo搜索引擎优化教程
  • 沈阳网站搜索排名seo自动优化软件
  • 商业网站建设知识点怎么自己做网页
  • 找别人做网站交货时应该注意什么营销推广有哪些形式
  • 鄂州网站制作人才招聘西安seo阳建
  • 做网站前端的软件企业推广策划公司
  • 深圳市公安局官网广西壮族自治区在线seo关键词排名优化
  • wordpress后台登陆界面seo排名优化公司哪家好
  • 承德网站制作多少钱google下载
  • 中兴豫建设管理有限公司网站发外链平台
  • 公司网站建设应注意什么市场营销策划ppt
  • 如何做网校网站国家高新技术企业名单
  • 有没有做线播放网站百度快照投诉中心官网
  • 网站建设推广优化互联网登录的网站名
  • 如何创立自己的网址广州网站优化步骤