[Chameleon] problems modifying samples

Paul Spencer pspencer at dmsolutions.ca
Mon Feb 7 14:36:41 EST 2005


For the record, there have been several discussions regarding how to 
'disable' widgets.  The correct way with version 2.0 is to either delete 
it ;) or add enabled="false" to the attributes.  Adding enabled="false" 
allows you to keep it in your page, but the widget is completely skipped 
by Chameleon.

Cheers,

Paul

Wheaton, William D. wrote:
> Not silly at all.  That was indeed the problem.  I deleted the KEYMAP
> code in the template and it worked perfectly.  The popup messages
> dissapeared and the map rendered.  Your explanation of why commenting
> out didn't work is appreciated and I think will help others starting to
> use chameleon as well.
> 
> I guess we'll have to see if someone else can determine the cause of the
> error I got:
> 
> Error rendering map image:
> A fatal error has occurred restoring your session.
> Please restart the application
> 
> and why the issue of a 'commented out widget from the template' would
> cause that behavior.
> 
> Thanks again for the solution.
> 
> Bill
> -----------------------------------------
> 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)
>  
> 
> 
> -----Original Message-----
> From: Ken-ichi [mailto:kueda at wso.williams.edu] 
> Sent: Monday, February 07, 2005 12:13 PM
> To: Wheaton, William D.
> Cc: chameleon at lists.maptools.org
> Subject: Re: [Chameleon] problems modifying samples
> 
> 
> This may sound a bit silly, but did you try deleting the keymap code 
> from your template instead of commenting it out?  When you comment it 
> out in the HTML, Chameleon still sees the reference to the widget when 
> it parses the template, so although the widget output is commented out 
> in the final product, the associated JavaScript still gets written in, 
> and that usually makes reference to the image object that has been 
> commented out (hence the missing image error).  Not sure why your map 
> isn't rendering though.
> 
> -Ken-ichi
> 
> PS - It's a testament to the general responsiveness of this list that I 
> was tempted to include a Slashdotian "FIRST!" in the subject line.
> 
> Wheaton, William D. wrote:
> 
> 
>>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)
>>
>>
>>
>>
>>
>> 
>>
>>-----------------------------------------------------------------------
>>-
>>
>>_______________________________________________
>>Chameleon mailing list
>>Chameleon at lists.maptools.org 
>>http://lists.maptools.org/mailman/listinfo/chameleon
>> 
>>
> 
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list