7171/******/ __webpack_require__ . p = "" ;
7272/******/
7373/******/ // Load entry module and return exports
74- /******/ return __webpack_require__ ( __webpack_require__ . s = 7 ) ;
74+ /******/ return __webpack_require__ ( __webpack_require__ . s = 9 ) ;
7575/******/ } )
7676/************************************************************************/
7777/******/ ( [
@@ -82,6 +82,12 @@ module.exports = mapboxgl;
8282
8383/***/ } ) ,
8484/* 1 */
85+ /***/ ( function ( module , exports ) {
86+
87+ module . exports = function ( ) { try { return mapv } catch ( e ) { return { } } } ( ) ;
88+
89+ /***/ } ) ,
90+ /* 2 */
8591/***/ ( function ( module , exports , __webpack_require__ ) {
8692
8793"use strict" ;
@@ -98,7 +104,7 @@ var _mapboxGl = __webpack_require__(0);
98104
99105var _mapboxGl2 = _interopRequireDefault ( _mapboxGl ) ;
100106
101- var _iClient = __webpack_require__ ( 5 ) ;
107+ var _iClient = __webpack_require__ ( 8 ) ;
102108
103109var _iClient2 = _interopRequireDefault ( _iClient ) ;
104110
@@ -233,7 +239,7 @@ _mapboxGl2.default.supermap = _mapboxGl2.default.supermap || {};
233239_mapboxGl2 . default . supermap . LogoControl = Logo ;
234240
235241/***/ } ) ,
236- /* 2 */
242+ /* 3 */
237243/***/ ( function ( module , exports , __webpack_require__ ) {
238244
239245"use strict" ;
@@ -246,7 +252,7 @@ exports.MapvLayer = undefined;
246252
247253var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
248254
249- var _MapvRenderer = __webpack_require__ ( 4 ) ;
255+ var _MapvRenderer = __webpack_require__ ( 7 ) ;
250256
251257var _MapvRenderer2 = _interopRequireDefault ( _MapvRenderer ) ;
252258
@@ -332,7 +338,7 @@ _mapboxGl2.default.supermap = _mapboxGl2.default.supermap || {};
332338_mapboxGl2 . default . supermap . MapvLayer = MapvLayer ;
333339
334340/***/ } ) ,
335- /* 3 */
341+ /* 4 */
336342/***/ ( function ( module , exports , __webpack_require__ ) {
337343
338344"use strict" ;
@@ -748,7 +754,223 @@ _mapboxGl2.default.supermap = _mapboxGl2.default.supermap || {};
748754_mapboxGl2 . default . supermap . RankTheme3DLayer = RankTheme3DLayer ;
749755
750756/***/ } ) ,
751- /* 4 */
757+ /* 5 */
758+ /***/ ( function ( module , exports , __webpack_require__ ) {
759+
760+ "use strict" ;
761+
762+
763+ Object . defineProperty ( exports , "__esModule" , {
764+ value : true
765+ } ) ;
766+ exports . setPaintProperty = exports . setBackground = exports . getDefaultVectorTileStyle = undefined ;
767+
768+ var _mapboxGl = __webpack_require__ ( 0 ) ;
769+
770+ var _mapboxGl2 = _interopRequireDefault ( _mapboxGl ) ;
771+
772+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
773+
774+ _mapboxGl2 . default . supermap = _mapboxGl2 . default . supermap || { } ;
775+ _mapboxGl2 . default . supermap . map = _mapboxGl2 . default . supermap . map || { } ;
776+
777+ /**
778+ * 配置默认底图样式
779+ */
780+ var getDefaultVectorTileStyle = exports . getDefaultVectorTileStyle = function getDefaultVectorTileStyle ( urlTemplate , options ) {
781+ options = options || { } ;
782+ var defaultOptions = { } ;
783+ defaultOptions . version = options . version || 8 ;
784+ defaultOptions . layers = options . layers || [ ] ;
785+ defaultOptions . light = options . light || {
786+ "anchor" : "viewport" ,
787+ "color" : "#fcf6ef" ,
788+ "intensity" : 0.5 ,
789+ "position" : [ 1.15 , 201 , 20 ]
790+ } ;
791+
792+ var style = {
793+ "version" : defaultOptions . version ,
794+ "sources" : {
795+ "vector-tiles" : {
796+ "type" : "vector" ,
797+ "tiles" : [ urlTemplate ]
798+ }
799+ } ,
800+ "layers" : defaultOptions . layers ,
801+ "light" : defaultOptions . light
802+ } ;
803+ if ( options . sprite != null ) {
804+ style . sprite = options . sprite ;
805+ }
806+ if ( options . glyphs != null ) {
807+ style . glyphs = options . glyphs ;
808+ }
809+ return style ;
810+ } ;
811+
812+ /**
813+ * 设置地图背景
814+ */
815+ var setBackground = exports . setBackground = function setBackground ( map , color ) {
816+ if ( color && map ) {
817+ map . addLayer ( {
818+ "id" : "background" ,
819+ "type" : "background" ,
820+ "paint" : {
821+ "background-color" : color
822+ }
823+ } , "background" ) ;
824+ }
825+ } ;
826+
827+ /**
828+ * 设置图层风格
829+ * @param map
830+ * @param layerIds
831+ * @param type
832+ * @param paint
833+ * @param source 非必填,默认vector-tiles
834+ * @param sourceLayers 非必填,默认与id对应
835+ */
836+ var setPaintProperty = exports . setPaintProperty = function setPaintProperty ( map , layerIds , type , paint , source , sourceLayers ) {
837+ if ( layerIds && map ) {
838+ if ( Object . prototype . toString . call ( layerIds ) !== '[object Array]' ) {
839+ layerIds = [ layerIds ] ;
840+ }
841+ for ( var i = 0 ; i < layerIds . length ; i ++ ) {
842+ var sourceLayer = sourceLayers ? sourceLayers [ i ] : null ;
843+ var layer = getLayer ( layerIds [ i ] , type , source , sourceLayer , paint ) ;
844+ map . addLayer ( layer , layerIds [ i ] ) ;
845+ map . moveLayer ( layerIds [ i ] ) ;
846+ }
847+ }
848+ } ;
849+
850+ function getLayer ( id , type , source , sourceLayer , paint ) {
851+ var sourceType = source || "vector-tiles" ;
852+ var sLayer = sourceLayer || id ;
853+ var layer = {
854+ "id" : id ,
855+ "type" : type ,
856+ "source" : sourceType ,
857+ "source-layer" : sLayer ,
858+ "paint" : paint
859+ } ;
860+ return layer ;
861+ }
862+
863+ _mapboxGl2 . default . supermap . map . getDefaultVectorTileStyle = getDefaultVectorTileStyle ;
864+ _mapboxGl2 . default . supermap . map . setBackground = setBackground ;
865+ _mapboxGl2 . default . supermap . map . setPaintProperty = setPaintProperty ;
866+
867+ /***/ } ) ,
868+ /* 6 */
869+ /***/ ( function ( module , exports , __webpack_require__ ) {
870+
871+ "use strict" ;
872+
873+
874+ Object . defineProperty ( exports , "__esModule" , {
875+ value : true
876+ } ) ;
877+ exports . MapvDataSet = undefined ;
878+
879+ var _mapboxGl = __webpack_require__ ( 0 ) ;
880+
881+ var _mapboxGl2 = _interopRequireDefault ( _mapboxGl ) ;
882+
883+ var _mapv = __webpack_require__ ( 1 ) ;
884+
885+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
886+
887+ _mapboxGl2 . default . supermap = _mapboxGl2 . default . supermap || { } ;
888+
889+ var MapvDataSet = exports . MapvDataSet = {
890+
891+ /**
892+ * 返回mapv点数据集
893+ */
894+ getPoint : function getPoint ( center ) {
895+ if ( center && center instanceof Array ) {
896+ return new _mapv . DataSet ( [ {
897+ geometry : {
898+ type : 'Point' ,
899+ coordinates : center
900+ }
901+ } ] ) ;
902+ }
903+ } ,
904+
905+ /**
906+ * 返回mapv多点数据集
907+ */
908+ getPoints : function getPoints ( points ) {
909+ if ( points && points instanceof Array ) {
910+ var mPoints = [ ] ;
911+ points . map ( function ( data ) {
912+ mPoints . push ( {
913+ geometry : {
914+ type : 'Point' ,
915+ coordinates : data . geometry . coordinates
916+ }
917+ } ) ;
918+ } ) ;
919+ return new _mapv . DataSet ( mPoints ) ;
920+ }
921+ } ,
922+
923+ /**
924+ * 返回mapv弧形线数据集
925+ */
926+ getCurveLines : function getCurveLines ( startPoint , LinePoints ) {
927+ if ( startPoint && startPoint instanceof Array && LinePoints && LinePoints instanceof Array ) {
928+ var lineData = [ ] ;
929+ LinePoints . map ( function ( data ) {
930+ var coords = data . geometry && data . geometry . coordinates ;
931+ var toCenter = { lng : coords [ 0 ] , lat : coords [ 1 ] } ;
932+ var fromCenter = { lng : startPoint [ 0 ] , lat : startPoint [ 1 ] } ;
933+ var cv = _mapv . utilCurve . getPoints ( [ fromCenter , toCenter ] ) ;
934+ lineData . push ( {
935+ geometry : {
936+ type : 'LineString' ,
937+ coordinates : cv
938+ }
939+ } ) ;
940+ } ) ;
941+ return new _mapv . DataSet ( lineData ) ;
942+ }
943+ } ,
944+
945+ /**
946+ * 返回mapv弧形动态点数据集
947+ */
948+ getCurveDynamicPoints : function getCurveDynamicPoints ( center , endPoints ) {
949+ if ( center && center instanceof Array && endPoints && endPoints instanceof Array ) {
950+ var timeData = [ ] ;
951+ endPoints . map ( function ( data ) {
952+ var coords = data . geometry && data . geometry . coordinates ;
953+ var toCenter = { lng : coords [ 0 ] , lat : coords [ 1 ] } ;
954+ var fromCenter = { lng : center [ 0 ] , lat : center [ 1 ] } ;
955+ var cv = _mapv . utilCurve . getPoints ( [ fromCenter , toCenter ] ) ;
956+ for ( var j = 0 ; j < cv . length ; j ++ ) {
957+ timeData . push ( {
958+ geometry : {
959+ type : 'Point' ,
960+ coordinates : cv [ j ]
961+ } ,
962+ time : j
963+ } ) ;
964+ }
965+ } ) ;
966+ return new _mapv . DataSet ( timeData ) ;
967+ }
968+ }
969+ } ;
970+ _mapboxGl2 . default . supermap . MapvDataSet = MapvDataSet ;
971+
972+ /***/ } ) ,
973+ /* 7 */
752974/***/ ( function ( module , exports , __webpack_require__ ) {
753975
754976"use strict" ;
@@ -762,7 +984,7 @@ var _createClass = function () { function defineProperties(target, props) { for
762984
763985var _get = function get ( object , property , receiver ) { if ( object === null ) object = Function . prototype ; var desc = Object . getOwnPropertyDescriptor ( object , property ) ; if ( desc === undefined ) { var parent = Object . getPrototypeOf ( object ) ; if ( parent === null ) { return undefined ; } else { return get ( parent , property , receiver ) ; } } else if ( "value" in desc ) { return desc . value ; } else { var getter = desc . get ; if ( getter === undefined ) { return undefined ; } return getter . call ( receiver ) ; } } ;
764986
765- var _mapv = __webpack_require__ ( 6 ) ;
987+ var _mapv = __webpack_require__ ( 1 ) ;
766988
767989function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
768990
@@ -1081,24 +1303,20 @@ var MapvRenderer = function (_BaseLayer) {
10811303exports . default = MapvRenderer ;
10821304
10831305/***/ } ) ,
1084- /* 5 */
1306+ /* 8 */
10851307/***/ ( function ( module , exports ) {
10861308
10871309module . exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzh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HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII="
10881310
10891311/***/ } ) ,
1090- /* 6 */
1091- /***/ ( function ( module , exports ) {
1092-
1093- module . exports = function ( ) { try { return mapv } catch ( e ) { return { } } } ( ) ;
1094-
1095- /***/ } ) ,
1096- /* 7 */
1312+ /* 9 */
10971313/***/ ( function ( module , exports , __webpack_require__ ) {
10981314
1099- __webpack_require__ ( 2 ) ;
11001315__webpack_require__ ( 3 ) ;
1101- module . exports = __webpack_require__ ( 1 ) ;
1316+ __webpack_require__ ( 6 ) ;
1317+ __webpack_require__ ( 5 ) ;
1318+ __webpack_require__ ( 4 ) ;
1319+ module . exports = __webpack_require__ ( 2 ) ;
11021320
11031321
11041322/***/ } )
0 commit comments