File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import { geoContext } from './GEOContext';
27
27
import { layersControl } from './LayersControl' ;
28
28
// @ts -ignore
29
29
import Notification from 'ol-ext/control/Notification'
30
- import { object } from 'prop-types ' ;
30
+ import { findLayer } from './vendors/helpers ' ;
31
31
32
32
/**
33
33
* Array of style configuration objects for styling the component.
@@ -653,7 +653,24 @@ GEOComp = withMethodExposing(GEOComp, [
653
653
if ( map ) return map . getView ( ) . getZoom ( )
654
654
return 0
655
655
}
656
- }
656
+ } ,
657
+ {
658
+ method : {
659
+ name : "getLayer" ,
660
+ description : "Get a layer by name" ,
661
+ params : [
662
+ {
663
+ name : "name" ,
664
+ type : "string" ,
665
+ } ,
666
+
667
+ ]
668
+ } ,
669
+ execute : async ( comp : any , params : any ) => {
670
+ var map = comp . exposingValues . events [ 'map:init' ]
671
+ return findLayer ( map , params [ 0 ] )
672
+ }
673
+ } ,
657
674
] ) ;
658
675
659
676
You can’t perform that action at this time.
0 commit comments