| | |
| | | |
| | | //删除电子围栏点击事件 |
| | | $(".mapBtn .delBtn").click(function() { |
| | | if (!that.isEngineer) { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('请先新增电子围栏信息!') |
| | | }) |
| | | return; |
| | | } |
| | | //需选中电子围栏,然后进行删除 |
| | | layer.confirm('是否确认删除', { |
| | | btn: ['确定', '取消'], //按钮 |
| | |
| | | //判断 |
| | | if (that.isEngineer) { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('已存在电子围栏'); |
| | | }) |
| | | layui.layer.msg('已存在电子围栏'); |
| | | }) |
| | | //新增按钮颜色改回 |
| | | $("#insertEngineeringMap").css("color", "#757575"); |
| | | } else { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('请开始划分电子围栏'); |
| | |
| | | |
| | | //编辑电子围栏 |
| | | $('.mapBtn .editBtn').click(function() { |
| | | if (!that.isEngineer) { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('请先新增电子围栏信息!') |
| | | }) |
| | | return; |
| | | } |
| | | $("#editEngineeringMap").css("color", "#3385FF"); |
| | | //修改为可编辑状态 |
| | | that.isEdit = true; |
| | |
| | | success: function(result) { |
| | | if (result.code == 200) { |
| | | layui.use('layer', function() { |
| | | layui.layer.msg('新增电子围栏成功!') |
| | | }) |
| | | layui.layer.msg('新增电子围栏成功!') |
| | | }) |
| | | //清除点信息 |
| | | that.polygonData = []; |
| | | //新增按钮颜色改回 |
| | | $("#insertEngineeringMap").css("color", "#757575"); |
| | | } |
| | | } |
| | | }) |
| | |
| | | layui.layer.msg('电子围栏修改成功!'); |
| | | }) |
| | | $("#editEngineeringMap").css("color", "#757575"); |
| | | $("#securityMapTips4").css("display", "none"); |
| | | self.isEdit = false; |
| | | self.editToolbarStatus = false; |
| | | } |
| | |
| | | var tool = 0; |
| | | |
| | | this.editToolbar = new Edit(this._map); |
| | | |
| | | |
| | | // if (registry.byId("tool_move").checked) { |
| | | tool = tool | Edit.MOVE; |
| | |
| | | |
| | | //在地图上新增点 |
| | | addPoint: function(entitys, lgtd, lttd, img) { |
| | | var symbol = new esri.symbol.PictureMarkerSymbol(img, 22, 22); |
| | | if (img == undefined) { |
| | | var symbol = new esri.symbol.PictureMarkerSymbol('./images/point.png', 22, 22); |
| | | } else { |
| | | var symbol = new esri.symbol.PictureMarkerSymbol(img, 22, 22); |
| | | } |
| | | var pt = new Point(lgtd, lttd, new SpatialReference({ |
| | | wkid: 4326 |
| | | })); |
| | |
| | | entitys.add(graphic); |
| | | }, |
| | | |
| | | |
| | | //绘制多边形 |
| | | addPolygon: function(entitys, rings) { |
| | | entitys.clear(); |