Creating an html image <map> with a link that opens in a new window (target="_blank")
I'm trying to create an image map with the <map> html tag in the Feature Long Description. This works OK, however, I want the link to open in a new window/tab. Every time I try to add target="_blank" to the <area> tag the viewer seems to remove it from the final html.
Is there a way to stop this from happening?
Here's an example of the html below:
<h4>{Address}</h4>
<img src="https://maps.googleapis.com/maps/api/streetview?key=[insert-your-own-key-here]&location={Address}&size=350x200&fov=100&pitch=10" height="200px" usemap="#google"/>
<map name="google">
<area href="https://www.google.com.au/maps/place/{Address}" target="_blank" shape="rect" coords="0,175,67,200" alt="Google" />
</map>
0
-
Hi Jonathan,
The target attribute is being cleaned out by the viewer's code that renders the feature description. I've filed this as a bug since we should be allowing that.
In the meantime, you could avoid the issue by using a small transparent image in a floating <div> and a normal <a href="..."> tag. We explicitly allow the target attribute to be used on the <a> tag so this should work for you.
Regards,
-Malcolm0 -
Hi Malcom,
This is great. Thanks for the workaround :)
Regards,
Jonathan0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare