[Chameleon] change imagetype on the fly

Paul Spencer pagameba at magma.ca
Wed Aug 18 22:09:28 EDT 2004


Jacob, you should be able to modify the image type in drawmap.php since this is the only
place that it actually draws the map.  Note that drawmap does not save the map state, so
you would have to change it on every map draw.  The code would look something like:

$oMap->selectOutputFormat( 'GIF' );

I think.  And you could insert this just before the $oMap->draw(); call.  You could also
(at the risk of adding a little overhead) loop through all the layers in the map and test
for the layer types and only switch to jpeg when a raster layer is visible ...

Cheers,

Paul



On Aug 18, "Jacob Delfos" <jacob.delfos at maunsell.com> wrote:
> Hi List,
> 
> 
> 
> I am attempting to modify chameleon to allow the imagetype to change on the fly.
Ideally, I want to reach a situation where chameleon is smart enough to know it should use
gif, except when an aerial photograph is in the background. This will greatly increase the
speed of the page, because my jpeg maps are typically around 88kb, whereas a gif would be
ten times smaller for linework and areas.
> 
> 
> 
> I tried to override the nImageType in drawmap.php by making it pick it up from the http
parameters. But even if I hardcode the nImageType variable, I keep getting a jpeg. Also
(which may be the cause), the temporary map files that are created specify jpeg as imagetype.
> 
> 
> 
> If I want to override the imagetype, where do I change that?
> 
> 
> 
> regards,
> 
> 
> 
> Jacob
> 
> 
> 
> 
> 
> 
> 
> JACOB DELFOS
> 
> SPATIAL INFORMATION ANALYST
> 
> Maunsell Australia Pty Ltd
> 
> 629 Newcastle Street
> 
> PO Box 81
> 
> Leederville 6902
> 
> Western Australia
> 
> ABN 20 093 846 925
> 
> 
> 
> Tel     + 61 8 9281 6185
> 
> Fax    + 61 8 9281 6297
> 
> jacob.delfos at maunsell.com
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> <a
href='http://lists.maptools.org/mailman/listinfo/chameleon'>http://lists.maptools.org/mailman/listinfo/chameleon</a>
> 
> 


More information about the Chameleon mailing list