File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -1685,7 +1685,12 @@ export default class WebMapViewModel extends WebMapBase {
16851685 return point ;
16861686 }
16871687 // @ts -ignore
1688- return proj4 ( sourceProjection , 'EPSG:4326' , point ) ;
1688+ const coor = proj4 ( sourceProjection , 'EPSG:4326' , point ) ;
1689+ const proj = proj4 . defs ( sourceProjection ) ;
1690+ if ( proj . axis && proj . axis . indexOf ( 'ne' ) === 0 ) {
1691+ coor . reverse ( ) ;
1692+ }
1693+ return coor ;
16891694 }
16901695
16911696 private _getMapCenter ( mapInfo ) {
Original file line number Diff line number Diff line change @@ -63,22 +63,23 @@ window.jsonsql = {
6363 // }
6464 // }
6565 // fix with -- stric mode
66- if ( this . functionreplaceWith ( jsonsql_scope [ jsonsql_i ] , jsonsql_o . where ) ) {
66+ if ( this . functionWith ( jsonsql_scope [ jsonsql_i ] , jsonsql_o . where ) ) {
6767 jsonsql_result [ jsonsql_rc ++ ] = this . returnFields ( jsonsql_scope [ jsonsql_i ] , jsonsql_o . fields ) ;
6868 }
6969 }
7070
7171 return jsonsql_result ;
7272 } ,
73+ functionWith ( scope , exp ) {
74+ if ( ! scope ) return ;
7375
74- functionreplaceWith : function ( scope , exp ) {
75- exp = ' ' + exp . trim ( ) ;
76- let quickRegex = / ( [ \s \+ \- \* \/ % & \| \^ ! \* ~ ] \s * ?) ( [ a - z A - Z _ $ ] [ a - z A - Z _ $ 0 - 9 ] * ?) / g;
77- exp = exp . replace ( quickRegex , ( a , b , c ) => {
78- return b + 'scope.' + c ;
79- } ) ;
80- let func = new Function ( 'scope' , 'return ' + exp ) ;
81- return func ( scope ) ;
76+ var resetArgs = '' ;
77+ for ( var key in scope ) {
78+ resetArgs = resetArgs + 'var ' + key + ' = _$_$_functionWith["' + key + '"];' ;
79+ }
80+ var nf = new Function ( '_$_$_functionWith' , resetArgs + 'return ' + exp ) ;
81+
82+ return nf ( scope ) ;
8283 } ,
8384
8485 returnFields : function ( scope , fields ) {
You can’t perform that action at this time.
0 commit comments