test_draw_map.phtml

来自「Welcome to MS4W, the no fuss installer f」· PHTML 代码 · 共 70 行

PHTML
70
字号
<HTML><BODY BGCOLOR="#CCCCCC"><CENTER><H1>PHP/MapScript module test</H1><P> <?php//// This example opens a regular MapServer .MAP file, renders the main// Map image (with the default layers enabled), the legend and the // scale bar, and displays them in the HTML output.////// Load MapScript module.//if (PHP_OS == "WINNT" || PHP_OS == "WIN32"){  dl("php3_mapscript.dll");}else{  dl("php_mapscript.so");}// // Load MapServer .map file//// You can download the MapServer demo data from http://mapserver.gis.umn.edu///$map = ms_newMapObj("demo.map");// print $map->numlayers;// phpinfo(); //// RENDER MAIN MAP//// Note: If you get errors with the saveWebImage() call below, then make sure// that the directory specified by IMAGEPATH in the .MAP file exists and is// writable by the httpd user.//$img = $map->draw();$url = $img->saveWebImage(MS_PNG, 0, 0, 0);printf("<IMG SRC=%s WIDTH=%d HEIGHT=%d>\n", $url, $map->width, $map->height); //// LEGEND//$img = $map->drawLegend();$url = $img->saveWebImage(MS_PNG, 0, 0, 0);printf("<P><IMG SRC=%s>\n", $url); //// SCALE BAR//$img = $map->drawScaleBar();$url = $img->saveWebImage(MS_PNG, 0, 0, 0);printf("<P><IMG SRC=%s>\n", $url); ?> </BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?