dbox print function
Steve Lime
Steve.Lime at DNR.STATE.MN.US
Fri Dec 15 09:54:41 PST 2006
Sam: The URL for the current map is held in ms.url, so you should be able to do something
like:
d.write("<img name=\"the_map\" src=\"" + ms.url + "\">");
Steve
>>> Sam Young <samnyoung at HOTMAIL.COM> 12/13/2006 4:22:10 PM >>>
I am trying to add a print function to my dbox application and I don't know
how to get the map image to show up in the new window I am creating.
This is my print function:
<script language="JavaScript">
function printmap() {
var w = window.open();
var d = w.document;
d.open();
d.write("<h3>Printable Map</h3>");
d.write("<img name=\"scalebar_miles\" src=\"" + ms.mapserver + "?map=" +
config.mapfile
+ "&mode=scalebar&mapext=0+0+" + (ms.extent[2] - ms.extent[0]) + "+" +
(ms.extent[3] - ms.extent[1]) + "&mapsize="
+ ms.width + "+" + ms.height + "\" border=\"0\">");
d.write("<img id=\"main\" src=\"../graphics/white_pixel.gif\" height=\"" +
mapsizey + "\" width=\"" + mapsizex + "\">");
d.close();
}
</script>
I added this to the tools to access the function:
<a href="javascript:printmap()" >
<img src="/graphics/print_icon.gif" width="30" height="30" border="0"
alt="print" /></a>
Thanks for the help.
Sam
_________________________________________________________________
View Athletes Collections with Live Search
http://sportmaps.live.com/index.html?source=hmemailtaglinenov06&FORM=MGAC01
More information about the MapServer-users
mailing list