Solved

Imagemap to select 2 points.

Posted on 1997-02-26
2
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

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 …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

617 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