@@ -323,7 +323,7 @@ module.exports = function(RED) {
323323 var WorldMapIn = function ( n ) {
324324 RED . nodes . createNode ( this , n ) ;
325325 this . path = n . path || "/worldmap" ;
326- this . events = n . events || "connect,disconnect,point,layer,bounds,files,draw,other" ;
326+ this . events = n . events || "connect,disconnect,point,layer,bounds,files,draw,click, other" ;
327327 if ( this . path . charAt ( 0 ) != "/" ) { this . path = "/" + this . path ; }
328328 if ( ! sockets [ this . path ] ) {
329329 var libPath = path . posix . join ( RED . settings . httpNodeRoot , this . path , 'leaflet' , 'sockjs.min.js' ) ;
@@ -349,6 +349,9 @@ module.exports = function(RED) {
349349 if ( ( node . events . indexOf ( "bounds" ) !== - 1 ) && ( message . action === "bounds" ) ) {
350350 setImmediate ( function ( ) { node . send ( { payload :message , topic :node . path . substr ( 1 ) , _sessionid :client . id , _sessionip :sessionip } ) } ) ;
351351 }
352+ if ( ( node . events . indexOf ( "click" ) !== - 1 ) && ( message . action === "click" ) ) {
353+ setImmediate ( function ( ) { node . send ( { payload :message , topic :node . path . substr ( 1 ) , _sessionid :client . id , _sessionip :sessionip } ) } ) ;
354+ }
352355 if ( ( node . events . indexOf ( "point" ) !== - 1 ) && ( ( message . action === "point" ) || ( message . action === "move" ) || ( message . action === "delete" ) ) ) {
353356 setImmediate ( function ( ) { node . send ( { payload :message , topic :node . path . substr ( 1 ) , _sessionid :client . id , _sessionip :sessionip } ) } ) ;
354357 }
@@ -362,7 +365,7 @@ module.exports = function(RED) {
362365 if ( ( node . events . indexOf ( "draw" ) !== - 1 ) && ( ( message . action === "draw" ) || ( message . action === "drawdelete" ) ) ) {
363366 setImmediate ( function ( ) { node . send ( { payload :message , topic :node . path . substr ( 1 ) , _sessionid :client . id , _sessionip :sessionip } ) } ) ;
364367 }
365- if ( node . events . indexOf ( "other" ) !== - 1 && "connected,point,addlayer,dellayer,delete,move,draw,drawdelete,files,bounds" . indexOf ( message . action ) === - 1 ) {
368+ if ( node . events . indexOf ( "other" ) !== - 1 && "connected,point,addlayer,dellayer,delete,move,draw,drawdelete,files,bounds,click " . indexOf ( message . action ) === - 1 ) {
366369 setImmediate ( function ( ) { node . send ( { payload :message , topic :node . path . substr ( 1 ) , _sessionid :client . id , _sessionip :sessionip } ) } ) ;
367370 }
368371 }
0 commit comments