<html>
<head>
<script type="text/javascript">
function get_url(i, j)
{
var width = 256; //tile image width
var height = 256; //tile image height
var mapscale = 1500000; //desired stylization scale
var dpi=96;
var cx = 0; //map center
var cy = -750000; //map center
var metersPerUnit = 1.0; //map coordinate system unit scale
//compute mapping space tile delta
var dx = width / dpi * 2.54 / 100 * mapscale / metersPerUnit;
var dy = height / dpi * 2.54 / 100 * mapscale / metersPerUnit;
//compute requested tile center
var tcx = cx + dx * i;
var tcy = cy + dy * j;
var mdf = "Library://dude/dudemap.MapDefinition"; //desired map resource
var format = "PNG";
var url = "http://localhost:8008/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0&LOCALE=en";
url += "&MAPNAME=Streets";
url += "&MAPDEFINITION=" + mdf;
url += "&FORMAT=" + format;
url += "&SETVIEWCENTERX=" + tcx;
url += "&SETVIEWCENTERY=" + tcy;
url += "&SETVIEWSCALE=" + mapscale;
url += "&SETDISPLAYDPI=" + dpi;
url += "&SETDISPLAYWIDTH=" + width;
url += "&SETDISPLAYHEIGHT=" + height;
return url;
}
</script>
</head>
<body>
<script>
var numxtiles = 40;
var numytiles = 40;
for (j=Math.floor(numytiles/2); j>=Math.ceil(-(numytiles/2)); j--)
{
document.write("<nobr>");
for (i=Math.ceil(-(numxtiles/2)); i<=Math.floor(numxtiles/2); i++)
{
document.write("<img width=16 height=16 src=\"");
document.write(get_url(i,j));
document.write("\" />");
}
document.write("</nobr><br>"); //line break
}
</script>
</body>
</html>