let getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({ queryParameter: new SuperMap.FilterParameter({ name: "唐山市区图", attributeFilter: "SMID > 0" }), toIndex: 500, datasetNames: ["唐山县级:唐山县级"] });
您好,这个name是查询参数对象的名字,不影响查询给什么看您业务,并且该属性可写可不写非必填项,不影响查询结果。
您可以通过下面两个示例测试和修改尝试name及其他参数的使用。
https://iclient.supermap.io/examples/leaflet/editor.html#02_getFeatureBySQL
https://iclient.supermap.io/examples/leaflet/editor.html#02_getFeatureByGeometry
希望可以帮助到您。
刚查询了
<template> <div id="map" class="map"> <shiliangmap /> </div> </template> <script> import shiliangmap from "../common/shiliangmap.vue"; export default { components: { shiliangmap }, name: "HelloWebgisLiangAnalysis", data() { return {}; }, mounted() { this.init(); }, methods: { init() { const dataUrl = "http://localhost:8090/iserver/services/data-tangshan/rest/data"; const newmap = this.$store.getters._getDefaultshiliangmap; let themeLayer = new L.supermap.RangeThemeLayer("ThemeLayer", { // 开启 hover 高亮效果 isHoverAble: true, opacity: 0.8, alwaysMapCRS: true }).addTo(newmap); themeLayer.style = new L.supermap.ThemeStyle({ shadowBlur: 16, shadowColor: "#000000", fillColor: "#FFFFFF" }); // hover 高亮样式 themeLayer.highlightStyle = new L.supermap.ThemeStyle({ stroke: true, strokeWidth: 4, strokeColor: "blue", fillColor: "#00EEEE", fillOpacity: 0.8 }); // 用于单值专题图的属性字段名称 themeLayer.themeField = "Join_Count"; // 风格数组,设定值对应的样式 themeLayer.styleGroups = [ { start: 0, end: 16, style: { color: "#FDE2CA" } }, { start: 16, end: 53, style: { color: "#FACE9C" } }, { start: 53, end: 131, style: { color: "#F09C42" } }, { start: 131, end: 534, style: { color: "#D0770B" } }, { start: 534, end: 1201, style: { color: "#945305" } } ]; let getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({ queryParameter: new SuperMap.FilterParameter({ name: "唐山市区图", attributeFilter: "SMID > -1" }), toIndex: 500, datasetNames: ["唐山县级:唐山县级"] }); //数据预处理并添加到专题图图层 L.supermap.featureService(dataUrl).getFeaturesBySQL( getFeatureBySQLParams, serviceResult => { let result = serviceResult.result; themeLayer.addFeatures(result.features); }, SuperMap.DataFormat.ISERVER ); } } }; </script> <style> .map { height: 100%; width: 100%; } </style>
也挺正常的但还是加载不出来,您能帮忙看看吗
这边不了解您的数据情况,没法判断您的业务参数给的对不对,前端开发建议您控制输出和断点,
对照demo或api先定位找一下您出现问题地方具体是哪里才好帮您解决。
leaflet的话:
https://iclient.supermap.io/examples/leaflet/editor.html#rangeThemeLayer