|
@@ -18,6 +18,7 @@ CityLandAction.prototype = {
|
|
|
this.obj.createTileLayer()
|
|
|
this.tempVectorLayer = this.loadTempVectorLayer()
|
|
|
this.drawMultiPolygon = new DrawMultiPolygon({vector: this.tempVectorLayer, map: this.context.currentMap,wkt: this.context.wkt})
|
|
|
+ this.selectStatusGroup = new SelectStatusGroup({vector: this.tempVectorLayer, cityLandAction : this})
|
|
|
|
|
|
this.popup = new Popup({map: this.context.currentMap,
|
|
|
close(){
|
|
@@ -49,6 +50,7 @@ CityLandAction.prototype = {
|
|
|
this.obj.addTileLayer(this.context.currentMap)
|
|
|
this.context.currentMap.addLayer(this.tempVectorLayer)
|
|
|
this.drawMultiPolygon.show()
|
|
|
+ this.selectStatusGroup.show()
|
|
|
this.context.landFilter()
|
|
|
this.context.getSldStyleSign(this.obj.wmsData.params.STYLE)
|
|
|
this.startStatus = true;
|
|
@@ -64,6 +66,7 @@ CityLandAction.prototype = {
|
|
|
this.obj.removeTileLayer(this.context.currentMap)
|
|
|
console.log("drawMultiPolygon close")
|
|
|
this.drawMultiPolygon.close()
|
|
|
+ this.selectStatusGroup.close()
|
|
|
console.log("tempVectorLayer cleared")
|
|
|
this.context.clicks[this.id] = null
|
|
|
console.log("remove click")
|
|
@@ -165,9 +168,11 @@ CityLandAction.prototype = {
|
|
|
return;
|
|
|
}
|
|
|
let typeNames = that.obj.getVisibleLayers()
|
|
|
+ let statusGroupString = that.selectStatusGroup.getStatusGroupString();
|
|
|
console.log("typeNames",typeNames)
|
|
|
+ console.log("statusGroup",statusGroupString)
|
|
|
const xhr = new XMLHttpRequest();
|
|
|
- xhr.open('GET', "/crop/getGeoJson?tableNames="+typeNames + "&x1=" + extent[0] + "&y1=" + extent[1]+"&x2=" + extent[2] + "&y2="+extent[3]);
|
|
|
+ xhr.open('GET', "/crop/getGeoJson?tableNames="+typeNames + "&x1=" + extent[0] + "&y1=" + extent[1]+"&x2=" + extent[2] + "&y2="+extent[3] + "&status="+statusGroupString);
|
|
|
const onError = function() {
|
|
|
vectorSource.removeLoadedExtent(extent);
|
|
|
failure();
|
|
@@ -278,7 +283,7 @@ function CityLand(opt){
|
|
|
this.layerData = {
|
|
|
layer : [],
|
|
|
source : [],
|
|
|
- always : false
|
|
|
+ always : true
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -396,8 +401,8 @@ function DrawMultiPolygon(option){
|
|
|
this.map = option.map
|
|
|
this.wkt = option.wkt
|
|
|
let that = this
|
|
|
- let html = "<a href='javascript:void(0)' id='drawMultiPolygon' style='color: white;position: absolute;top: 0px;right: 100px;z-index: 10' >绘制多边形</a>";
|
|
|
- $(document.body).append(html)
|
|
|
+ let html = "<div class='item'><a href='javascript:void(0)' id='drawMultiPolygon' class='yse-events' >绘制多边形</a></div>";
|
|
|
+ $("#menu-pop-list").append(html)
|
|
|
this.initDraw()
|
|
|
$("#drawMultiPolygon").on("click",function(){
|
|
|
that.vector.getSource().clear()
|
|
@@ -435,6 +440,55 @@ DrawMultiPolygon.prototype = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function SelectStatusGroup(option){
|
|
|
+ this.vector = option.vector
|
|
|
+ this.cityLandAction = option.cityLandAction
|
|
|
+ let that = this
|
|
|
+ this.statusGroup = [0,1,2,3]
|
|
|
+ let html = "<div class='item'><input type='checkbox' value='0' name='layerStatus' checked=''>未发布的</div>";
|
|
|
+ html += "<div class='item'><input type='checkbox' value='1' name='layerStatus' checked=''>已发布的</div>";
|
|
|
+ html += "<div class='item'><input type='checkbox' value='3' name='layerStatus' checked=''>已完成的</div>";
|
|
|
+ $("#menu-pop-list").append(html)
|
|
|
+ $("input[name='layerStatus']").on("click",function(item){
|
|
|
+ that.updateStatusGroup()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+SelectStatusGroup.prototype = {
|
|
|
+ updateStatusGroup(){
|
|
|
+ this.statusGroup = [2]
|
|
|
+ let objs = $("input[name='layerStatus']");
|
|
|
+ for(let obj of objs){
|
|
|
+ if(obj.checked){
|
|
|
+ this.statusGroup.push(obj.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.statusGroup.length == 1){
|
|
|
+ this.vector.setVisible(false)
|
|
|
+ }else{
|
|
|
+ this.vector.setVisible(true)
|
|
|
+ this.cityLandAction.context.landFilter(true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getStatusGroupString(){
|
|
|
+ let res = "";
|
|
|
+ for(let i=0;i<this.statusGroup.length;i++){
|
|
|
+ if(i != 0){
|
|
|
+ res+=","
|
|
|
+ }
|
|
|
+ res += this.statusGroup[i];
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ show(){
|
|
|
+ $("#menu-pop-list").show()
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ $("#menu-pop-list").hide()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|