function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alex ReadingAlex Reading 

Image Map in VisualForce Page

Hey All,

I was wondering how I can implement an image map in a visual force page that we are using.

Below is my current code:
<apex:page showheader="true" controller="imagemap">
<apex:form >
<apex:image value="{!$Resource.HomePageImage_BSJ6}" usemap="#mymap" />
<MAP name="mymap" id="mymap">
<LI><apex:outputLink value="" Shape="rect" Coords="700,360,870,200"></apex:outputlink></LI>

This code seems to display the image when viewing the page however there are no links and interactivity available from that image, can anyone help with image maps and their basic structure? Also - The above example is pointing to - What would I need to enter in the value once it is working to point to another VF Page? So I can navigate?

Any Help would be greatly appreciated!

Kind Regards,
Virendra ChouhanVirendra Chouhan
Hi Alex Reading,
You forget to write somthing between <apex:outputlink> </apex:outputlink>.

Use it like
<apex:outputLink value="" Shape="rect" Coords="700,360,870,200"> Click here </apex:outputlink>
This will show Click Here as a link.

Alex ReadingAlex Reading
@Virendra Choutan

Thanks for your response, thats helpful.

Although I actually don't want them to have to click text,

I want to have it so that if they click anywhere within those defined coordinates on the image and they are taken to either and external URL or another visualforce page.

I hope you can help.

Virendra ChouhanVirendra Chouhan
Hi Alex,

You don't want to have to click text.

if you want to click anywhere on the image .
Then use image tag under the outputLink
like this
<apex:outputLink value="" Shape="rect" Coords="700,360,870,200"> <apex:image value="{!$Resource.HomePageImage_BSJ6}" usemap="#mymap" />