Solved

Imagemap to select 2 points.

Posted on 1997-02-26
2
187 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now