//point style
var myIcon = L.icon({
iconUrl: 'css/images/dian.svg',
// shadowUrl: 'css/images/leaf-shadow.png',
iconSize: [50, 50], // size of the icon
// shadowSize: [50, 64], // size of the shadow
iconAnchor: [10, 50], // point of the icon which will correspond to marker's location
// shadowAnchor: [4, 62], // the same for the shadow
// popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
//样式设定
var vectorTileStyling = {
//layer样式,line没有fill属性
gj:{//layername
weight: 1,
color: '#cf52d3',
opacity: 0.6
},
//使用自定义icon
// point:{//layername
//
// weight: 1,
// icon: myIcon//自定义icon
// },
//点
//方法一
point:{//layername
weight: 2,
color: 'red',
opacity: 1,
fillColor: 'yellow',
fill: true,
radius: 6,
fillOpacity: 0.7
},
//方法二
// point: function(properties, zoom) {
// return {
// weight: 2,
// color: 'red',
// opacity: 1,
// fillColor: 'yellow',
// fill: true,
// radius: 6,
// fillOpacity: 0.7
// }
// },
//线
line:{//layername
weight:1,
color: '#f2b648',//颜色
fillColor: 'red',
fillOpacity:0,//填充透明度
dashArray: '5' //设置虚线
},
//面
polygon:{//layername
weight: 1,//边线宽度
fillColor: '#53e033',//填充颜色
color: 'red',//边线颜色
fill: true,
fillOpacity: 0.2,//填充颜色透明度
opacity: 0.4,//边线颜色透明度
}
};
//vector tile pointpbflayer
var pointUrl = "http://127.0.0.1:8080/geoserver/gwc/service/tms/1.0.0/test:point@EPSG:4326@pbf/{z}/{x}/{-y}.pbf";
var pointVectorTileOptions = {
rendererFactory: L.canvas.tile,
vectorTileLayerStyles: vectorTileStyling,
interactive: true, // Make sure that this VectorGrid fires mouse/pointer events
getFeatureId: function(f) {
// console.log("getFeatureId:"+f.properties.ID);
return f.properties.ID;
}
};
}).addTo(map);

Leaflet使用vector tiles样式设置的更多相关文章

  1. Leaflet使用vector tiles 标注label设置

    JS //简单的标注 var marker = L.marker([ 31.2, 114.5 ], { // icon:myIcon }).addTo(map) // 设置label .bindToo ...

  2. js学习进阶-元素获取及样式设置

    var imgs = document.querySelectorAll("article img"); 获得article元素的直接或间接子孙的所有img元素, <arti ...

  3. placeholder的样式设置

    在input框中有时想将输入的字和placeholder设为不同的颜色或其它效果,这时就可以用以下代码来对placeholder进行样式设置了. ::-webkit-input-placeholder ...

  4. Asp.Net中应用Aspose.Cells输出报表到Excel 及样式设置

    解决思路: 1.找个可用的Aspose.Cells(有钱还是买个正版吧,谁开发个东西也不容易): 2.在.Net方案中引用此Cells: 3.写个函数ToExcel(传递一个DataTable),可以 ...

  5. 导出Excel之Epplus使用教程2(样式设置)

    导出Excel之Epplus使用教程1(基本介绍) 导出Excel之Epplus使用教程2(样式设置) 导出Excel之Epplus使用教程3(图表设置) 导出Excel之Epplus使用教程4(其他 ...

  6. PowerDesigner的样式设置

    原文:PowerDesigner的样式设置 PD提供了强大的配置功能,可以对生成的数据库对象命名.数据模型的展现进行设置.这里首先讲下样式的设置. 颜色和字体设置 1.单独设置某个对象的颜色和字体 1 ...

  7. POI Excel导出样式设置

    HSSFSheet sheet = workbook.createSheet("sheetName");    //创建sheet sheet.setVerticallyCente ...

  8. QListWidget与QTableWidget的使用以及样式设置

    QListWidget和QTableWidget的使用和属性,QTableWidget和QListWidget样式表的设置,滚动条的样式设置 一.QListWidget的使用 //一.QListWid ...

  9. HTML+CSS样式设置——CSS一学就会

    HTML+CSS样式设置 CSS:(Cascading Style Sheets)层叠样式设置表. 网页的展示效果跟其排版有非常大的关系.排版则主要依靠CSS来设置.调节. 以下说CSS与HTML的联 ...

随机推荐

  1. java中抽象类、接口及区别

    转自:http://www.cnblogs.com/dolphin0520/p/3811437.html 一.抽象类 在了解抽象类之前,先来了解一下抽象方法.抽象方法是一种特殊的方法:它只有声明,而没 ...

  2. (转)使用JMeter对秒杀示例进行性能测试

    背景 秒杀是我们ServiceComb开源团队以领域驱动设计(DDD)为背景,从零开始构建一个微服务架构的示例项目:在<秒杀开发历程>系列博文中提到它作为一个高并发压力场景的应用,采用了C ...

  3. python 正则sub的使用

     self.content = re.sub(r'>|<',lambda x: '&gt' if x.group()[0] == '>' else '&lt' , s ...

  4. 函数进阶装B操作

    三元表达式 条件成立时的返回值 if 条件 else 条件不成立时的返回值 x = 10 y = 20 print(f"x if x > y else y: {x if x > ...

  5. doT学习(三)之实战

    案例一: <html> <head> <script id="headertmpl" type="text/x-dot-template&q ...

  6. Eclipse创建Maven多模块工程Module开发(图文教程)

    自己研究了下Eclipse用Maven多模块工程Module开发,跟大家分享一下! 功能模块来分Module,跟java的package类似,一般是按照的功能模块分module,比如:sso/cas/ ...

  7. volatile关键字?MESI协议?指令重排?内存屏障?这都是啥玩意

    一.摘要 三级缓存,MESI缓存一致性协议,指令重排,内存屏障,JMM,volatile.单拿一个出来,想必大家对这些概念应该有一定了解.但是这些东西有什么必然的联系,或者他们之间究竟有什么前世今生想 ...

  8. 088、Docker 如何支持多种日志方案 (2019-05-10 周五)

    参考https://www.cnblogs.com/CloudMan6/p/7762369.html   将容器日志发送到 STDOUT 和 STDERR 是Docker 的默认日志行为.实际上,Do ...

  9. 087、日志管理之 Docker logs (2019-05-09)

    参考https://www.cnblogs.com/CloudMan6/p/7749304.html   高效的监控和日志管理对保持生产系统只需稳定的运行以及排查问题至关重要.   在微服务架构中,由 ...

  10. QItemDelegate edit某个控件后把数据写回model

    QWidget *TrackDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const ...