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

郑州市做网站公司a汉狮做网站镜像

郑州市做网站公司a汉狮,做网站镜像,百度账户托管,最低成本做企业网站这篇讲的是使用Draw绘制图形时根据绘制形状设置不同颜色。 根据下拉框中的值在styles对象中取对应的颜色对象#xff0c;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}); 完整代码 templatediv classboxh1Drawing Features Style绘制不同颜色的图形/h1div idmap/divdiv classrowdiv classcol-autospan classinput-grouplabel classinput-group-text fortypeGeometry type:/labelselect classform-select idtypeoption valuePointPoint/optionoption valueLineStringLineString/optionoption valuePolygonPolygon/optionoption valueCircleCircle/optionoption valueNoneNone/option/select/span/div/div/div /templatescript 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: {}, }; /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.hkea.cn/news/14587494/

相关文章:

  • 青岛市城市建设投标网站深圳专业网站设计公司
  • 网站开发需要2个月吗国内大型餐饮网站建设
  • 做程序教程网站赚钱吗WordPress手机网页登录代码
  • 公司网站可以用个人备案吗搜索引擎网络推广公司上海
  • 学做电商那个网站好ps个人网站制作流程
  • 学校网站建设工作如何做网站管理
  • 肇庆做网站哪家好两学一做专题教育网站
  • 网站空间费1年1200公司网站开发策略和基本步骤
  • 百度网站评级关于网站运营的问题
  • 建立一个商城网站上海专业的网站建设
  • 如何建设好高校网站长治网上制作网站
  • 学校做网站有些什么好处婚庆公司收费价格表
  • 网站建设开发软件有哪些方面公司宣传片如何制作
  • 网站建设是设计师吗给平面设计素材网站做素材挣钱吗
  • 苏州老字号企业官方的网站策划书电子产品网站建设策划书
  • 揭阳网站建设antnw用静态网站更新
  • 网站改版对seo的影响学校网站模板wordpress
  • 工业信息部网站备案南宁网络推广平台
  • 网站关键词数量多少好佳木斯建网站的
  • 网站建设基础教学设计html搜索框代码
  • 免费广告推广网站网站如何做快捷支付接口
  • 网站模板 餐饮艺梵科技 网站建设
  • 濮阳公司建站一级域名和二级域名
  • 做网站都需要什么金融门户网站模版
  • 自建网站优缺点小升初最好的补课机构排行榜
  • 花都个性设计商城网站建设房地产行业网站
  • 云南做公司网站多少钱南山网站建设哪家效益快
  • 南阳建网站企业做网站一般注册商标哪个类
  • 网站建设和app哪个好免费网站建设是什么
  • 卖网站链接上海市建设市场服务平台官网