@@ -160,6 +160,7 @@ var GEOComp = (function () {
160
160
menuContent : stringSimpleControl ( "" ) ,
161
161
events : jsonObjectExposingStateControl ( "events" ) ,
162
162
event : jsonObjectExposingStateControl ( "event" ) ,
163
+ feature : jsonObjectExposingStateControl ( "feature" ) ,
163
164
buttons : withDefault ( JSONObjectControl , "{menu:false,north:false,save:false}" ) ,
164
165
features : withDefault (
165
166
JSONObjectControl ,
@@ -189,7 +190,7 @@ var GEOComp = (function () {
189
190
autoHeight : boolean ;
190
191
events : any ;
191
192
event : any ;
192
- map : any ;
193
+ feature : any
193
194
} ) => {
194
195
const doDebug = function ( ) { return props . defaults && props . defaults . debug === true }
195
196
//Cache for all events
@@ -214,6 +215,9 @@ var GEOComp = (function () {
214
215
switch ( name ) { //Catch first on name
215
216
case 'map:create' :
216
217
return //Internal event only, user should use map:init
218
+ case 'click:feature' :
219
+ props . feature . onChange ( eventObj )
220
+ break ;
217
221
default :
218
222
switch ( eventName ) {
219
223
case 'bbox' :
@@ -376,16 +380,6 @@ GEOComp = withMethodExposing(GEOComp, [
376
380
animate ( map , params [ 0 ] , params ?. [ 1 ] , params ?. [ 2 ] , params ?. [ 3 ] )
377
381
}
378
382
} ,
379
- {
380
- method : {
381
- name : "feature" ,
382
- params : [ ] ,
383
- description : "Return the last feature clicked" ,
384
- } ,
385
- execute : async ( comp : any , params : any ) => {
386
- return comp . exposingValues . events [ 'click:feature' ] || { }
387
- }
388
- } ,
389
383
{
390
384
method : {
391
385
name : "map" ,
@@ -506,4 +500,5 @@ export default withExposingConfigs(GEOComp, [
506
500
new NameConfig ( "events" , trans ( "component.events" ) ) ,
507
501
new NameConfig ( "event" , trans ( "component.event" ) ) ,
508
502
new NameConfig ( "bbox" , trans ( "component.bbox" ) ) ,
503
+ new NameConfig ( "feature" , trans ( "component.feature" ) ) ,
509
504
] ) ;
0 commit comments