• Openlayers为线要素添加文字标注


    似乎只能给点要素添加标注??

    1. 加载矢量点实现标注

    2. 使用重叠层实现标注

    参考:https://blog.csdn.net/qq_35732147/article/details/81771953(OpenLayers之标注功能二:图文标注)

    为marker添加标注:https://q.cnblogs.com/q/27959/

    openlayers给要素加文字注记:https://blog.csdn.net/u013594477/article/details/83584294

    openlayers文字标注 (九):https://blog.csdn.net/m0_37797410/article/details/106503770

    怎么给线标注呢?

    openlayers实现带箭头的线路polyline:https://zhuanlan.zhihu.com/p/336831271

    How to add style in polyline in openLayers?:https://stackoverflow.com/questions/64143861/how-to-add-style-in-polyline-in-openlayers

    How to add text to LineString in OpenLayers?

    Setting OpenLayers line labels by angle?:https://gis.stackexchange.com/questions/333475/setting-openlayers-line-labels-by-angle

    不知怎么滴,又可以了:

    方法一:

    text: new ol.style.Text({
                            font: '13px Microsoft YaHei',
                            text:  name,
                            textAlign:"left",
                            fill: new ol.style.Fill({
                                color: '#666'
                            }),
                            stroke: new ol.style.Stroke({
                              color: '#f2f',
                               1
                            })
                 })
    方法二:
                  // text: new ol.style.Text({
                  //   text:'aaaaa',
                  //   font: '14px Verdana',
                  //   fill: new ol.style.Fill({
                  //     color: '#000000'
                  //   }),
                  //   stroke: new ol.style.Stroke({
                  //     color: '#f2f',
                  //      1
                  //   })
                  // })
  • 相关阅读:
    STM32位带操作
    url参数 加密
    object.key 对象的键排序 可能出现的问题
    在vue项目中 获取容器的高度
    navigator 判断移动端是Android还是iOS
    Nginx下载地址
    Sublime Text3快捷键大全
    鼠标拖着元素飞
    g6 cavans
    vue img标签图片加载时 闪烁
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15602704.html
Copyright © 2020-2023  润新知