[Chameleon] Accessing Map Resources with PHP/MapScript in
Chameleon
Paul Spencer
pagameba at magma.ca
Thu Jul 8 10:45:15 EDT 2004
Shon,
this sounds like a new widget for sure. Unfortunately there isn't any
real documentation on creating new widgets yet (it's still in the
planning stages right now). Your best bet is to look at existing
widgets and model your code on that.
As a quick overview, I would suggest taking something like the mapsize
widget and using it as your starting point. Your code below will go
into the ParseURL function. The user interface is generated in the
DrawPublish function. The definition of the attributes that your widget
supports ... and initialization of default values ... goes in the widget
constructor and the InitDefaults method.
Cheers,
Paul
Shon Doseck wrote:
> List,
>
> I'm pretty new to Chameleon and am not sure where the best place is to
> apply PHP/MapScript logic within the Chameleon framework. Armed with
> the information gained from the MapServer User's Meeting last month, I
> was able to get my interface up and styled with relative ease. Now I
> have to change the data content (i.e. name and data source of a layer)
> based on user interaction with a pull-down form field. I'm pretty
> comfortable with how to do this in PHP/MapScript (see my basic approach
> below), but not knowing much about how map session and state information
> is maintained with Chameleon, I'm not sure where I should go with this.
>
>
> $nLayers=$oApp->moMapSession->oMap->numlayers;
>
> for($i=0; $i<$nLayers; $i++)
> {
> $oLayer=$oApp->moMapSession->oMap->getlayer($i);
> if ($oLayer->name == 'Original_Layer_Name') {
> $oLayer->set("name","User_Defined_Layer_Name");
> $oLayer->set("data","/data1/rest_of_path_to_data");
> }
> }
>
>
> If there doesn't already exist a widget to help me perform this task,
> perhaps a custom widget is the answer, but again without more knowledge
> of the anatomy of widgets and how to develop them, I wouldn't know where
> to start. A push in the right direction would be very much
> appreciated. I'm excited to get past the initial learning curve for
> utilizing all the potential of Chameleon and hope this exercise will
> bring me closer.
>
> Thanks,
> Shon
> ________________________________________
> Shon M. Doseck
> GIS Analyst
> Pangaea Information Technologies, Ltd.
> Tel. 312.986.9471
> Cell. 312.804.9650
> Fax. 312.986.9477
> ___http://www.pangaeatech.com <http://www.pangaeatech.com/>_
> ________________________________________
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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