leaflet - 传单:绘制带有线条和箭头样式的 .gpx 路径
问题描述
我对传单有点陌生,但是我花了几个小时却无法解决这个问题:我想使用 gpx 文件作为源来绘制一条带箭头的线。这应该在可以显示或不使用覆盖的图层中。我设法设置箭头或线条的样式,但我没有设法同时设置样式。这是我的代码:谁能给我关于如何设计线条的建议?非常感谢。
var customLayer = L.geoJson(null, {onEachFeature: function (feature, layer) {
L.polylineDecorator(layer, {
patterns: [
{offset: 25, repeat: 15, symbol: L.Symbol.arrowHead({pixelSize: 10, pathOptions: {stroke: false, color: '#000', fillOpacity: 1, weight: 0}})}
]
}).addTo(customLayer); /// Adds each decorator to the map!!!!
}
}
);
var runLayer = omnivore.gpx('./FerneyGex.gpx', null, customLayer);
controlLayers2.addOverlay(runLayer, 'Ferney - Gex');
解决方案
推荐阅读
- ng-zorro-antd - 我必须使用 angular 5 的 Ng-zorro-mobile 版本
- xamarin - xamarin iOS ONLY Plugin.Geolocator 授权错误
- xcode - Xcode Archive 构建失败,反应原生项目
- ios - AKCallbackInstrument midiIn 和回调状态不起作用
- css - 使用自定义 CSS 格式化带有 Wordpress 主题的小部件
- java - 我必须坚持一张地图
> 与 JPA - c# - 重构 .net 核心 API 约定
- ios - NSLayoutConstraint 在 iOS 11 中已弃用的代码和底部布局指南中定义
- r - 按给定变量重新组织数据
- mysql - 无法查看 Azure 为 Azure Database for MySQL 创建的第一个备份