0 votes
by (240 points)

I am using imagemaps to create a point-n-click travel function.
My <<waypoint>> widget places a geo-tag image above an underlying map-image, and using the @-directive to supply data for the <img> usemap & style attributes (works perfectly).

However, issues arise in the accompanying <map> tag. The name, title & data-passage attributes work as intended, but I never get the tooltip-popup from the alt-attribute. I do require this as a means of knowing which location is which before venturing there.
Outside of the widget, with hardcoded values, I do get the alt-popup.

My waypoint-widget

<<widget "waypoint">>
	<<set $waypointlocation = $args[0]>>
	<<set $waypointsimple = $waypointlocation.replace(/'|\s/g, '')>>
	<<set $waypointsimple = $waypointsimple.toLowerCase()>>
	<<set $waypointhash = "#"+$waypointsimple>>
	<<set $waypointxy = $args[1]>>

	<img src="https://i.imgur.com/Rg43Fwe.png" @usemap="$waypointhash" class="overlaywaypoint" @style="$waypointxy">

	<map @name="$waypointsimple">
    	<area target="_blank" @alt="$waypointlocation" @title="$waypointlocation" @data-passage="$waypointlocation" coords="16,30,25,10,20,1,11,1,8,10" shape="poly">
	</map>
<</widget>>

and I'm calling the widget with:
<<waypoint "Braxton's Goods" "top: 250px; left: 85px;">>

1 Answer

0 votes
by (240 points)
selected by
 
Best answer
Alright, jumped the gun a bit.
Haven't updated SugarCube in a long while, and I found http://twinery.org/questions/45452/attribute-directive-to-make-variables-tooltips?show=45459#a45459 whilst browsing around similar issues. (If only I had found it before posting this thread)
Updating SugarCube to 2.28.8 fixed it
by (159k points)

You may notice that many of the features described in the story format's documentation contain a section titled Since: and that that section will contain one or more version numbers.

These version numbers indicate the minimum version of SugarCube 2.x required for that feature to be available, if a feature has no such section then it means that it is available in all versions of SugarCube 2.x

eg. the documentation for Attribute Directive mark-up includes

Since:
    v2.21.0

In this specific case, as indicated in the reply you linked to, there was a bug in the feature's implementation which was fixed in a later version.

note: I have informed the story format's developer about the lack of clarity in this feature's Since: section.

...