The final part in making it all work is setting up a bit of HTML to call your map. In the samples directory is a provided PHP script that will do this for you, the important code is:

        require_once("gmap.inc.php");

        if (isSet($_GET['view'])) {
                print(getGMapEZ("map.cfg", $_GET['view']));
        } else {
                print(getGMapEZ("map.cfg"));
        }

This will allow you to call the PHP file with a view parameter that matches the names or you configured in your extends section in the configuration. Sample URL's from my own installation:

http://www.devco.net/visited/

View the default extend map

http://www.devco.net/visited/?view=sengland

View the sengland extend

You could use mod_rewrite in Apache to make these URL's look nicer. A simple rule like the one below can redirect all requests to /yourmap/view/extendname to view the specific extend.

RewriteRule view/(.+) index.php?view=$1

Using this mod_rewrite rule you can view my South England map with the following url http://www.devco.net/visited/view/sengland

GMapsPHP/CallingFromPHP (last edited 2005-11-28 21:16:01 by azrael)