【问题标题】:Change vertex style in leaflet draw更改传单绘制中的顶点样式
【发布时间】:2018-04-27 13:26:33
【问题描述】:

传单的画边太大太丑,我想办法改变它的样式,我想出了以下代码:

 draw: {
        polyline: {
            shapeOptions: this.onSelectionStyle
        },
        polygon: {
            icon: new L.DivIcon({
                iconSize: new L.Point(16, 16),
                className: 'leaflet-div-icon leaflet-editing-icon my-own-icon'
            }),
            allowIntersection: false, // Restricts shapes to simple polygons
            drawError: {
                color: '#e1e100', // Color the shape will turn when intersects
                message: '<strong>Oh snap!<strong> you can\'t draw that!' // Message that will show when intersect
            },
            shapeOptions: this.onSelectionStyle,
            showArea: true
        },
        ...

基本上 className 应该这样做,但这似乎至少不适用于最新版本。你知道如何改变 eges 的风格吗?

【问题讨论】:

  • 我是新来的传单并且遇到了同样的问题,所以我想知道你是否得到了答案,你能帮我吗?

标签: leaflet leaflet.draw


【解决方案1】:

我正在使用这个:

L.Edit.Poly = L.Edit.Poly.extend({
  options: {
    icon: new L.DivIcon({
      iconSize: new L.Point(10, 10),
      className: 'leaflet-div-icon leaflet-editing-icon my-own-icon',
    }),
  },
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 2020-07-15
    • 2021-05-13
    相关资源
    最近更新 更多