[maplab-users] Add Controls to GMapFactory Output??

Paul Spencer
Sun, 07 Sep 2003 16:45:50 -0400

this version of GMapFactory is not well suited to the type of 
customization you are attempting, but it is definitely possible.  I 
would start by editing ImagesYukonJ.phtml and adding something like:

<SELECT name="landsat" 
<OPTION value="<geo-coords in form minx,miny;maxx,maxy>">name1</OPTION>

and at the top of the page, in the head section:

<script language="JavaScript">
function zoomtolandsat( coords )

Now the tricky part, that requires some php.  You'll need to edit the 
file ImagesYukonJ.php and look for the function checkNavigation (on line 
319 in my version).

You can add a custom handler for your zoom to coords here with something 

//my custom landsat image extents handler
case "landsat":
    //oMapNavigator is an instance of MapNavigator from the php
    //wrappers.  It has a reference to the MapSession (also from wrappers)
    //which (finally) has a reference to the PHP MapScript object.
    $oMap = $oMapNavigator->oSession->oMap;
    //we can now call any php mapscript functions here.
    //Assume that $szInputCoords is in format minx,miny;maxx,maxy
    //and that adMin and adMax now contain the geographic extents to zoom to
    $oMap->setextent( $adMin[0], $adMin[1], $adMax[0], $adMax[1] );

Finally, you will probably want to place this input box somewhere else 
on the page.  If you do, you will have to edit the file 
ImagesYukonJ_contents.php and put your select input somewhere in here.  
This is a little more straight forward, you should be able to figure it 
out, but be warned that if you open your project in GMapFactory again, 
this file will be overwritten and your changes lost.

Peter.VonGaza wrote:

>Howdy,  I'm relatively new to Mapserver and Maplab.  I've created a Maplab
>test page that works fine, but what i need to do is add a list box to the
>GMapFactory output to select an image.  Not being familiar with PHP
>programming i was hoping someone could give me a hint on how to do this.  I
>have 30+ ECW Landsat 7 scenes that i want to put in this list box.  When the
>user selects an image i would like to move the map to the centre of the
>selected image.  The following is a link to the java enabled test page:
>Any comments highly appreciated!
>Mapserver 4.0 + MapLab 2.0 + Apache 2 + PHP4 + Win2k
>Peter von Gaza
>Geomatics Yukon
> <> 

Paul Spencer
Applications and Software Development
DM Solutions Group Inc.

This archive was generated by Pipermail.