[Chameleon] dynamic map changes

Rhys Ickeringill rhysi at omnilink.com.au
Wed Mar 30 03:29:13 EST 2005


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



More information about the Chameleon mailing list