利用SQL查询出了想要的地物,现在想再添加功能:点击可获取部分信息以弹窗形式显现,该怎么添改代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>地图SQL查询</title>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" src="dist/include-leaflet.js"></script>
<script type="text/javascript">
var host = window.isLocal ? window.server : "http://127.0.0.1:8090";
var map, resultLayer,
url = host + "/iserver/services/map-tm15/rest/maps/tm15";
map = L.map('map', {
center: {lon: 119.51, lat: 30.35},
crs: L.CRS.EPSG4326,
zoom:11.2
});
L.supermap.tiledMapLayer(url).addTo(map);
query();
function query() {
var param = new SuperMap.QueryBySQLParameters({
queryParams: {
name: "林场古树名木_2@tm9",
attributeFilter: "SMID>0"
}
});
L.supermap
.queryService(url)
.queryBySQL(param, function (serviceResult) {
var result = serviceResult.result;
resultLayer = L.geoJSON(result.recordsets[0].features).addTo(map);
});
}
</script>
</body>
</html>