[ka-Map-users] Multiple URLs - one ka-map install - variable
passing question?
Steve Walker
walker at mfgis.com
Fri Jul 7 20:39:22 EDT 2006
Hello,
I am hoping to be able to achieve the following:
Have
http://www.usmapserver.com/location1
http://www.usmapserver.com/location2
(and n additional URLS)
each launch the same ka-map application (same map, data, etc)
but so that each grabs its extent and title (among other things) from
the URL's index.php file as here:
/var/www/htdocs/location1/index.php:
$title = 'Map of Green City';
$extent = '-120,40,-115,45';
$include ("/var/www/htdocs/kamap_index.html");
/var/www/htdocs/location2/index.php:
$title = 'Map of Red Town';
$extent = '-90,30,-70,40';
$include ("/var/www/htdocs/kamap_index.html");
where of course location1/index.php corresponds with
http:/www.usmapserver.com/location1 etc.
and where kamap_index.html is essentially the ka-map distribution html.
My idea is to replace (in init.php) the extents read from the map file
$szExtents = $oMap->extent->minx.",".$oMap->extent->miny.",".
$oMap->extent->maxx.",".$oMap->extent->maxy;
with
$szExtents = $extent;
where $extent is the $extent variable in index.php
(CF The analogous setup using the chameleon environment at usmaperver.com
- a web page for each state, county, and city in the nation.)
The problem, as I understand it, is that these variables don't get passed
through. And here is where my skills break down - specifically on the the
javascript side.
I can *fake it* but only for one page: In init.php, near the line
include_once( '/var/www/htdocs/include/config.php' );
I can add
include_once( '/var/www/htdocs/location1/variables.php' );
But this will only work if hard-wired to the 'location1/variables.php'
and since I don't know how to move these variables through, I can't write
$variable_path = '/var/www/htdocs/' . $url_base . '/variables.php';
include_once( $variable_path );
where $url_base would be one of location1,location2,...,locationN
Does this make sense? Clearly I wouldn't even need to bother with this
kluggy 'include_once' in init.php if those variables originally defined in
index.php were passed through.
I think I am missing something simple (php globals? javascript anything?)
Thanks for any insights.
--
Steve Walker
Middle Fork Geographic Information Services
walker at mfgis.com
360-671-2505
More information about the ka-Map-users
mailing list