[maplab-users] phpmapscript error

jive jive at aino.com.tw
Wed Jun 9 08:30:21 EDT 2004


Hi,
    I have compile mapserver 4.0.1 and phpmapscript succesful with vc6 and install on my server(windows 2003) well.
    I use phpmapscript to get map,it works fine,but when I use functions to get legend and scalebar,it is fail,and its error log 
    is PHP "Fatal error:  Call to a member function on a non-object in c:\apache\htdocs\test_draw_map.phtml on line 57".
    What is wrong  with it?
    Here is my php code:
  <HTML>
  <BODY BGCOLOR="#CCCCCC">
  <CENTER>
  <H1>PHP/MapScript module test</H1>
  <P>
  <?php
  $map_path="C:/maplab/tutorial/";
  $map = ms_newMapObj($map_path."mymap.map");

  $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);

  $img = $map->drawLegend();
  $url = $img->saveWebImage(MS_PNG, 0, 0, 0);
  printf("<P><IMG SRC=%s>\n", $url);

  $img = $map->drawScaleBar();
  $url = $img->saveWebImage(MS_PNG, 0, 0, 0);
  printf("<P><IMG SRC=%s>\n", $url);
  ?>
  </BODY>
  </HTML>
--
Jive Chang
Project Manager
AINOTECH Inc.
E-mail:jive at aino.com.tw
TEL:+886-2-2553-3652
FAX:+886-2-2553-2647
7F, No. 100, Sec. 3, Chung Hsiao East Road, Taipei 106, Taiwan, R.O.C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20040609/038af50d/attachment.htm


More information about the Maplab-users mailing list