[Chameleon] PrintProduction error

Paul Spencer pspencer at dmsolutions.ca
Thu Feb 24 18:46:59 EST 2005


very odd.  the layers in chameleon.map have status on, not default IIRC. 
  There is probably some code in the print stuff that is only checking 
to see if the layer status in MS_ON instead of checking if it is either 
MS_ON or MS_DEFAULT.  That's happened before.

But I don't know why your layers would turn off if you used ON instead 
of DEFAULT in the main app ... unless you are using the LegendTemplate 
widget with a custom legend template that is not set up right?

Paul

Ken-ichi wrote:
> Ok, I have a partial answer.  All the layers in my mapfile had STATUS 
> DEFAULT.  Changing that to STATUS ON fixed the problem and allowed the 
> Printer Friendly Map thing to work.  The Download button yields the 
> following error before dying:
> 
> Warning: Cannot modify header information - headers already sent by 
> (output started at 
> /usr/local/chameleon-2.0/htdocs/widgets/PrintProduction/preview.php:151) 
> in 
> /usr/local/chameleon-2.0/htdocs/widgets/PrintProduction/production_download.phtml 
> on line 105
> 
> More importantly though, this reminded me why I had those layers set to 
> STATUS DEFAULT: when they're set to STATUS ON, they and all the other 
> layers disappear whenever I zoom in.  This is a Chameleon-specific 
> thing, since it doesn't happen with a very simple phpMapScript application.
> 
> Any thoughts?
> 
> -Ken-ichi
> 
> Ken-ichi wrote:
> 
>> Ok, now I'm consistently getting an error, though now it's a different 
>> one. When I click Printer Friendly Map, I still get a broken image, 
>> but when I directly to the image url (preview.php) I get the following 
>> error if I've selected GIF
>>
>> Fatal error: Call to a member function on a non-object in 
>> /usr/local/chameleon-2.0/htdocs/widgets/PrintProduction/preview.php on 
>> line 267
>>
>> and this if I select PNG or JPEG
>>
>> The image 
>>http://path/to/preview.php?sid=421e5811951d3&selImageFormat=PNG” 
>> cannot be displayed, because it contains errors.
>>
>> This does NOT occur when I sub in the the chameleon.map mapfile from 
>> the samples directory. This is sort of confusing because I'm using a 
>> very simple and reduced mapfile, that looks like this:
>>
>> MAP
>> NAME "VTM Data Browse"
>> STATUS ON
>> EXTENT -363827 -615083 548549 481459
>> SIZE 410 500
>> SHAPEPATH "/gisdata/vtm"
>> SYMBOLSET /web/ms_assets/symbols.sym
>> FONTSET /home/vtm/fonts/fonts.txt
>> WEB
>> IMAGEPATH "/web/tmp/"
>> IMAGEURL "/tmp/"
>> END
>> PROJECTION
>> "init=epsg:1000"
>> END
>>
>> LAYER
>> NAME "Water"
>> GROUP "Default"
>> STATUS DEFAULT
>> DATA "/gisdata/common/albers/shapefiles/water"
>> TYPE POLYGON
>> CLASS
>> STYLE
>> COLOR 153 204 255
>> END
>> END
>> END
>> LAYER
>> NAME "Neighbors"
>> GROUP "Default"
>> STATUS DEFAULT
>> DATA "/gisdata/common/albers/shapefiles/ca_neighbors"
>> TYPE POLYGON
>> CLASS
>> STYLE
>> COLOR 255 255 204
>> OUTLINECOLOR 204 204 153
>> END
>> END
>> END
>> END
>>
>>
>>
>> I'm still playing around with it, but I'm still stumped.
>>
>> -Ken-ichi
>>
>>
>> Paul Spencer wrote:
>>
>>> -Ken-ichi-
>>>
>>> this is very strange. You say that this happens inconsistently. Can 
>>> you identify any pattern that might affect this? Layer visibility, 
>>> scale, fonts chosen, other options? If you can figure out how to 
>>> reliably reproduce this then I might have a chance.
>>>
>>> Cheers
>>>
>>> Paul
>>>
>>> Ken-ichi wrote:
>>>
>>>> Hi all. I just started experimenting with the PrintProduction 
>>>> widget, and whenever I click the Printer Friendly Map button, I get 
>>>> the following error:
>>>>
>>>> Fatal error: [MapServer Error]: msPrepareImage(): Unable to 
>>>> initialize image. in 
>>>> /usr/local/chameleon-2.0/htdocs/widgets/PrintProduction/production_draw_legend.php 
>>>> on line 396
>>>>
>>>> This occurs in the Enhanced Sample (inconsistently) and within my 
>>>> own application (every time). I tried subbing in the sample's legend 
>>>> template for my own but that had no effect. It seems a weird place 
>>>> for it to get hung up, since the prepareImage() function just 
>>>> generates a blank image handle.
>>>>
>>>> Any ideas?
>>>>
>>>> -Ken-ichi
>>>> _______________________________________________
>>>> 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
> 
> 
> 
> _______________________________________________
> 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