[ka-Map-users] Multiple URLs - one ka-map install -
variablepassing question?
Schee van der, Maurits
M.vanderSchee at cso.nl
Tue Jul 11 04:48:51 EDT 2006
Hi Steve Walker,
Take a good look at mod_rewrite.
http://www.google.nl/search?hl=nl&q=mod_rewrite
That may help you.
Maurits
-----Oorspronkelijk bericht-----
Van: ka-map-users-bounces at lists.maptools.org
[mailto:ka-map-users-bounces at lists.maptools.org]Namens Steve Walker
Verzonden: zaterdag 8 juli 2006 2:39
Aan: ka-map-users at lists.maptools.org
Onderwerp: [ka-Map-users] Multiple URLs - one ka-map install -
variablepassing question?
Urgentie: Laag
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
_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ka-map-users
More information about the ka-Map-users
mailing list