123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- /**
- * [ONEMAP.M.gcmsEvents]
- * @return {[object]}
- */
- define(function(){
- //显示详情
- function showDetail(articleId){
- require(['modDir/gcms/gcmsDetail'],function(gcmsDetail){
- gcmsDetail.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'] || '图层',
- article_id:articleId
- });
- });
- }
- //自定义详情
- function showDetailDiy(articleId,column){
- $.ajax({
- url: onemapUrlConfig.gcmsServiceUrl+'/show/'+column,
- type:"GET",
- dataType:"json"
- })
- .done(function(data){
- // console.log(data)
- var li_html = data.data[0].list_html;
- var qian = li_html.split("(")[0];
- var hou = li_html.split(")")[1];
- var xin = qian+"("+articleId+")"+hou;
- // console.log(xin);
- ONEMAP.D.gcmsCurColumnData = {};
- ONEMAP.D.gcmsCurColumnData['name'] = column;
- li_html = xin;
- $(li_html).click();
- })
- }
- //绘制点
- function showDrawPoint(articleId,fieldName){
- require(['modDir/gcms/gcmsDrawPoint'],function(gcmsDrawPoint){
- gcmsDrawPoint.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //绘制面
- function showDrawPolyline(articleId,fieldName){
- require(['modDir/gcms/gcmsDrawPolyline'],function(gcmsDrawPolyline){
- gcmsDrawPolyline.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //绘制线
- function showDrawPolygon(articleId,fieldName){
- require(['modDir/gcms/gcmsDrawPolygon'],function(gcmsDrawPolygon){
- gcmsDrawPolygon.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示轨迹
- function showTrajectory(articleId,fieldName,showMarker,type){
- require(['modDir/gcms/gcmsTrajectory'],function(gcmsTrajectory){
- gcmsTrajectory.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- showMarker:showMarker,
- type:type
- });
- });
- };
- //多选
- function showMultipleCheck(articleId,fieldName){
- require(['modDir/gcms/gcmsMultipleCheck'],function(gcmsMultipleCheck){
- gcmsMultipleCheck.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //布尔值
- function showBoolean(articleId,fieldName){
- require(['modDir/gcms/gcmsBoolean'],function(gcmsBoolean){
- gcmsBoolean.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示简单点
- function showSimplePoint(articleId,fieldName,type){
- require(['modDir/gcms/gcmsPoint'],function(gcmsPoint){
- gcmsPoint.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- type:type
- });
- });
- }
- //显示简单线
- function showSimplePolyline(articleId,fieldName,type){
- require(['modDir/gcms/gcmsPolyline'],function(Polyline){
- Polyline.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- type:type
- });
- });
- }
- //显示简单面
- function showSimplePolygon(articleId,fieldName,type){
- require(['modDir/gcms/gcmsPolygon'],function(Polygon){
- Polygon.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- type:type
- });
- });
- }
- //显示带坐标的视频
- function showPointVideo(articleId,fieldName){
- require(['modDir/gcms/gcmsPointAVideo'],function(gcmsPointAVideo){
- gcmsPointAVideo.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示带坐标的音频
- function showPointAudio(articleId,fieldName){
- require(['modDir/gcms/gcmsPointAAudio'],function(gcmsPointAAudio){
- gcmsPointAAudio.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示带坐标的图片
- function showPointPicture(articleId,fieldName){
- require(['modDir/gcms/gcmsPointAPicture'],function(gcmsPointAPicture){
- gcmsPointAPicture.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- });
- });
- }
- //显示地图中心点
- function showMapCenter(lat,lng,zoom,style){
- require(['modDir/gcms/gcmsMapCenter'],function(gcmsMapCenter){
- gcmsMapCenter.init({
- data:{
- lat:lat,
- lng:lng,
- zoom:zoom,
- style:style
- }
- });
- });
- }
- //下载
- function showFiles(articleId,fieldName){
- require(['modDir/gcms/gcmsFiles'],function(gcmsFiles){
- gcmsFiles.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示问卷
- function showQuestionnaire(articleId,fieldName){
- require(['modDir/gcms/gcmsQuestionnaire'],function(gcmsQuestionnaire){
- gcmsQuestionnaire.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示标注
- function showMapDraw(articleId,fieldName){
- require(['modDir/gcms/gcmsMapDraw'],function(gcmsMapDraw){
- gcmsMapDraw.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示地图标记
- function showMapMarker(articleId,fieldName){
- require(['modDir/gcms/gcmsMapMarker'],function(gcmsMapMarker){
- gcmsMapMarker.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示图片
- function showPicture(articleId,fieldName,name,creater,phone_num,ext){
- require(['modDir/gcms/gcmsPicture'],function(gcmsPicture){
- gcmsPicture.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- name:name,
- creater:creater,
- phone_num:phone_num,
- ext:ext
- });
- });
- }
- //显示图册
- function showPictures(articleId,fieldName,name,creater,phone_num,ext){
- require(['modDir/gcms/gcmsPictures'],function(gcmsPictures){
- gcmsPictures.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName,
- name:name,
- creater:creater,
- phone_num:phone_num,
- ext:ext
- });
- });
- }
- //显示专题图
- function showThematic(articleId,fieldName){
- require(['modDir/gcms/gcmsThematic'],function(gcmsThematic){
- gcmsThematic.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示视频
- function showVideo(articleId,fieldName){
- require(['modDir/gcms/gcmsVideo'],function(gcmsVideo){
- gcmsVideo.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //显示音频
- function showAudio(articleId,fieldName){
- require(['modDir/gcms/gcmsAudio'],function(gcmsAudio){
- gcmsAudio.init({
- column_name:ONEMAP.D.gcmsCurColumnData['name'],
- article_id:articleId,
- field_name:fieldName
- });
- });
- }
- //根据序号定位到中心点并弹出冒泡窗
- function showMapCenterPopup(index){
- var markerArray = ONEMAP.M.gcmsList.getMarkerObj();
- if(markerObj.hasOwnProperty(index)){
- var marker = map2DViewer.markers[markerObj[index]];
- map23DControl.setView({
- center:{
- lat:marker.getLatLng().lat,
- lng:marker.getLatLng().lng
- },
- zoom:map23DData.view.zoom
- })
- setTimeout(function(){
- marker.openPopup();
- },1000)
- }
- }
- //根据id定位到中心点并弹出冒泡窗
- function showMapCenterByGcmsId(id){
- var markerObj = ONEMAP.M.gcmsList.getMarkerObj();
- if(markerObj.hasOwnProperty(id)){
- var marker = map2DViewer.markers[markerObj[id]];
- map23DControl.setView({
- center:{
- lat:marker.getLatLng().lat,
- lng:marker.getLatLng().lng
- },
- zoom:map23DData.view.zoom
- })
- setTimeout(function(){
- marker.openPopup();
- },1000)
- }
- }
-
- return ONEMAP.M.gcmsEvents = {
- showDetail:showDetail,
- showMapCenter:showMapCenter,
- showMapDraw:showMapDraw,
- showMapMarker:showMapMarker,
- showPicture:showPicture,
- showPictures:showPictures,
- showThematic:showThematic,
- showVideo:showVideo,
- showMapCenterPopup:showMapCenterPopup,
- showMapCenterByGcmsId:showMapCenterByGcmsId,
- showFiles:showFiles,
- showAudio:showAudio,
- showQuestionnaire:showQuestionnaire,
- showSimplePoint:showSimplePoint,
- showSimplePolyline:showSimplePolyline,
- showSimplePolygon:showSimplePolygon,
- showPointVideo:showPointVideo,
- showPointAudio:showPointAudio,
- showPointPicture:showPointPicture,
- showBoolean:showBoolean,
- showTrajectory:showTrajectory,
- showDrawPoint:showDrawPoint,
- showDrawPolyline:showDrawPolyline,
- showDrawPolygon:showDrawPolygon,
- showDetailDiy:showDetailDiy
- }
- });
|