1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- define(function(){
- /**
- * 状态值
- * @type {Boolean}
- * @default false
- * @private
- */
- var status = {
- initialized:false,//是否初始化
- veiwHeightType:null
- };
- /**
- * 模块数据 用于数据存储和外部调用
- * @type {Object}
- * 数据存放
- */
- var modValue = {
-
- };
- /**
- * 三维高度测量初始化
- */
- function init(){
- if(!status.initialized){
- subscribe();
- status.initialized = true;
- }
- ONEMAP.C.publisher.publish({
- modName: 'toolLDZZ'
- }, 'tools:active');
- };
- /**
- * 注册监听事件
- */
- function subscribe(){
- ONEMAP.C.publisher.subscribe(remove, 'change23D');
- ONEMAP.C.publisher.subscribe(remove,'tools:active');
- };
- /**
- * 通视分析加载或移除
- */
- function remove(options){
- if(options.modName != 'toolLDZZ'){
- $(".tools-LDZZ").removeClass('cur');
- //removetoolLDZZ();
- }else{
- if($(".tools-LDZZ").hasClass('cur')){
- $(".tools-LDZZ").removeClass('cur');
- removetoolLDZZ();
- }else{
- $(".tools-LDZZ").addClass('cur');
- addtoolLDZZ();
- }
- }
- }
- /**
- *移除通视分析
- */
- function removetoolLDZZ(){
- locaSpaceMap.Globe.Action = 0; //使鼠标动作返回普通浏览状态
- locaSpaceMap.Refresh();
- $('#coverHeightLDZZ').hide();
- };
- /**
- * 加载通视分析
- */
- function addtoolLDZZ(){
- $('#coverHeightLDZZ').show();
- $('#coverHeightLDZZ .cancel').unbind('click').bind('click',function(){
- $('#coverHeightLDZZ').hide();
- $(".tools-LDZZ").removeClass('cur');
- removetoolLDZZ();
- });
- $('#coverHeightLDZZ .sure').unbind('click').bind('click',function(){
- var height = parseInt($('#coverHeightLDZZ .input').val());
- if(height>0 && height<1000){
- $('#coverHeightLDZZ').hide();
- locaSpaceMap.Globe.CenterHeightOfViewEnvelopeAnalysis = height;
- locaSpaceMap.Globe.Action=14;
- locaSpaceMap.Refresh();
- $(".tools-LDZZ").removeClass('cur');
- }else {
- alert('请输入大于0小于1000的高度值');
- }
- });
- };
- return ONEMAP.M.toolTSFX = {
- init:init
- }
- })
|