[Chameleon] dynamic map changes
bartvde at xs4all.nl
bartvde at xs4all.nl
Wed Mar 30 04:01:04 EST 2005
Hi Rhys,
the MapDHTML widget also changes the MAP object sometimes on the first
load (specifically the extent), see the following lines of
MapDHTML.widget.php:
if ($bAdjust)
{
$this->moMapObject->oMap->save(
getSessionSavePath().'/mapDHTML_adjust.map' );
$oMap = ms_newMapObj( getSessionSavePath().'/mapDHTML_adjust.map',
$_SESSION['gszMapPath'] );
$oExt = $oMap->extent;
$this->moMapObject->oMap->setExtent( $oExt->minx, $oExt->miny,
$oExt->maxx, $oExt->maxy );
}
It might give you some ideas, it might not.
Best regards,
Bart
> Hi All,
>
> If I wish dynamically change some map settings before the first drawing of
> the map (but not subsequent ones), what methods of the Chameleon class
> should I override?
>
> Specifially I wish to do two things dynamically - highlight a specific
> feature via a query and set the map extent to the extent of that feature.
> I
> assume this will have to happen just after the mapfile has been parsed but
> before the $oMap->draw() gets called (I have yet to trace where this call
> occurs)
>
> ie. the code should look something like
>
> // code to find shape index in specified layer
> ....
> // on first loading of map only...
> if( $findSuccess ){
> $oMap = new ms_MapObj( $szMapFile );
> $oLayer = $oMap->getLayerByName( $szLayerName );
> $oLayer->queryByIndex( $oMap, $idx, -1 );
> $oMap->extent = $oLayer->getResult(0)->bounds;
> $oImage = $oMap->draw( );
> $oLayer->drawQuery( $oImage );
> }
>
> Is there somewhere I place this with minimal interuption to the rest of
> Chaemeleon's operations but still get the desired functionality?
>
> Any suggestions/pointers will be greatly appreciated,
>
> Rhys
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
More information about the Chameleon
mailing list