Closed monkeyotg closed 1 year ago
Yes I know that the tooltip is not perfect. But how should I solve this for everyone? One has text, the other an image, ... Do you have an idea? Is it possible for you to use the title option for the markers? There you can write a shorter text.
[leaflet-marker title="Short Info"...]Long Info[/leaflet-marker]
[hover marker=title]
I'm using .geojson. Initially I don't want to show full info in tooltip, like only title or something brief. And in popup full info will be shown. But later I realized "The tooltip content is the same as the popup content.".
both show only Name:
[leaflet-geojson src="/wp-content/uploads/map/Daily_Need.geojson"]{@Name}[/leaflet-geojson]
[hover]
both show everything:
[leaflet-geojson src="/wp-content/uploads/map/Daily_Need.geojson" table-view=1]{@Name}[/leaflet-geojson]
[hover]
both show nothing:
[leaflet-geojson src="/wp-content/uploads/map/Daily_Need.geojson"][/leaflet-geojson]
[hover]
So compared to losing some information in popups, showing full info in tooltips is a better solution.
And I'm a newbie to OSM/Leaflet .... So I don't know, is it also possible that I can name a variant as "Short Info"/Title or something like that, if I use .geojson?
If it would be a pain to handle dynamically, is giving an option to just force a fixed width to the tooltip a viable solution?
I searched the internet, this seems to be non-trivial, if not impossible to solve with css. One possibility would be to add the short text as a feature in the geojson file and extend the shortcode hover to use this as a tooltip.
Simpler: I create an option for hover for tooltip: hover geojsontooltip="{@Name}"
or similar.
Thanks, I will try it today and report back!
Did you read my edit? I will change the option geojsontooltip
. Until now it was true or false. Later it will have an parameter geojsontooltip="{@Name}"
.
I have read it. And you haven't pointed out that it's something client-based or some kind of server-based. So to me, a guy who doesn't know how to code, it means 2 possibilities:
No.1 will cost me nothing. Why not give it a try?
Das zweite trifft zu.
Danke, dann warte ich darauf.
You can test the Github version. Example
Thanks, I'll try it tomorrow.
Version 3.4.4 is released.
Version 3.4.4 is released.
I've tried. It works great! Thanks
Thanks for the extension. It does the job very well.
Here is the bug I found. Since the tooltips trigged by hover and click cannot be controlled separately, they can only show the same information. So I decided to make the hover tooltips show the full information, therefor "Note" is included. And in some cases "Note" could be a long-text. And as you can see in the screenshot, the long-text will destroy the frame.