@@ -4785,7 +4785,11 @@ export class WebMap extends Observable {
47854785 if ( this . isRestMapMapboxStyle ( layerInfo ) ) {
47864786 url = url . replace ( restMapMVTStr , '' ) ;
47874787 }
4788- url = this . getRequestUrl ( url + '.json' ) ;
4788+ if ( url . indexOf ( '/restjsr/' ) > - 1 && ! / \. j s o n $ / . test ( url ) ) {
4789+ url = this . getRequestUrl ( url + '.json' ) ;
4790+ } else {
4791+ url = this . getRequestUrl ( url ) ;
4792+ }
47894793
47904794 let credential = layerInfo . credential ;
47914795 let credentialValue , keyfix ;
@@ -4808,10 +4812,23 @@ export class WebMap extends Observable {
48084812 } )
48094813 . then ( ( result ) => {
48104814 layerInfo . visibleScales = result . visibleScales ;
4811- layerInfo . coordUnit = result . coordUnit ;
4815+ layerInfo . coordUnit = result . coordUnit || 'METER' ;
48124816 layerInfo . scale = result . scale ;
4813- layerInfo . epsgCode = result . prjCoordSys . epsgCode ;
4814- layerInfo . bounds = result . bounds ;
4817+ layerInfo . epsgCode = ( result . prjCoordSys && result . prjCoordSys . epsgCode ) || '3857' ;
4818+ layerInfo . bounds = result . bounds || {
4819+ top : 20037508.342789244 ,
4820+ left : - 20037508.342789244 ,
4821+ bottom : - 20037508.342789244 ,
4822+ leftBottom : {
4823+ x : - 20037508.342789244 ,
4824+ y : - 20037508.342789244
4825+ } ,
4826+ right : 20037508.342789244 ,
4827+ rightTop : {
4828+ x : 20037508.342789244 ,
4829+ y : 20037508.342789244
4830+ }
4831+ } ;
48154832 return layerInfo ;
48164833 } )
48174834 . catch ( ( error ) => {
@@ -4832,7 +4849,7 @@ export class WebMap extends Observable {
48324849 let _this = this ;
48334850 let url = layerInfo . url || layerInfo . dataSource . url ;
48344851 let styleUrl = url ;
4835- if ( styleUrl . indexOf ( '/restjsr/' ) > - 1 ) {
4852+ if ( styleUrl . indexOf ( '/restjsr/' ) > - 1 && ! / \/ s t y l e \. j s o n $ / . test ( url ) ) {
48364853 styleUrl = `${ styleUrl } /style.json` ;
48374854 }
48384855 styleUrl = this . getRequestUrl ( styleUrl ) ;
0 commit comments