[ka-Map-users] Re: added query string parsing code ...

David Badke dbadke at uvic.ca
Fri Feb 3 11:41:11 EST 2006


Paul Spencer wrote:
> I've added the code I had to startUp.js and iframe.html to parse the 
> query string into name/value pairs and changed the initialization code 
> to use it.  This replaces the code that did 'positional' parsing.
>
> David, this still doesn't do exactly what you want ... you will need 
> to modify startUp.js to take unused parameters and pass them to 
> myKaMap.initialize as the fourth parameter and modify the initialize 
> function inside kaMap to pass that on to init.php.  I'm not sure of 
> the general usefulness of this but I would be willing to apply a patch 
> if you can it to do what you want.
Thanks, that deals with the positional parameters nicely.

As for a patch... how about adding this to kaMap.initialize after 
dealing with the standard parameters:

    if (arguments.length > 3 && arguments[3] != '')
    {
        szURL = szURL + sep + arguments[3];
        sep = "&";
    }

If there is a fourth parameter, assume it is additional 
properly-formatted query parameters, so just tack it onto the end of the 
query string. Initialize can then be called with:

    myParams = 'myparam1=myvalue1&myparam2=myvalue2&...';
    myKaMap.initialize( map, extents, cps, myParams);

or just:

   myKaMap.initialize( map, extents, cps );

so existing code doesn't break.

David



More information about the ka-Map-users mailing list