@@ -11,6 +11,7 @@ import {
1111 TouchType ,
1212 ConstPath ,
1313 ToolbarType ,
14+ Const ,
1415} from '../../../../../../constants'
1516import {
1617 dataUtil ,
@@ -23,6 +24,7 @@ import { ImagePicker } from '../../../../../../components'
2324import NavigationService from '../../../../../NavigationService'
2425import { getLanguage } from '../../../../../../language'
2526import ToolbarModule from '../ToolbarModule'
27+ import Utils from '../../utils'
2628
2729function begin ( ) {
2830 GLOBAL . GPS = setInterval ( ( ) => {
@@ -63,6 +65,7 @@ function select(type) {
6365 case ConstToolType . MAP_TOOL_TAGGING_POINT_SELECT :
6466 case ConstToolType . MAP_TOOL_POINT_SELECT :
6567 case ConstToolType . MAP_TOOL_TAGGING_EDIT :
68+ case ConstToolType . MAP_TOOL_TAGGING_STYLE :
6669 default :
6770 SMap . setAction ( Action . SELECT )
6871 break
@@ -732,6 +735,30 @@ function selectLabelToEdit() {
732735 Toast . show ( getLanguage ( global . language ) . Prompt . PLEASE_SELECT_OBJECT )
733736}
734737
738+ /**
739+ * 选择标注_设置风格
740+ */
741+ function selectLabelToStyle ( ) {
742+ const _params = ToolbarModule . getParams ( )
743+ _params . setSelection ( )
744+ if ( ! _params . setToolbarVisible ) return
745+ _params . showFullMap && _params . showFullMap ( true )
746+
747+ let type = ConstToolType . MAP_TOOL_TAGGING_STYLE
748+
749+ _params . setToolbarVisible ( true , type , {
750+ isFullScreen : false ,
751+ height : 0 ,
752+ cb : ( ) => select ( type ) ,
753+ } )
754+
755+ let layers = _params . layers . layers
756+ // 其他图层设置为不可选
757+ _setMyLayersSelectable ( layers , false )
758+
759+ Toast . show ( getLanguage ( global . language ) . Prompt . PLEASE_SELECT_OBJECT )
760+ }
761+
735762/**
736763 * 选择标注_删除
737764 */
@@ -828,18 +855,76 @@ function geometrySelected(event) {
828855 containerType = ToolbarType . scrollTable
829856 break
830857 }
831- params . setToolbarVisible &&
832- params . setToolbarVisible ( true , type , {
833- isFullScreen : false ,
834- column,
835- height,
836- containerType,
837- cb : ( ) => SMap . appointEditGeometry ( event . id , event . layerInfo . path ) ,
838- } )
858+ if ( type !== '' ) {
859+ params . setToolbarVisible &&
860+ params . setToolbarVisible ( true , type , {
861+ isFullScreen : false ,
862+ column,
863+ height,
864+ containerType,
865+ cb : ( ) => SMap . appointEditGeometry ( event . id , event . layerInfo . path ) ,
866+ } )
867+ }
868+ }
869+ } else if ( GLOBAL . MapToolType === ConstToolType . MAP_TOOL_TAGGING_STYLE ) {
870+ let geoType
871+ for ( let i = 0 ; i < event . fieldInfo . length ; i ++ ) {
872+ if ( event . fieldInfo [ i ] . name === 'SmGeoType' ) {
873+ geoType = event . fieldInfo [ i ] . value
874+ break
875+ }
876+ }
877+ if ( geoType ) {
878+ const params = ToolbarModule . getParams ( )
879+
880+ let type = ''
881+ switch ( geoType ) {
882+ case DatasetType . POINT :
883+ type = ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT
884+ break
885+ case DatasetType . LINE :
886+ type = ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE
887+ break
888+ case DatasetType . REGION :
889+ type = ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION
890+ break
891+ }
892+
893+ if ( type !== '' ) {
894+ params . setToolbarVisible &&
895+ params . setToolbarVisible ( true , type , {
896+ containerType : ToolbarType . symbol ,
897+ isFullScreen : false ,
898+ column : 4 ,
899+ height : ConstToolType . THEME_HEIGHT [ 3 ] ,
900+ cb : ( ) => {
901+ StyleUtils . setSingleSelectionStyle ( event . layerInfo . path )
902+ SMap . setLayerEditable ( event . layerInfo . path , false )
903+ SMap . setAction ( Action . PAN )
904+ } ,
905+ } )
906+ }
839907 }
840908 }
841909}
842910
911+ function colorAction ( params ) {
912+ switch ( params . type ) {
913+ case ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT_COLOR_SET :
914+ SMap . setTaggingMarkerColor ( params . key )
915+ break
916+ case ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE_COLOR_SET :
917+ case ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_BOARDERCOLOR_SET :
918+ SMap . setTaggingLineColor ( params . key )
919+ break
920+ case ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_FORECOLOR_SET :
921+ SMap . setTaggingFillForeColor ( params . key )
922+ break
923+ default :
924+ break
925+ }
926+ }
927+
843928// function captureVideo () {
844929// let options = {
845930// datasourceName: 'Hunan',
@@ -1066,7 +1151,84 @@ async function showAttribute() {
10661151 )
10671152}
10681153
1069- function showMenuBox ( ) {
1154+ function menu ( type , selectKey , params = { } ) {
1155+ let isFullScreen , showMenuDialog , isTouchProgress
1156+ let showBox = function ( ) {
1157+ if (
1158+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT ||
1159+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE ||
1160+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION ||
1161+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT_COLOR_SET ||
1162+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE_COLOR_SET ||
1163+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_FORECOLOR_SET ||
1164+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_BOARDERCOLOR_SET
1165+ ) {
1166+ params . showBox && params . showBox ( )
1167+ }
1168+ } . bind ( this )
1169+
1170+ let setData = function ( ) {
1171+ params . setData &&
1172+ params . setData ( {
1173+ isFullScreen,
1174+ showMenuDialog,
1175+ isTouchProgress,
1176+ } )
1177+ } . bind ( this )
1178+
1179+ if ( Utils . isTouchProgress ( selectKey ) ) {
1180+ isFullScreen = true
1181+ showMenuDialog = ! GLOBAL . ToolBar . state . showMenuDialog
1182+ isTouchProgress = GLOBAL . ToolBar . state . showMenuDialog
1183+ setData ( )
1184+ } else {
1185+ isFullScreen = ! GLOBAL . ToolBar . state . showMenuDialog
1186+ showMenuDialog = ! GLOBAL . ToolBar . state . showMenuDialog
1187+ isTouchProgress = false
1188+ if ( ! GLOBAL . ToolBar . state . showMenuDialog ) {
1189+ // 先滑出box,再显示Menu
1190+ showBox ( )
1191+ setTimeout ( setData , Const . ANIMATED_DURATION_2 )
1192+ } else {
1193+ // 先隐藏Menu,再滑进box
1194+ setData ( )
1195+ showBox ( )
1196+ }
1197+ }
1198+ }
1199+
1200+ function showMenuBox ( type , selectKey , params = { } ) {
1201+ if (
1202+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT ||
1203+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE ||
1204+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION ||
1205+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT_COLOR_SET ||
1206+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE_COLOR_SET ||
1207+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_FORECOLOR_SET ||
1208+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_BOARDERCOLOR_SET
1209+ ) {
1210+ if ( Utils . isTouchProgress ( selectKey ) ) {
1211+ params . setData &&
1212+ params . setData ( {
1213+ isTouchProgress : GLOBAL . ToolBar . state . showMenuDialog ,
1214+ showMenuDialog : ! GLOBAL . ToolBar . state . showMenuDialog ,
1215+ isFullScreen : true ,
1216+ } )
1217+ } else {
1218+ if ( ! GLOBAL . ToolBar . state . showMenuDialog ) {
1219+ params . showBox && params . showBox ( )
1220+ } else {
1221+ params . setData &&
1222+ params . setData ( {
1223+ showMenuDialog : false ,
1224+ isFullScreen : false ,
1225+ } )
1226+ params . showBox && params . showBox ( )
1227+ }
1228+ }
1229+ return
1230+ }
1231+
10701232 const _params = ToolbarModule . getParams ( )
10711233 _params . setToolbarVisible ( true , ConstToolType . STYLE_TRANSFER_PICKER , {
10721234 containerType : ToolbarType . picker ,
@@ -1133,7 +1295,14 @@ function close(type) {
11331295 type === ConstToolType . MAP_TOOL_TAGGING_EDIT ||
11341296 type === ConstToolType . MAP_TOOL_TAGGING_EDIT_POINT ||
11351297 type === ConstToolType . MAP_TOOL_TAGGING_EDIT_LINE ||
1136- type === ConstToolType . MAP_TOOL_TAGGING_EDIT_REGION
1298+ type === ConstToolType . MAP_TOOL_TAGGING_EDIT_REGION ||
1299+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT ||
1300+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE ||
1301+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION ||
1302+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_POINT_COLOR_SET ||
1303+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_LINE_COLOR_SET ||
1304+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_FORECOLOR_SET ||
1305+ type === ConstToolType . MAP_TOOL_TAGGING_STYLE_REGION_BOARDERCOLOR_SET
11371306 ) {
11381307 SMap . setAction ( Action . PAN )
11391308 SMap . clearSelection ( )
@@ -1173,6 +1342,7 @@ function close(type) {
11731342export default {
11741343 commit,
11751344 showAttribute,
1345+ menu,
11761346 showMenuBox,
11771347 matchPictureStyle,
11781348 pickerConfirm,
@@ -1187,9 +1357,11 @@ export default {
11871357 close,
11881358 showEditLabel,
11891359 selectLabelToEdit,
1360+ selectLabelToStyle,
11901361 selectLabelToDelete,
11911362 deleteLabel,
11921363 geometrySelected,
1364+ colorAction,
11931365
11941366 begin,
11951367 stop,
0 commit comments