[Chameleon] problems modifying samples

Wheaton, William D. wdw at rti.org
Mon Feb 7 11:16:17 EST 2005


Hello--
 
I'm attempting to get the sample_enhanced.phtml sample working with my
own .map file and am having problems.  What I have done is to replace
the reference to chameleon.map with a reference to my map file and to
comment out the KEYMAP portion of the sample_enhanced.html file (since
my .map file doesn't have a reference map object in it.)
 
My basic configuration works (the other samples work and I did some work
with the helpfile/tutorials that worked).
 
When I open the sample_enhanced.phtml URL, I get two javascript error
popus (one says "image object for cwcimage_51 not found?" the other says
"image object for cwcimage_52 not found?"), then I briefly see the
"loading image" graphic and then in the map window I get the following
error:
 
Error rendering map image:
A fatal error has occurred restoring your session.
Please restart the application
 
The rest of the page looks OK (legend, zoom/pan buttons, etc., etc.)  I
can't figure out what the problem is and would appreciate any help.  I
know that my configuration works to the point where it does create map
.png files and can find them.  And the .map file I'm referencing works
OK outside of the samples environment.  But when hooking it into the
samples_enhanced framework, it doesn't seem to be creating the .png in
my /tmp directories and I can't figure out why not.
 
Here's the .map file that is being accessed:
  MAP
  NAME "MIDAS National Data"
  STATUS ON
  #EXTENT -125 24 -66 50
  EXTENT -3443611 2341541 2185646 6092248
  SIZE 600 400
  SHAPEPATH "data"
  #SYMBOLSET "/var/www/htdocs/midas/symbols.txt"
  #FONTSET "../etc/fonts.txt"
  IMAGETYPE PNG
  UNITS METERS
  PROJECTION
    "proj=aea"
    "ellps=GRS80"
    "lat_1=29.5n"
    "lat_2=45.5n"
    "lon_0=90w"
    "no_defs"
  END
  WEB
   #IMAGEPATH "/var/www/htdocs/gis/tmp/"
   IMAGEPATH "/ms4w/tmp/ms_tmp/"
   IMAGEURL "/ms_tmp/"
   TEMPLATE "querytemplate.html"
   LOG "/gis/tmp/logit.txt"
  END
  LEGEND
    STATUS OFF
    KEYSIZE 18 12
    LABEL
       TYPE BITMAP
       SIZE MEDIUM
       COLOR 0 0 89
    END
   TEMPLATE "/var/www/htdocs/midas/htdocs/legend.html"
  END
  QUERYMAP
    STATUS ON
    SIZE 300 300
    COLOR 178 40 100
    STYLE HILITE
  END
  LAYER
    NAME "Counties"
    GROUP "Base"
    STATUS ON
    DATA "the_geom from counties"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "user= password= dbname="
    SIZEUNITS PIXELS
    PROJECTION
       "proj=latlong"
       "ellps=clrk66"
    END
    METADATA
       LYRNAME "Counties"
    END
    CLASS
      NAME "Counties"
      STYLE
        COLOR 255 255 204
        OUTLINECOLOR 215 215 215
      END
    END
  END
  LAYER
    NAME "States"
    GROUP "Base"
    STATUS ON
    DATA "the_geom from states"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "user= password= dbname="
    SIZEUNITS PIXELS
    PROJECTION
       "proj=latlong"
       "ellps=clrk66"
    END
    METADATA
       LYRNAME "States"
    END
    CLASS
      NAME "States"
      STYLE
        OUTLINECOLOR 255 0 0
        SIZE 5
      END
    END
  END
END

Here's the sample_enhanced.html file:
<?php
/*
 * this is a sample of a minimal application script required to
 * get a chameleon application running with a template and a
 * local map file.  Most applications should actually just
 * copy this file and modify the template and mapfile
 * parts and should not need to do a lot more here.
 */
include( "../../htdocs/chameleon.php" );
 

$szTemplate = "./sample_enhanced.html";
#$szMapFile = "../map/chameleon.map";
$szMapFile = "../map/national.map";
 
class SampleApp extends Chameleon
{
  function SampleApp()
  {
    parent::Chameleon();
    $this->moMapSession = new MapSession_RW;
    $this->moMapSession->setTempDir( getSessionSavePath());
  }
}
 
$oApp =  new SampleApp();
$oApp->registerSkin( 'skins/sample' );
$oApp->CWCInitialize( $szTemplate, $szMapFile  );
$oApp->CWCExecute();
?>

 

-----------------------------------------
Bill Wheaton
RTI International
P.O. 12194, 3040 Cornwallis Rd.
RTP, NC 27709
wdw at rti.org, 919-541-6158 (V), 919-541-8830 (F)



 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050207/e519e5ad/attachment.html


More information about the Chameleon mailing list