Solved

Imagemap to select 2 points.

Posted on 1997-02-26
2
190 Views
Last Modified: 2013-12-25
I'm writing some CGI applications.
I have a trouble which concernes with using ISMAP, but I think this must have happened to someone before. I'm trying to obtain from the user (client) two points (eg. source and
destination) from a single ISMAP .gif image. I'm working with apache1.2b6 over Solaris 2.3. First, I generate a HTML page asking the user to click over the first point. It makes the browser to send a GET query like this:       http://somewhere.net/coordinates.map?30,55
where coordinates.map is the name of the file where I have the coordinates of the relevant points of the image (!!over 110 points). When the server receives this, calls to the appropriate URL. This is another CGI to which I pass the point clicked. In the example it would be:
#Imagemap file coordinates.map
...
point /cgi-bin/choose-a-destination?src=Moscow 20,87
point /cgi-bin/choose-a-destination?src=London 30,55  # <--Closest point
point /cgi-bin/choose-a-destination?src=Madrid 70,21
...
which generates a HTML page that tells to the client that he choosed 'London' and asks for a second click, sending the second coordinates plus the src point. The question is : 1.- How can I generate such a page to call to another .map file, remembering the src field?.
(I tryed to generate /coordinates2.map?80,90&src=London but it doesn't work)
2.- I'm trying to make this whitn an stateless server. Can I do that?
Hope you can help me!!
0
Comment
Question by:jah
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
julio011597 earned 100 total points
ID: 1827730
I've never worked on this before, but here we go...

You could change to client-side imagemap'ing, and generate a first page (the 'source' page) containing this:

<MAP Name="a_map_name">
<AREA Shape="circle" Coords="20,87,10"
  Href="http://cgi_path/a_cgi?src=Moscow">
<AREA Shape="circle" Coords="30,55,10"
  Href="http://cgi_path/a_cgi?src=London">
...
</MAP>
...
<IMG Src="a_path/imagemap.gif" Usemap="#a_map_name" Ismap>

Now, when the user clicks on an imagemap spot, your cgi could process the query and - say it's src="London" - could output another page (the 'dest' page) containing this:

<MAP Name="a_map_name">
<AREA Shape="circle" Coords="20,87,10"
  Href="http://cgi_path/a_cgi?src=London&dest=Moscow">
<AREA Shape="circle" Coords="30,55,10"
  Href="http://cgi_path/a_cgi?src=London&dest=London">
...
</MAP>
...
<IMG Src="a_path/imagemap.gif" Usemap="#a_map_name" Ismap>

HTH
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1827731
After careful thinking (;-)), you could avoid sendind huge html pages making your cgi create a map file on the fly rather than sending those information on the client side.
The concept remains the same.

BTW, anybody in??
If you're in troubles with implementing what i've suggested, just ask back.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sed question 2 101
Need to learn promise API 2 55
AWK Code gives empty file, why? 12 36
Rename all files in a directory to numerical order 26 30
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
This article will show, step by step, how to integrate R code into a R Sweave document
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question