Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Target coding for client-side image mapping for CD-ROM

Status
Not open for further replies.

grbosse

Technical User
Oct 31, 2000
13
CA
I have the map in .jpg and know how to do client-side image mapping. I want to link the map target from the text, i.e., clicking on "Chicago" or "Montreal", etc. in the text brings up the map, a 6000px x 14,000px map, with "Chicago" or "Montreal", etc. in the center of the screen.
 
to get the image centre of the screen you measure:

(screen.width-object.offsetWidth)/2
(screen.heigh-object.offsetHeight)/2

you can do this in CSS

left:expression(...);top:expression(...);

There are other methods aswell, but it depends on what exactly the object is, and whether the screen is the desktop or a browser window.

----------
I'm willing to trade custom scripts for... [see profile]
 
Stormbind,

Thanks for the css part in centering on the screen. The object is a 1837 nautical chart in .jpg. I want to be able to click on place names in the text and go directly to the location on the chart. Perhaps I could use
<a href=&quot;../1837/1837.htm#metis&quot;>Little Metis</a> with
<a name=&quot;metis&quot;></a> or something like that between the text and the chart, but that doesn't seem to work. The screen would be the browser window. I have 5,000 pages of text on my CD-ROM, in which I would like to be able to link the few hundred place-names directly to the chart.
 
If it's a very large image, I would be tempted to use clipping and Javascript. Incidentally, I use Javascript for everything so... humn... the fact that I suggest it doesn't mean CSS+HTML cannot do the task alone :p

Clipping chops off the edges of an element and I assume IMG tags are no different.

With that you could only show the portion of the map which matters and change the IMG position to put the cropped section in the middle of the screen.

Now I know this definately works in Netscape Navigator 4.x if you put the image inside a LAYER tag, so I'm assuming it works in newer browsers aswell.

The hard part would be collecting all the values, each region would need to have clipping values associated with it: top,left,height,width

----------
I'm willing to trade custom scripts for... [see profile]
 
Stormbind,

Thanks for the info. Actually, I have 39 Admiralty Charts between 1825 and 1837 varying in size from 20&quot; x 30&quot; to 40&quot;x 50&quot; in use to identify all the little places, bays, coves, reefs, etc. along nearly 1000 miles. I'm still some distance from getting the coding to make sense, and probably javascript will be the final solution. I'll experiment for a while with CSS and HTML, since a few place-names will probably work fine, but several hundred will probably slow down the CD-ROM too much if I continue using full size charts.

Again, many thanks.

G. R. Bossé at Metis Beach, QC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top