| | |
| | | |
| | | }, |
| | | beginLayuiDropdown: function (data) { |
| | | var that = this; |
| | | var d = []; |
| | | for (var k in data) { |
| | | d.push({ |
| | | var obj = { |
| | | title: data[k].name, |
| | | id: data[k].id |
| | | }) |
| | | id: data[k].id, |
| | | } |
| | | if (data[k].seviceUrl) { |
| | | obj.src = data[k].seviceUrl |
| | | } |
| | | d.push(obj) |
| | | |
| | | |
| | | } |
| | | layui.use(['dropdown', 'util', 'layer', 'table'], function () { |
| | | var dropdown = layui.dropdown |
| | |
| | | //点击事件 |
| | | // layer.tips('点击了:' + obj.title, this.elem, { tips: [1, '#5FB878'] }) |
| | | var str = obj.title; |
| | | |
| | | $('.jimu-widget-instructions').find('.instructions-title').empty().append(str); |
| | | |
| | | if (that[obj.id]) { |
| | | that.map.imageryLayers.remove(that[obj.id]); |
| | | } |
| | | |
| | | if (obj.src) { |
| | | $.ajax({ |
| | | url: res.data[i].seviceUrl + '/maps.json', |
| | | type: 'get', |
| | | dataType: 'JSON', |
| | | success: function (result) { |
| | | console.log(res.data[i]) |
| | | |
| | | |
| | | that[res.data[i].id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({ |
| | | url: result[0].path, |
| | | })); |
| | | that[res.data[i].id].alpha = 1 |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | |
| | | layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){ |
| | | //得到各种内置组件 |
| | | var layer = layui.layer //弹层 |
| | | // layer.msg('请先填写关键字', { icon: 1, time: 1000, shift: 6 }); |
| | | layer.tips('暂无该服务', '.jimu-widget-instructions', { |
| | | tips: [2, '#FF5722'] |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | }); |
| | | }); |
| | |
| | | } |
| | | } else { |
| | | if (that.searchDatas[0] && that.searchDatas[1]) { |
| | | that.map.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(Number(lng), Number(lat), Number(gaodu)) |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(that.searchDatas[0]), Number(that.searchDatas[1]), Number(8000)) |
| | | |
| | | }); |
| | | } else { |
| | | layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){ |
| | | //得到各种内置组件 |