@@ -38,6 +38,7 @@ import WMTSTileGrid from 'ol/tilegrid/WMTS';
3838import * as olGeometry from 'ol/geom' ;
3939import * as olSource from 'ol/source' ;
4040import Feature from 'ol/Feature' ;
41+ import olRenderFeature from 'ol/render/Feature' ;
4142import Style from 'ol/style/Style' ;
4243import FillStyle from 'ol/style/Fill' ;
4344import StrokeStyle from 'ol/style/Stroke' ;
@@ -198,6 +199,7 @@ export class WebMap extends Observable {
198199 }
199200 that . baseProjection = mapInfo . projection ;
200201 that . webMapVersion = mapInfo . version ;
202+ that . baseLayer = mapInfo . baseLayer ;
201203 that . mapParams = {
202204 title : mapInfo . title ,
203205 description : mapInfo . description
@@ -1785,7 +1787,7 @@ export class WebMap extends Observable {
17851787 */
17861788 sendMapToUser ( layersLen ) {
17871789 if ( this . layerAdded === layersLen && this . successCallback ) {
1788- this . successCallback ( this . map , this . mapParams , this . layers ) ;
1790+ this . successCallback ( this . map , this . mapParams , this . layers , this . baseLayer ) ;
17891791 }
17901792 }
17911793
@@ -4048,22 +4050,18 @@ export class WebMap extends Observable {
40484050 } ) ;
40494051 return new Promise ( ( resolve ) => {
40504052 mapboxStyles . on ( 'styleloaded' , function ( ) {
4051- let styleUrl = layerInfo . url ;
4052- if ( styleUrl . indexOf ( '/restjsr/' ) > - 1 ) {
4053- styleUrl = styleUrl + '/style.json'
4054- }
40554053 let visibleScale = layerInfo . visibleScale ;
40564054 let minResolution = visibleScale && that . resolutions [ visibleScale . maxScale ] ;
40574055 let maxResolution = visibleScale && that . resolutions [ visibleScale . minScale ] ;
40584056 let layer = new olLayer . VectorTile ( {
40594057 //设置避让参数
40604058 declutter : true ,
40614059 source : new olSource . VectorTileSuperMapRest ( {
4062- style : styleUrl ,
4060+ style : styles ,
40634061 withCredentials,
40644062 projection : layerInfo . projection ,
40654063 format : new MVT ( {
4066- featureClass : Feature
4064+ featureClass : olRenderFeature
40674065 } ) ,
40684066 wrapX : false
40694067 } ) ,
0 commit comments