123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /**
- * @fileoverview 专题图 模块
- * @author Song.Huang
- * @version 1.0.0
- */
- define([
- 'html!templates/atlas/atlasList',
- 'modDir/service/regionSearch',
- 'css!styles/atlas/atlasList'
- ], function(tplLayout,regionSearchF) {
- /**
- * 模块数据 用于数据存储和外部调用
- * @type {Object}
- * 数据存放
- */
- var modValue = {
- options : {
- page: 1, //页数
- pageSize: 24, //每页条数
- searchType: 'byPage', //搜索类型
- searchKeyWord: '', //搜索关键字
- searchId: 0, //搜索ID
- theme: null, //分类
- region: '', //当前区域 0 全球
- area: ''
- },
- //查询数据集合
- thematicDataResult:null,
- //专题图分类
- thematicCategory:[]
- }
- /**
- * 状态值
- * @type {Boolean}
- * @default false
- * @private
- */
- var status = {
- initialized:false,
- showSideBar:false
- };
- var overLayerOpacityControl;
- /**
- * 初始化容器
- * @type {Function}
- */
- function init(idx) {
- //未初始化,初始化布局
- // if (idx == 0) {
- if (!status.initialized) {
- //设置容器布局
- setLayout();
- bindEvent();
-
- //订阅推送
- subscribe();
- status.initialized = true;
- }
- // ONEMAP.C.publisher.publish({
- // modName: 'map-library'
- // }, 'menuListClick');
- };
- /**
- * 初始化布局
- */
- function setLayout(){
- // $("#map-library").addClass("active");
- };
- /**
- * 窗口布局重置
- * @type {Function}
- */
- function layoutResize() {
- };
- /**
- * 界面事件绑定
- * @return {[type]} [description]
- */
- function bindEvent(){
- $("#map-library .im-1 .fu").on("click", function (){
- // ONEMAP.C.publisher.publish('handHide','layout::sideBar');
- var idx = $(this).parent().index() + 1;
- if(idx == 1){
- ONEMAP.D.user.searchType = 1;
- require(['modDir/atlas/atlasList'], function(atlasList) {
- atlasList.init(idx);
- status.showSideBar = true;
- });
- }
- else{
- ONEMAP.D.user.searchType = 2;
- require(['modDir/atlas/atlasList'], function(atlasList) {
- atlasList.init();
- require(['modDir/atlas/atlasCategory'], function(atlasCategory) {
- ONEMAP.C.publisher.publish('handShow','layout::sideBar');
- status.showSideBar = true;
- atlasCategory.init(idx);
- });
- });
- }
-
- })
- // 侧栏开关
- $("#map-library p").eq(0).on('click',function(){
- if(status.showSideBar){
- // $("#map-library").removeClass("active");
- ONEMAP.C.publisher.publish('handHide','layout::sideBar');
- status.showSideBar = false;
- }else{
- // $("#map-library").addClass("active");
- status.showSideBar = true;
- }
- })
- }
- /**
- * 注册监听
- * @type {Function}
- */
- function subscribe() {
- // ONEMAP.C.publisher.subscribe(removeCurrentOverLayer, 'cleanMap');
- };
-
- /**
- * 移除事件
- * @type {Function}
- */
- function remove() {
- }
- return ONEMAP.M.mapLibrary = {
- init: init
- };
- });
|