Solved

Imagemap to select 2 points.

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

16 Experts available now in Live!

Get 1:1 Help Now