Steve --<br><br>You really should take a look at mod_rewrite, I think that it would really be quite easy to do what you are trying to accomplish.<br><br>The basic idea is that you would setup a rule in apache that would take any url of the form
<a href="http://www.usmapserver.com/california">http://www.usmapserver.com/california</a> and you would internally (the end user will never see what you are doing) change that url to <a href="http://www.usmapserver.com/index.html?state=california">
http://www.usmapserver.com/index.html?state=california</a>. Then you would just need to have a lookup in index.html that would find the bbox for ca and would zoom in there. <br><br>It's actually pretty darn slick when you get it running.
<br><br>David<br><br><div><span class="gmail_quote">On 7/12/06, <b class="gmail_sendername">Steve Walker</b> <<a href="mailto:walker@mfgis.com">walker@mfgis.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I have partially solved my own question posted below.<br><br>I have discovered the following:<br><br>To view multiple pages such as<br><a href="http://www.blahblah.com/location1">http://www.blahblah.com/location1</a> and
<br><a href="http://www.blahblah.com/location2">http://www.blahblah.com/location2</a><br><br>from the same ka-map back-end, do the following:<br><br>Modify the init.php, changing file 'includes' as necessary to point to the
<br>correct locations on the file system (ie tile.php, config.php) as you will<br>copy the init.php file to multiple locations on the file system and the<br>relative pointers to these files may/will break.<br><br>Also in
init.php, insert the line<br>include_once('./variables.php');<br>before the include_once( 'config.php) entry. This pulls in the variables<br>(extent, map name, title) as noted in my original posting.<br><br>modify the *.js files again to replace path names as necessary, for the
<br>same reason as above (ie from 'images/blahblah.jpg' to<br>'/ka-map/images/blahblah.jpg'<br><br>copy both the init.php files to the corresponding location(s) on the file<br>system.<br><br>re-write the index.html files (using scripts & templates) to reflect the
<br>page-specific values from variables.php such as name, title, etc.<br><br>/var/www/htdocs/location1/init.php<br>/var/www/htdocs/location1/index.html<br>/var/www/htdocs/location1/variables.php<br><br>/var/www/htdocs/location2/init.php
<br>/var/www/htdocs/location2/index.html<br>/var/www/htdocs/location2/variables.php<br><br>This solution works as you can see for example from<br><br><a href="http://www.usmapserver.com/Washington">www.usmapserver.com/Washington
</a><br><a href="http://www.usmapserver.com/California">www.usmapserver.com/California</a><br><a href="http://www.usmapserver.com/California/Los_Angeles">www.usmapserver.com/California/Los_Angeles</a><br><br>However, drawbacks include:
<br><br>1. need to make a copy of init.php for each desired web page rather than<br>pointing to a single master.<br>2. need to (progromatically) re-write each index.html (ie to generate<br>title, name, links) from scratch rather than including these values at
<br>run-time.<br><br>I am still scratching at the surface of understanding and will report<br>anything else I learn.<br><br>-steve walker<br><br>> Hello,<br>><br>> I am hoping to be able to achieve the following:
<br>><br>> Have<br>> <a href="http://www.usmapserver.com/location1">http://www.usmapserver.com/location1</a><br>> <a href="http://www.usmapserver.com/location2">http://www.usmapserver.com/location2</a><br>> (and n additional URLS)
<br>><br>> each launch the same ka-map application (same map, data, etc)<br>> but so that each grabs its extent and title (among other things) from<br>> the URL's index.php file as here:<br>><br>> /var/www/htdocs/location1/index.php:
<br>> $title = 'Map of Green City';<br>> $extent = '-120,40,-115,45';<br>> $include ("/var/www/htdocs/kamap_index.html");<br>><br>> /var/www/htdocs/location2/index.php:<br>> $title = 'Map of Red Town';
<br>> $extent = '-90,30,-70,40';<br>> $include ("/var/www/htdocs/kamap_index.html");<br>><br>> where of course location1/index.php corresponds with<br>> http:/www.usmapserver.com/location1 etc.
<br>> and where kamap_index.html is essentially the ka-map distribution html.<br>><br>> My idea is to replace (in init.php) the extents read from the map file<br>> $szExtents = $oMap->extent->minx.",".$oMap->extent->miny.",".
<br>> $oMap->extent->maxx.",".$oMap->extent->maxy;<br>><br>> with<br>><br>> $szExtents = $extent;<br>><br>> where $extent is the $extent variable in index.php<br>><br>> (CF The analogous setup using the chameleon environment at
<a href="http://usmaperver.com">usmaperver.com</a><br>> - a web page for each state, county, and city in the nation.)<br>><br>><br>> The problem, as I understand it, is that these variables don't get passed<br>
> through. And here is where my skills break down - specifically on the the<br>> javascript side.<br>><br>> I can *fake it* but only for one page: In init.php, near the line<br>> include_once( '/var/www/htdocs/include/config.php' );
<br>><br>> I can add<br>> include_once( '/var/www/htdocs/location1/variables.php' );<br>><br>> But this will only work if hard-wired to the 'location1/variables.php'<br>> and since I don't know how to move these variables through, I can't write
<br>><br>> $variable_path = '/var/www/htdocs/' . $url_base . '/variables.php';<br>> include_once( $variable_path );<br>><br>> where $url_base would be one of location1,location2,...,locationN<br>><br>>
<br>> Does this make sense? Clearly I wouldn't even need to bother with this<br>> kluggy 'include_once' in init.php if those variables originally defined in<br>> index.php were passed through.<br>><br>> I think I am missing something simple (php globals? javascript anything?)
<br>><br>><br>> Thanks for any insights.<br>><br>><br>><br>><br>> --<br>> Steve Walker<br>> Middle Fork Geographic Information Services<br>> <a href="mailto:walker@mfgis.com">walker@mfgis.com
</a><br>> 360-671-2505<br>><br>> _______________________________________________<br>> ka-Map-users mailing list<br>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>>
<a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>><br><br><br>--<br>Steve Walker<br>Middle Fork Geographic Information Services<br><a href="mailto:walker@mfgis.com">
walker@mfgis.com</a><br>360-671-2505<br><br>_______________________________________________<br>ka-Map-users mailing list<br><a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br><a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">
http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner<br><a href="mailto:bitner@gyttja.org">bitner@gyttja.org
</a>