Can anyone help me with this . . .?

liunx

Guest
I run a site were I list local business locations with maps. <br />
<br />
I'm wanting to make each map for each business come up in a new window that's smaller than the whole screen, that would include a "print this page" button, and a "close this window" button. <br />
<br />
Does anyone know where I can find code, or how to set up code to achive what I'm wanting to do? <br />
<br />
Any help any of you could pass along would be greatly appreciated. <br />
<br />
thanx,<br />
Rockrz<!--content-->You can check out this, not sure it quite the way you want to go, but you select US or Canada cities, Zoom in for a close up of all the streets and it also has a print option.<br />
<br />
<!-- m --><a class="postlink" href="http://ca.maps.yahoo.com/">http://ca.maps.yahoo.com/</a><!-- m --><!--content-->in your head tags put this.<br />
<br />
function popUp(pPage) {<br />
window.open(pPage,'popWin','resizable=yes,scrollbars=yes,width=580,height=460,toolbar=yes,location=y es');<br />
}<br />
<br />
then call it like this<br />
<A href=http://www.htmlforums.com/archive/index.php/"javascript: popUp('map.gif');"><IMG SRC = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"mapsmall.gif" border=0 alt="some text"><br />
<br />
that is one way, I'm sure there is more.<!--content-->Something like this?<br />
<br />
<br />
<html><br />
<head><br />
<title>map-o-matic</title><br />
<style type="text/css"><br />
<br />
a {<br />
font:400 18px "Comic Sans MS";<br />
color:peru;<br />
}<br />
<br />
</style><br />
<script language="JavaScript" type="text/javascript"><br />
<br />
var mapWin = null;<br />
var maps = new Array();<br />
var mapNames = new Array();<br />
maps[0] = 'http://m2.maps.yahoo.com/mqmapgend?MQMapGenRequest=FDR2dmwjDE%3bu70lr:HOEvq%3batgdf7:%29ualqrt5%26%40%24:%26%40%24g%26w72%26w 72%26MDUV';<br />
mapNames[0] = 'Sausalito';<br />
maps[1] = 'http://m2.maps.yahoo.com/mqmapgend?MQMapGenRequest=FDR2dmwjDE%3bu70lr:HOEvq%3bw20qr8:%29z7l04y:%26%40%24:%26%40y:q67:q67:VO%1 6P';<br />
mapNames[1] = 'Hyannis';<br />
maps[2] = 'http://m2.maps.yahoo.com/mqmapgend?MQMapGenRequest=FDR2dmwjDE%3bu70lr:HOEvq%3b0rsdzt:%29r2a0yt:%26%40%24:%26%40y:q67:q67:VO%1 6P';<br />
mapNames[2] = 'Key West';<br />
<br />
function openMapWin(mapNum) {<br />
var markUp = '<html><head><title>'+mapNames[mapNum]+'</title><style>';<br />
markUp += 'a{font:600 12px Arial;color:gold;text-decoration:none;}</style></head>';<br />
markUp += '<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" ';<br />
markUp += 'bgcolor="#333333"><img width="400" height="400" border=0 src=http://www.htmlforums.com/archive/index.php/"'+maps[mapNum]+'">';<br />
markUp += '<table width="100%" cellpadding="8" cellspacing="0" border="0"><tr>';<br />
markUp += '<td align="center">';<br />
markUp += '<a href=http://www.htmlforums.com/archive/index.php/"javascript:if(window.print)window.print()">Print It</a>';<br />
markUp += '</td><td align="center"><a href=http://www.htmlforums.com/archive/index.php/"javascript:self.close()">Close</a>';<br />
markUp += '</td></tr></table></body></html>';<br />
<br />
var w = 400; //popup width<br />
var h = 430; //popup height<br />
var l = screen.availWidth/2 - w/2;<br />
var t = screen.availHeight/2 - h/2;<br />
mapWin = open('','mapWin','width='+w+',height='+h+',left='+l+',top='+t+',status=0');<br />
mapWin.document.write(markUp);<br />
mapWin.document.close();<br />
mapWin.focus();<br />
}<br />
<br />
</script><br />
</head><br />
<body bgcolor="#000000"><br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="openMapWin(0);return false;">Sausalito</a><br><br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="openMapWin(1);return false;">Hyannis</a><br><br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="openMapWin(2);return false;">Key West</a><br><br />
</body><br />
</html><br />
<br />
<br />
Can't totally vouch for the window.print() call; it's somewhat browser-specific. Put your image (map) urls and map names in the arrays. Hope the maps are the same size...<!--content-->
 
Back
Top