I get click events for markers but not for circles etc. in node-red-contrib-web-worldmap

Are click events not supported for circles in worldmap? I get them for markers but not circles, polygons or lines.

I'm not clear what dictates whether a popup appears either... It seems that if I handle the click event for a marker, I don't get its popup. Does that sound right?

I do get a popup for my circle even though I don't get a click event for it.

Thanks in advance.

What version of the world map node are you running
What version of NR and node.js?

Please provide a small flow displaying your issue.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

Sounds about right (I've not checked in detail) - the tihinking was that drawn things get in the way of being able to click on the map itself - (unless they are on the Drawing layer so can be edited).

I'm using v2.32.2 (so one behind the current latest).

However, I've been looking at the code and it appears that only markers get the click event attached to them.

I've modified the code to add the event to circles and ellipses, and (surprisingly) the small change I made seems to have worked.

I've raised a pull request containing my (very minimal) changes.

Thanks. Sometimes for me, markers are too big and get in the way themselves! :slight_smile: So a small, clickable circle is what I find looks best. I've raised a pull request. My code might be naive, but it works for me (or seems to)!

1 Like

in other thoughts - you can use fa-icons for marker icons - eg 'fa-circle-o' which is fairly small - or can be set to 'fa-circle-o fa-small' if you really want tiny :slight_smile:

image

Thanks, I'll take a look at that one. I still think it would be useful to be able to click polygons, though, and would be even better to be able to select multiple by dragging a box around them -- but that's a different discussion, I think.

By the way, I thought I saw another reply to this thread suggesting a better place for the code I suggested, so that it would provide the functionality for all polygons. Something about "right click"?? It doesn't seem to be here anymore...

that is a comment on your PR

1 Like