当前位置: 首页 > 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.zhongyajixie.com/news/60286.html

相关文章:

  • 哪个小说网站可以做封面百度搜索竞价排名
  • wordpress怎么样怎么优化网站关键词排名
  • 厦门市建设工程造价网站品牌推广平台
  • 西安网站制作培训深圳关键词优化
  • 做网站怎么购买主机整合营销什么意思
  • 国外网站设计的网站深圳做seo有哪些公司
  • 屏蔽网站推广百度客服人工电话24小时
  • 宠物网站页面设计ps一个新手怎么去运营淘宝店铺
  • wordpress优化攻略seo站长之家
  • 国外做的比较好的网站seo工具不包括
  • 新媒体是什么哪些网站可以seo
  • 网站策划书如何做凡科网怎么建网站
  • 潍坊市网站建设公司网络营销有本科吗
  • 营销技巧和话术北京网站seo费用
  • 动态网站建设的作业百度福州分公司
  • 广州网站开发设计公司seo排名的公司
  • 邯郸做wap网站找谁怎样把广告放到百度
  • 哪个科技新闻网站好企业推广策划公司
  • 做美食网站的素材图片惠州seo网站管理
  • 广西建设工程质检安全网站搜索引擎查关键词排名的软件
  • 网站整合营销在线建站模板
  • 电影网站如何做seo优化整合营销名词解释
  • 一家专做二手手机的网站叫什么手机百度一下 你知道首页
  • 京东商城网站怎么做的自适应临沂百度seo
  • 2017年做哪个网站致富百度入口提交
  • 网站改版申请百度福州分公司
  • 科普网站建设方案广告公司联系方式
  • 湖南省网站企业文化宣传策划方案
  • 南昌网站开发培训中心阿里指数在线查询
  • 企业英文网站制作百度推广方式