You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alin Dosoniu <ad...@hotmail.com> on 2005/08/17 12:41:12 UTC

Re: How to find out the co-ordinates when I click on a world map(Image)?

Hi, 

You need to use usemap attribute of an img html element. Usemap attach a map defined in your html to the image and that map defines different areas on your image. The you can set specific link on every area from your image.

I sow something nice with images with map used in reports here:
http://www.jfree.org/jfreechart/index.php, Servlets, JSP. It is about the Cewolf Project.

Unfortunatelly, I don't know a nice tool to create a map for an image.

Hope this helps,
Alin.
  Hi,

  I have a world map which is an image and the user can click on any of the continent.
  Once a particular continent is clicked, the world map must be replaced by that continent's map and so on..

  Now, I have one image for each continent. The problem is how to know which continent was clicked upon in the world map?

  Any Ideas?

  Regards,
  Sunil

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi,
> Thank you very much for providing this useful information.
> I will try implementing it using your guidelines.
> I will let you know once I am done with it.
Still interested in my "area" code?
Maybe I find some time today to polish it and add it to a jira ticket 
where you can download it then.

Oh - and, the way I implemented it requires a little bit javascript 
(just to submit the form). It might be possible to avoid it, but that 
way I get some other form-data too and that's what I need.

---
Mario


Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Martin Marinschek <ma...@gmail.com>.
Maybe Sunil wants to take it over, polish it up and then donate it?

regards,

Martin

On 8/17/05, Mario Ivankovits <ma...@ops.co.at> wrote:
> Martin Marinschek wrote:
> >Ideally,
> >
> >you would build an image map JSF component.
> >
> I already created such a component,, but maybe its too limited to get
> added to myfaces.
> Its sort of "my first component" and maybe too restricted to my application.
> I used it in conjunction with jfreechart to be able to click into the graph.
> 
> It works like this:
> 
> <h:inputHidden id="annotateEvent" value="#{AnnotationForm.eventNumber}"/>
> <h:graphicImage
>         binding="#{EventDataProvider.image}"
>         url="#{EventDataProvider.url}"
>         alt="WateringData"
>         width="900"
>         height="600"
>         usemap="#CHART_TOOLTIP"
>         />
> <s:area
>         mapName = "CHART_TOOLTIP"
>         action = "annotateSpot"
>         areas="#{EventDataProvider.areas}"
>         destField="annotateEvent"
>         />
> 
> The hidden field is required for the s:area component (see destField=).
> With my knowledge today I could get rid of this hidden field.
> The areas are passed in through an ArrayList of ImageMapArea.java
> instances which is a simple bean with "shape, coords, title and data".
> data is the value you might find in "destField" then.
> 
> Sayed all that: If one find it useable that way I can contribute it.
> 
> 
> ---
> Mario
> 
> 


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
Hi,

I used <h:graphicImage> tag with usemap attribute in IBM's implementation of JSF and its working fine.
a code snippet :

<h:graphicImage style="border=0" id="graphicImageId"
url="/images/#{pc_TestView.imageName}"
usemap="#{pc_TestView.mapName}">
</h:graphicImage>

A sample map tag :

<MAP name="AU">
<AREA shape="rect" alt=""
onclick="return selectedArea('AU-MEL', this.form)"
coords="99,170,165,182" href="#">
<AREA shape="rect" alt=""
onclick="return selectedArea('AU-GLDV', this.form)"
coords="193,141,263,154" href="#">
</MAP>

I call a javascript 'selectedArea' and pass the value that I want in managed bean. I assign this value to a hidden jsf component 
in the javascript.
This way I am able to find out the clicked area and proceed further with my logic.

Hope this is useful in Myfaces also..:)

Regards,
Sunil


----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Friday, August 19, 2005 9:34 AM
Subject: Re: How to find out the co-ordinates when I click on a world map(Image)?


> Yes a world map will be tricky but this is still a cool solution :-)
> 
> sean
> 
> On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
>> Hi Sean,
>> 
>> Thanx for this useful information.
>> I searched a lot yesterday on this topic and I got the same information that
>> you have provided.
>> We can use image in the commandButton and can get the pixel coordinates when
>> clicked anywhere on the image.
>> And then this coordinate can be used to divide the image into various
>> regions.
>> 
>> The problem will be mapping if the image is complex like a world map and you
>> want to click on any country.
>> 
>> I am also looking into html IMG tag and usemap.
>> I can call a javascript on the <Area> tag and pass on a parameter and this
>> parameter can furthur be passed on to the managed bean.
>> I will try implementing this way and tell the result later on.
>> 
>> Thanx again for following it up!
>> 
>> Regards,
>> Sunil
>> 
>> ----- Original Message -----
>> From: "Sean Schofield" <se...@gmail.com>
>> To: "MyFaces Discussion" <us...@myfaces.apache.org>
>> Sent: Friday, August 19, 2005 3:54 AM
>> Subject: Re: How to find out the co-ordinates when I click on a world
>> map(Image)?
>> 
>> 
>> >I am in the process of re-reading the excellent Core JSF book by Geary
>> > and Horstmann.  (I had initially only skimmed it having already read 3
>> > other JSF books.)  There are some interesting nuggets in there
>> > including the following:
>> >
>> > According to them, you can do this with <h:commandButton> and a
>> > combination of action and actionListener.
>> >
>> > <h:commandButton image="foo.jpg" actionListener="#{backer.listen}"
>> > action="#{backer.act}"/>
>> >
>> > I was suprised that you can apparently get the mouse click coordinates
>> > from the listener ... you can then set a variable in the backer so
>> > that your action method can use it in navigation (if that's what you
>> > need.)
>> >
>> > public void listen(ActionEvent e)
>> > {
>> >   ...
>> >
>> >   Map requestParams =
>> > context.getExternalContext().getRequestParameterMap();
>> >   int x = new Integer((String)requestParams.get(clientId +
>> > ".x")).intValue();
>> >
>> >   ...
>> > }
>> >
>> > There is more great stuff like this in Core JSF so check it out!
>> >
>> > sean
>> >
>> >
>> > On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
>> >> Hi,
>> >>
>> >> Cld you give me this component so that I can try implementing the same on
>> >> websphere?
>> >>
>> >> Thanx
>> >> Sunil
>> >>
>> >> ----- Original Message -----
>> >> From: "Mario Ivankovits" <ma...@ops.co.at>
>> >> To: "MyFaces Discussion" <us...@myfaces.apache.org>
>> >> Sent: Wednesday, August 17, 2005 7:24 PM
>> >> Subject: Re: How to find out the co-ordinates when I click on a world
>> >> map(Image)?
>> >>
>> >>
>> >> > Martin Marinschek wrote:
>> >> >>Ideally,
>> >> >>
>> >> >>you would build an image map JSF component.
>> >> >>
>> >> > I already created such a component,, but maybe its too limited to get
>> >> > added to myfaces.
>> >> > Its sort of "my first component" and maybe too restricted to my
>> >> > application.
>> >> > I used it in conjunction with jfreechart to be able to click into the
>> >> > graph.
>> >> >
>> >> > It works like this:
>> >> >
>> >> > <h:inputHidden id="annotateEvent"
>> >> > value="#{AnnotationForm.eventNumber}"/>
>> >> > <h:graphicImage
>> >> >        binding="#{EventDataProvider.image}"
>> >> >        url="#{EventDataProvider.url}"
>> >> >        alt="WateringData"
>> >> >        width="900"
>> >> >        height="600"
>> >> >        usemap="#CHART_TOOLTIP"
>> >> >        />
>> >> > <s:area
>> >> >        mapName = "CHART_TOOLTIP"
>> >> >        action = "annotateSpot"
>> >> >        areas="#{EventDataProvider.areas}"
>> >> >        destField="annotateEvent"
>> >> >        />
>> >> >
>> >> > The hidden field is required for the s:area component (see destField=).
>> >> > With my knowledge today I could get rid of this hidden field.
>> >> > The areas are passed in through an ArrayList of ImageMapArea.java
>> >> > instances which is a simple bean with "shape, coords, title and data".
>> >> > data is the value you might find in "destField" then.
>> >> >
>> >> > Sayed all that: If one find it useable that way I can contribute it.
>> >> >
>> >> >
>> >> > ---
>> >> > Mario
>> >>
>> >>
>> 
>>

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sean Schofield <se...@gmail.com>.
Yes a world map will be tricky but this is still a cool solution :-)

sean

On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
> Hi Sean,
> 
> Thanx for this useful information.
> I searched a lot yesterday on this topic and I got the same information that
> you have provided.
> We can use image in the commandButton and can get the pixel coordinates when
> clicked anywhere on the image.
> And then this coordinate can be used to divide the image into various
> regions.
> 
> The problem will be mapping if the image is complex like a world map and you
> want to click on any country.
> 
> I am also looking into html IMG tag and usemap.
> I can call a javascript on the <Area> tag and pass on a parameter and this
> parameter can furthur be passed on to the managed bean.
> I will try implementing this way and tell the result later on.
> 
> Thanx again for following it up!
> 
> Regards,
> Sunil
> 
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> Sent: Friday, August 19, 2005 3:54 AM
> Subject: Re: How to find out the co-ordinates when I click on a world
> map(Image)?
> 
> 
> >I am in the process of re-reading the excellent Core JSF book by Geary
> > and Horstmann.  (I had initially only skimmed it having already read 3
> > other JSF books.)  There are some interesting nuggets in there
> > including the following:
> >
> > According to them, you can do this with <h:commandButton> and a
> > combination of action and actionListener.
> >
> > <h:commandButton image="foo.jpg" actionListener="#{backer.listen}"
> > action="#{backer.act}"/>
> >
> > I was suprised that you can apparently get the mouse click coordinates
> > from the listener ... you can then set a variable in the backer so
> > that your action method can use it in navigation (if that's what you
> > need.)
> >
> > public void listen(ActionEvent e)
> > {
> >   ...
> >
> >   Map requestParams =
> > context.getExternalContext().getRequestParameterMap();
> >   int x = new Integer((String)requestParams.get(clientId +
> > ".x")).intValue();
> >
> >   ...
> > }
> >
> > There is more great stuff like this in Core JSF so check it out!
> >
> > sean
> >
> >
> > On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
> >> Hi,
> >>
> >> Cld you give me this component so that I can try implementing the same on
> >> websphere?
> >>
> >> Thanx
> >> Sunil
> >>
> >> ----- Original Message -----
> >> From: "Mario Ivankovits" <ma...@ops.co.at>
> >> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >> Sent: Wednesday, August 17, 2005 7:24 PM
> >> Subject: Re: How to find out the co-ordinates when I click on a world
> >> map(Image)?
> >>
> >>
> >> > Martin Marinschek wrote:
> >> >>Ideally,
> >> >>
> >> >>you would build an image map JSF component.
> >> >>
> >> > I already created such a component,, but maybe its too limited to get
> >> > added to myfaces.
> >> > Its sort of "my first component" and maybe too restricted to my
> >> > application.
> >> > I used it in conjunction with jfreechart to be able to click into the
> >> > graph.
> >> >
> >> > It works like this:
> >> >
> >> > <h:inputHidden id="annotateEvent"
> >> > value="#{AnnotationForm.eventNumber}"/>
> >> > <h:graphicImage
> >> >        binding="#{EventDataProvider.image}"
> >> >        url="#{EventDataProvider.url}"
> >> >        alt="WateringData"
> >> >        width="900"
> >> >        height="600"
> >> >        usemap="#CHART_TOOLTIP"
> >> >        />
> >> > <s:area
> >> >        mapName = "CHART_TOOLTIP"
> >> >        action = "annotateSpot"
> >> >        areas="#{EventDataProvider.areas}"
> >> >        destField="annotateEvent"
> >> >        />
> >> >
> >> > The hidden field is required for the s:area component (see destField=).
> >> > With my knowledge today I could get rid of this hidden field.
> >> > The areas are passed in through an ArrayList of ImageMapArea.java
> >> > instances which is a simple bean with "shape, coords, title and data".
> >> > data is the value you might find in "destField" then.
> >> >
> >> > Sayed all that: If one find it useable that way I can contribute it.
> >> >
> >> >
> >> > ---
> >> > Mario
> >>
> >>
> 
>

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
Hi Sean,

Thanx for this useful information.
I searched a lot yesterday on this topic and I got the same information that 
you have provided.
We can use image in the commandButton and can get the pixel coordinates when 
clicked anywhere on the image.
And then this coordinate can be used to divide the image into various 
regions.

The problem will be mapping if the image is complex like a world map and you 
want to click on any country.

I am also looking into html IMG tag and usemap.
I can call a javascript on the <Area> tag and pass on a parameter and this 
parameter can furthur be passed on to the managed bean.
I will try implementing this way and tell the result later on.

Thanx again for following it up!

Regards,
Sunil

----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Friday, August 19, 2005 3:54 AM
Subject: Re: How to find out the co-ordinates when I click on a world 
map(Image)?


>I am in the process of re-reading the excellent Core JSF book by Geary
> and Horstmann.  (I had initially only skimmed it having already read 3
> other JSF books.)  There are some interesting nuggets in there
> including the following:
>
> According to them, you can do this with <h:commandButton> and a
> combination of action and actionListener.
>
> <h:commandButton image="foo.jpg" actionListener="#{backer.listen}"
> action="#{backer.act}"/>
>
> I was suprised that you can apparently get the mouse click coordinates
> from the listener ... you can then set a variable in the backer so
> that your action method can use it in navigation (if that's what you
> need.)
>
> public void listen(ActionEvent e)
> {
>   ...
>
>   Map requestParams = 
> context.getExternalContext().getRequestParameterMap();
>   int x = new Integer((String)requestParams.get(clientId + 
> ".x")).intValue();
>
>   ...
> }
>
> There is more great stuff like this in Core JSF so check it out!
>
> sean
>
>
> On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
>> Hi,
>>
>> Cld you give me this component so that I can try implementing the same on
>> websphere?
>>
>> Thanx
>> Sunil
>>
>> ----- Original Message -----
>> From: "Mario Ivankovits" <ma...@ops.co.at>
>> To: "MyFaces Discussion" <us...@myfaces.apache.org>
>> Sent: Wednesday, August 17, 2005 7:24 PM
>> Subject: Re: How to find out the co-ordinates when I click on a world
>> map(Image)?
>>
>>
>> > Martin Marinschek wrote:
>> >>Ideally,
>> >>
>> >>you would build an image map JSF component.
>> >>
>> > I already created such a component,, but maybe its too limited to get
>> > added to myfaces.
>> > Its sort of "my first component" and maybe too restricted to my
>> > application.
>> > I used it in conjunction with jfreechart to be able to click into the
>> > graph.
>> >
>> > It works like this:
>> >
>> > <h:inputHidden id="annotateEvent" 
>> > value="#{AnnotationForm.eventNumber}"/>
>> > <h:graphicImage
>> >        binding="#{EventDataProvider.image}"
>> >        url="#{EventDataProvider.url}"
>> >        alt="WateringData"
>> >        width="900"
>> >        height="600"
>> >        usemap="#CHART_TOOLTIP"
>> >        />
>> > <s:area
>> >        mapName = "CHART_TOOLTIP"
>> >        action = "annotateSpot"
>> >        areas="#{EventDataProvider.areas}"
>> >        destField="annotateEvent"
>> >        />
>> >
>> > The hidden field is required for the s:area component (see destField=).
>> > With my knowledge today I could get rid of this hidden field.
>> > The areas are passed in through an ArrayList of ImageMapArea.java
>> > instances which is a simple bean with "shape, coords, title and data".
>> > data is the value you might find in "destField" then.
>> >
>> > Sayed all that: If one find it useable that way I can contribute it.
>> >
>> >
>> > ---
>> > Mario
>>
>> 


Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sean Schofield <se...@gmail.com>.
I am in the process of re-reading the excellent Core JSF book by Geary
and Horstmann.  (I had initially only skimmed it having already read 3
other JSF books.)  There are some interesting nuggets in there
including the following:

According to them, you can do this with <h:commandButton> and a
combination of action and actionListener.

<h:commandButton image="foo.jpg" actionListener="#{backer.listen}"
action="#{backer.act}"/>

I was suprised that you can apparently get the mouse click coordinates
from the listener ... you can then set a variable in the backer so
that your action method can use it in navigation (if that's what you
need.)

public void listen(ActionEvent e)
{
   ...

   Map requestParams = context.getExternalContext().getRequestParameterMap();
   int x = new Integer((String)requestParams.get(clientId + ".x")).intValue();

   ...
}

There is more great stuff like this in Core JSF so check it out!

sean


On 8/18/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
> Hi,
> 
> Cld you give me this component so that I can try implementing the same on
> websphere?
> 
> Thanx
> Sunil
> 
> ----- Original Message -----
> From: "Mario Ivankovits" <ma...@ops.co.at>
> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> Sent: Wednesday, August 17, 2005 7:24 PM
> Subject: Re: How to find out the co-ordinates when I click on a world
> map(Image)?
> 
> 
> > Martin Marinschek wrote:
> >>Ideally,
> >>
> >>you would build an image map JSF component.
> >>
> > I already created such a component,, but maybe its too limited to get
> > added to myfaces.
> > Its sort of "my first component" and maybe too restricted to my
> > application.
> > I used it in conjunction with jfreechart to be able to click into the
> > graph.
> >
> > It works like this:
> >
> > <h:inputHidden id="annotateEvent" value="#{AnnotationForm.eventNumber}"/>
> > <h:graphicImage
> >        binding="#{EventDataProvider.image}"
> >        url="#{EventDataProvider.url}"
> >        alt="WateringData"
> >        width="900"
> >        height="600"
> >        usemap="#CHART_TOOLTIP"
> >        />
> > <s:area
> >        mapName = "CHART_TOOLTIP"
> >        action = "annotateSpot"
> >        areas="#{EventDataProvider.areas}"
> >        destField="annotateEvent"
> >        />
> >
> > The hidden field is required for the s:area component (see destField=).
> > With my knowledge today I could get rid of this hidden field.
> > The areas are passed in through an ArrayList of ImageMapArea.java
> > instances which is a simple bean with "shape, coords, title and data".
> > data is the value you might find in "destField" then.
> >
> > Sayed all that: If one find it useable that way I can contribute it.
> >
> >
> > ---
> > Mario
> 
>

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
Hi,

Cld you give me this component so that I can try implementing the same on 
websphere?

Thanx
Sunil

----- Original Message ----- 
From: "Mario Ivankovits" <ma...@ops.co.at>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, August 17, 2005 7:24 PM
Subject: Re: How to find out the co-ordinates when I click on a world 
map(Image)?


> Martin Marinschek wrote:
>>Ideally,
>>
>>you would build an image map JSF component.
>>
> I already created such a component,, but maybe its too limited to get 
> added to myfaces.
> Its sort of "my first component" and maybe too restricted to my 
> application.
> I used it in conjunction with jfreechart to be able to click into the 
> graph.
>
> It works like this:
>
> <h:inputHidden id="annotateEvent" value="#{AnnotationForm.eventNumber}"/>
> <h:graphicImage
>        binding="#{EventDataProvider.image}"
>        url="#{EventDataProvider.url}"
>        alt="WateringData"
>        width="900"
>        height="600"
>        usemap="#CHART_TOOLTIP"
>        />
> <s:area
>        mapName = "CHART_TOOLTIP"
>        action = "annotateSpot"
>        areas="#{EventDataProvider.areas}"
>        destField="annotateEvent"
>        />
>
> The hidden field is required for the s:area component (see destField=). 
> With my knowledge today I could get rid of this hidden field.
> The areas are passed in through an ArrayList of ImageMapArea.java 
> instances which is a simple bean with "shape, coords, title and data". 
> data is the value you might find in "destField" then.
>
> Sayed all that: If one find it useable that way I can contribute it.
>
>
> ---
> Mario 


Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Martin Marinschek wrote:
>Ideally,
>
>you would build an image map JSF component.
>  
I already created such a component,, but maybe its too limited to get 
added to myfaces.
Its sort of "my first component" and maybe too restricted to my application.
I used it in conjunction with jfreechart to be able to click into the graph.

It works like this:

<h:inputHidden id="annotateEvent" value="#{AnnotationForm.eventNumber}"/>
<h:graphicImage
        binding="#{EventDataProvider.image}"
        url="#{EventDataProvider.url}"
        alt="WateringData"
        width="900"
        height="600"
        usemap="#CHART_TOOLTIP"
        />
<s:area
        mapName = "CHART_TOOLTIP"
        action = "annotateSpot"
        areas="#{EventDataProvider.areas}"
        destField="annotateEvent"
        />

The hidden field is required for the s:area component (see destField=). 
With my knowledge today I could get rid of this hidden field.
The areas are passed in through an ArrayList of ImageMapArea.java 
instances which is a simple bean with "shape, coords, title and data". 
data is the value you might find in "destField" then.

Sayed all that: If one find it useable that way I can contribute it.


---
Mario


Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
I wld have loved to build this component and that will help me understand 
JSF in much more detail.

But I havnt developed any component yet.
The real problem is that I am working on IBM's implementation of JSF and its 
not compatible with MyFaces.

I joined this community coz this is the most happening place for JSF related 
issues.
It helps me a lot with JSF issues.

Hats off to all the people of this community who have been working to polish 
MyFaces by adding new components and
by resolving oustanding issues.

Regards,
Sunil

----- Original Message ----- 
From: "Martin Marinschek" <ma...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, August 17, 2005 7:12 PM
Subject: Re: How to find out the co-ordinates when I click on a world 
map(Image)?


> Ideally,
>
> you would build an image map JSF component.
>
> If you do that, think about donating it to MyFaces ;)
>
> regards,
>
> Martin
>
> On 8/17/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
>>
>> Hi,
>>
>> Thank you very much for providing this useful information.
>> I will try implementing it using your guidelines.
>> I will let you know once I am done with it.
>>
>> Thanx again.
>> -Sunil
>>
>> ----- Original Message ----- 
>> From: Alin Dosoniu
>> To: MyFaces Discussion
>>
>> Sent: Wednesday, August 17, 2005 6:55 PM
>> Subject: Re: How to find out the co-ordinates when I click on a world
>> map(Image)?
>>
>>
>> Hi,
>>
>> Now I see the problem. I don't know how this can be done with JSF. I know
>> there are some reporting products that offer JSF compoenents. You can 
>> find
>> them here http://www.jsfcentral.com/products/index.html.
>> Maybe some of them are free or have a trial and you can see how they are
>> doing.
>>
>> In my opinion, what you want cannot be done with t:graphicImage or
>> h:graphicImage. I mean, I saw that t:graphicImage has the usemap 
>> attribute
>> but that is only to can specify the usemap. In <AREA> tag from <MAP>, you
>> have to link a jsp or servlet and there to take care to set your bean
>> members.
>>
>> <MAP NAME="jfreechart-30455.png">
>> <AREA SHAPE="RECT" COORDS="106,15,177,251" title="(Hits, Catalog) =
>> 3,797,300" href="xy_chart.jsp?series=Hits&section=Catalog">
>> <AREA SHAPE="RECT" COORDS="204,208,275,251" title="(Hits, Checkout) =
>> 702,959" href="xy_chart.jsp?series=Hits&section=Checkout">
>> <AREA SHAPE="RECT" COORDS="302,195,373,251" title="(Hits, Tracking) =
>> 903,258" href="xy_chart.jsp?series=Hits&section=Tracking">
>> <AREA SHAPE="RECT" COORDS="400,208,471,251" title="(Hits, Service) =
>> 702,013" href="xy_chart.jsp?series=Hits&section=Service">
>> </MAP>
>>
>> Alin.
>>
>>
>> Hi,
>>
>> Thanx a lot for your prompt reply.
>> The main problem is to set specific links on every area from the image.
>> I need to set command links instead of html href.
>>
>> There will be only one command link for the image. It shd be able to know
>> which part has been clicked and then I shd be able
>> to send it as parameter to the action method in managed bean. Here, I can
>> decide depending on the parameter received the next image to be displayed
>> on the same page.
>>
>> Do you have any idea how to implement it using JSF components?
>>
>> Regards,
>> Sunil
>>
>> ----- Original Message ----- 
>> From: Alin Dosoniu
>> To: MyFaces Discussion
>> Sent: Wednesday, August 17, 2005 4:11 PM
>> Subject: Re: How to find out the co-ordinates when I click on a world
>> map(Image)?
>>
>>
>> Hi,
>>
>> You need to use usemap attribute of an img html element. Usemap attach a 
>> map
>> defined in your html to the image and that map defines different areas on
>> your image. The you can set specific link on every area from your image.
>>
>> I sow something nice with images with map used in reports here:
>> http://www.jfree.org/jfreechart/index.php, Servlets, JSP.
>> It is about the Cewolf Project.
>>
>> Unfortunatelly, I don't know a nice tool to create a map for an image.
>>
>> Hope this helps,
>> Alin.
>>
>> Hi,
>>
>> I have a world map which is an image and the user can click on any of the
>> continent.
>> Once a particular continent is clicked, the world map must be replaced by
>> that continent's map and so on..
>>
>> Now, I have one image for each continent. The problem is how to know 
>> which
>> continent was clicked upon in the world map?
>>
>> Any Ideas?
>>
>> Regards,
>> Sunil
>
>
> -- 
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German 


Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Martin Marinschek <ma...@gmail.com>.
Ideally,

you would build an image map JSF component.

If you do that, think about donating it to MyFaces ;)

regards,

Martin

On 8/17/05, Sunil Tiwari <su...@tatainfotech.com> wrote:
>  
> Hi, 
>   
> Thank you very much for providing this useful information. 
> I will try implementing it using your guidelines. 
> I will let you know once I am done with it. 
>   
> Thanx again. 
> -Sunil 
>  
> ----- Original Message ----- 
> From: Alin Dosoniu 
> To: MyFaces Discussion 
>  
> Sent: Wednesday, August 17, 2005 6:55 PM 
> Subject: Re: How to find out the co-ordinates when I click on a world
> map(Image)? 
> 
>  
> Hi, 
>   
> Now I see the problem. I don't know how this can be done with JSF. I know
> there are some reporting products that offer JSF compoenents. You can find
> them here http://www.jsfcentral.com/products/index.html.
> Maybe some of them are free or have a trial and you can see how they are
> doing. 
>   
> In my opinion, what you want cannot be done with t:graphicImage or
> h:graphicImage. I mean, I saw that t:graphicImage has the usemap attribute
> but that is only to can specify the usemap. In <AREA> tag from <MAP>, you
> have to link a jsp or servlet and there to take care to set your bean
> members. 
>   
> <MAP NAME="jfreechart-30455.png">
> <AREA SHAPE="RECT" COORDS="106,15,177,251" title="(Hits, Catalog) =
> 3,797,300" href="xy_chart.jsp?series=Hits&section=Catalog">
> <AREA SHAPE="RECT" COORDS="204,208,275,251" title="(Hits, Checkout) =
> 702,959" href="xy_chart.jsp?series=Hits&section=Checkout">
> <AREA SHAPE="RECT" COORDS="302,195,373,251" title="(Hits, Tracking) =
> 903,258" href="xy_chart.jsp?series=Hits&section=Tracking">
> <AREA SHAPE="RECT" COORDS="400,208,471,251" title="(Hits, Service) =
> 702,013" href="xy_chart.jsp?series=Hits&section=Service">
> </MAP>
>  
> Alin.
>  
>  
> Hi, 
>   
> Thanx a lot for your prompt reply. 
> The main problem is to set specific links on every area from the image. 
> I need to set command links instead of html href. 
>   
> There will be only one command link for the image. It shd be able to know
> which part has been clicked and then I shd be able 
> to send it as parameter to the action method in managed bean. Here, I can
> decide depending on the parameter received the next image to be displayed 
> on the same page. 
>   
> Do you have any idea how to implement it using JSF components? 
>   
> Regards, 
> Sunil 
>  
> ----- Original Message ----- 
> From: Alin Dosoniu 
> To: MyFaces Discussion 
> Sent: Wednesday, August 17, 2005 4:11 PM 
> Subject: Re: How to find out the co-ordinates when I click on a world
> map(Image)? 
> 
>  
> Hi, 
>   
> You need to use usemap attribute of an img html element. Usemap attach a map
> defined in your html to the image and that map defines different areas on
> your image. The you can set specific link on every area from your image. 
>   
> I sow something nice with images with map used in reports here: 
> http://www.jfree.org/jfreechart/index.php, Servlets, JSP.
> It is about the Cewolf Project. 
>   
> Unfortunatelly, I don't know a nice tool to create a map for an image. 
>   
> Hope this helps, 
> Alin. 
>  
> Hi, 
>   
> I have a world map which is an image and the user can click on any of the
> continent. 
> Once a particular continent is clicked, the world map must be replaced by
> that continent's map and so on.. 
>   
> Now, I have one image for each continent. The problem is how to know which
> continent was clicked upon in the world map? 
>   
> Any Ideas? 
>   
> Regards, 
> Sunil 


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
Hi,

Thank you very much for providing this useful information.
I will try implementing it using your guidelines.
I will let you know once I am done with it.

Thanx again.
-Sunil
  ----- Original Message ----- 
  From: Alin Dosoniu 
  To: MyFaces Discussion 
  Sent: Wednesday, August 17, 2005 6:55 PM
  Subject: Re: How to find out the co-ordinates when I click on a world map(Image)?


  Hi, 

  Now I see the problem. I don't know how this can be done with JSF. I know there are some reporting products that offer JSF compoenents. You can find them here http://www.jsfcentral.com/products/index.html. Maybe some of them are free or have a trial and you can see how they are doing.

  In my opinion, what you want cannot be done with t:graphicImage or h:graphicImage. I mean, I saw that t:graphicImage has the usemap attribute but that is only to can specify the usemap. In <AREA> tag from <MAP>, you have to link a jsp or servlet and there to take care to set your bean members.

  <MAP NAME="jfreechart-30455.png">
  <AREA SHAPE="RECT" COORDS="106,15,177,251" title="(Hits, Catalog) = 3,797,300" href="xy_chart.jsp?series=Hits&section=Catalog">
  <AREA SHAPE="RECT" COORDS="204,208,275,251" title="(Hits, Checkout) = 702,959" href="xy_chart.jsp?series=Hits&section=Checkout">
  <AREA SHAPE="RECT" COORDS="302,195,373,251" title="(Hits, Tracking) = 903,258" href="xy_chart.jsp?series=Hits&section=Tracking">
  <AREA SHAPE="RECT" COORDS="400,208,471,251" title="(Hits, Service) = 702,013" href="xy_chart.jsp?series=Hits&section=Service">
  </MAP>

  Alin.

    Hi,

    Thanx a lot for your prompt reply.
    The main problem is to set specific links on every area from the image.
    I need to set command links instead of html href.

    There will be only one command link for the image. It shd be able to know which part has been clicked and then I shd be able
    to send it as parameter to the action method in managed bean. Here, I can decide depending on the parameter received the next image to be displayed
    on the same page.

    Do you have any idea how to implement it using JSF components?

    Regards,
    Sunil
      ----- Original Message ----- 
      From: Alin Dosoniu 
      To: MyFaces Discussion 
      Sent: Wednesday, August 17, 2005 4:11 PM
      Subject: Re: How to find out the co-ordinates when I click on a world map(Image)?


      Hi, 

      You need to use usemap attribute of an img html element. Usemap attach a map defined in your html to the image and that map defines different areas on your image. The you can set specific link on every area from your image.

      I sow something nice with images with map used in reports here:
      http://www.jfree.org/jfreechart/index.php, Servlets, JSP. It is about the Cewolf Project.

      Unfortunatelly, I don't know a nice tool to create a map for an image.

      Hope this helps,
      Alin.
        Hi,

        I have a world map which is an image and the user can click on any of the continent.
        Once a particular continent is clicked, the world map must be replaced by that continent's map and so on..

        Now, I have one image for each continent. The problem is how to know which continent was clicked upon in the world map?

        Any Ideas?

        Regards,
        Sunil

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Alin Dosoniu <ad...@hotmail.com>.
Hi, 

Now I see the problem. I don't know how this can be done with JSF. I know there are some reporting products that offer JSF compoenents. You can find them here http://www.jsfcentral.com/products/index.html. Maybe some of them are free or have a trial and you can see how they are doing.

In my opinion, what you want cannot be done with t:graphicImage or h:graphicImage. I mean, I saw that t:graphicImage has the usemap attribute but that is only to can specify the usemap. In <AREA> tag from <MAP>, you have to link a jsp or servlet and there to take care to set your bean members.

<MAP NAME="jfreechart-30455.png">
<AREA SHAPE="RECT" COORDS="106,15,177,251" title="(Hits, Catalog) = 3,797,300" href="xy_chart.jsp?series=Hits&section=Catalog">
<AREA SHAPE="RECT" COORDS="204,208,275,251" title="(Hits, Checkout) = 702,959" href="xy_chart.jsp?series=Hits&section=Checkout">
<AREA SHAPE="RECT" COORDS="302,195,373,251" title="(Hits, Tracking) = 903,258" href="xy_chart.jsp?series=Hits&section=Tracking">
<AREA SHAPE="RECT" COORDS="400,208,471,251" title="(Hits, Service) = 702,013" href="xy_chart.jsp?series=Hits&section=Service">
</MAP>

Alin.

  Hi,

  Thanx a lot for your prompt reply.
  The main problem is to set specific links on every area from the image.
  I need to set command links instead of html href.

  There will be only one command link for the image. It shd be able to know which part has been clicked and then I shd be able
  to send it as parameter to the action method in managed bean. Here, I can decide depending on the parameter received the next image to be displayed
  on the same page.

  Do you have any idea how to implement it using JSF components?

  Regards,
  Sunil
    ----- Original Message ----- 
    From: Alin Dosoniu 
    To: MyFaces Discussion 
    Sent: Wednesday, August 17, 2005 4:11 PM
    Subject: Re: How to find out the co-ordinates when I click on a world map(Image)?


    Hi, 

    You need to use usemap attribute of an img html element. Usemap attach a map defined in your html to the image and that map defines different areas on your image. The you can set specific link on every area from your image.

    I sow something nice with images with map used in reports here:
    http://www.jfree.org/jfreechart/index.php, Servlets, JSP. It is about the Cewolf Project.

    Unfortunatelly, I don't know a nice tool to create a map for an image.

    Hope this helps,
    Alin.
      Hi,

      I have a world map which is an image and the user can click on any of the continent.
      Once a particular continent is clicked, the world map must be replaced by that continent's map and so on..

      Now, I have one image for each continent. The problem is how to know which continent was clicked upon in the world map?

      Any Ideas?

      Regards,
      Sunil

Re: How to find out the co-ordinates when I click on a world map(Image)?

Posted by Sunil Tiwari <su...@tatainfotech.com>.
Hi,

Thanx a lot for your prompt reply.
The main problem is to set specific links on every area from the image.
I need to set command links instead of html href.

There will be only one command link for the image. It shd be able to know which part has been clicked and then I shd be able
to send it as parameter to the action method in managed bean. Here, I can decide depending on the parameter received the next image to be displayed
on the same page.

Do you have any idea how to implement it using JSF components?

Regards,
Sunil
  ----- Original Message ----- 
  From: Alin Dosoniu 
  To: MyFaces Discussion 
  Sent: Wednesday, August 17, 2005 4:11 PM
  Subject: Re: How to find out the co-ordinates when I click on a world map(Image)?


  Hi, 

  You need to use usemap attribute of an img html element. Usemap attach a map defined in your html to the image and that map defines different areas on your image. The you can set specific link on every area from your image.

  I sow something nice with images with map used in reports here:
  http://www.jfree.org/jfreechart/index.php, Servlets, JSP. It is about the Cewolf Project.

  Unfortunatelly, I don't know a nice tool to create a map for an image.

  Hope this helps,
  Alin.
    Hi,

    I have a world map which is an image and the user can click on any of the continent.
    Once a particular continent is clicked, the world map must be replaced by that continent's map and so on..

    Now, I have one image for each continent. The problem is how to know which continent was clicked upon in the world map?

    Any Ideas?

    Regards,
    Sunil