leaflet - 更改传单绘制中的顶点样式
问题描述
传单的画边太大太丑了,我想办法改变它的风格,我想出了以下代码:
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 的风格吗?
解决方案
我正在使用这个:
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',
}),
},
});
推荐阅读
- assembly - 你如何在nasm中启用a20?
- android - android确实迁移到房间需要卸载应用程序
- oracle - ALM Rest API - 列表中的最大表达式数为 1000
- html - 为什么在尝试将其移动到左侧时,导航栏项目会与徽标一起移动?
- python - 读取文件并检查文件中是否有数据。Python
- python - 重复的日志输出,但没有重复的处理程序
- sql - DB2 Crystal Reports 声明/设置变量
- java - 在 MongoDB 中存储多边形
- angular - 我想在迭代第四次运行后动态添加 DIV。此 DIV 将放置一个分页符
- c# - 为什么 Just My Code 会影响此条件语句