getGateshpData(typeName) {
return axios.get("/geoserver/图层地址", {
params: {
service: "WFS",
version: "1.0.0",
request: "GetFeature",
typeName, //图层类型名称
maxFeatures: "10000",
outputFormat: "application/json"
}
});
},
//被执行时调用此方法addshpfileLayer()
addshpfileLayer() {
this.getGateshpData("图层类型名称").then((response) => {
// console.log(response);
L.Icon.Default.imagePath = "./"; //如果图层中有点位信息,此处的点位icon默认可自定义为项目./(public)下的图片,图片名需要改为marker-icon.png
const that = this;
L.geoJSON(response.data, {
style: ()
关于 leafletjs 渲染图层,点击对应图层,触发事件,进行业务数据展示
最新推荐文章于 2024-05-14 00:00:00 发布
本文介绍了如何使用 LeafletJS 库在GIS应用中渲染图层,并详细阐述了当用户点击特定图层时,如何触发事件以展示相应的业务数据。通过结合JavaScript和GIS技术,实现地图交互功能。
摘要由CSDN通过智能技术生成