[Geomoose-users] Multiple Mapbook.xml

Raffaele Morelli raffaele.morelli at gmail.com
Mon Nov 21 22:06:34 PST 2016


2016-11-22 3:57 GMT+01:00 Kevin Grootendorst <kgrootendorst at gmail.com>:
>
> Hello,
> I just wanted to close the loop on this discussion and share what resolved my latest problem.
> I had been having an issue with data not drawing properly in multiple mapbooks
>
> My secondary GeoMoose site featured data request URL's like this:
> www.mysite.com/geomoose/FORMAT=image%2Fpng&MAP.....
>
> But I needed it be more like this:
> www.mysite.com/cgi-bin/mapserv?FORMAT=image%2Fpng&MAP....
>
> So my broken URL was missing 'cgi-bin/mapserv'
> My secondary application points to a php file upon loading (www.mysite.ca/geomoose/SecondarySite.php), which in turn points to a settings ini file (settings_SecondarySite.ini)
> The ini file is a copy of 'settings.ini' and was constructed following documentation previously mentioned in this thread.
> Anyways, my 'settings_SecondarySite.ini' points to the location of the secondary mapbook (mapbook=mapbook_Secondary.xml).  It is in this file, under the [paths] section, that I had to uncomment the mapserver_url and provide the right location:
>
> [paths]
> server_name=localhost
>
> ; These are example settings, of note:
> ; Do NOT forget trailing "/" in the paths!
> ; PATHS SHOULD BE SETTING IN local_settings.ini
>
> ;root=/Users/ducky/Projects/GeoMOOSE/trunk/maps/
> ;mapserver_url=/mapserver/cgi-bin/mapserv
> mapserver_url=/cgi-bin/mapserv
> ;temp=/tmp/out/
>
> My secondary site now functions as expected, and my URLs are properly constructed.
> I hope this may help someone someday.
> Cheers.
>
> Kevin
>
> On Thu, Nov 17, 2016 at 9:13 AM, James Klassen <klassen.js at gmail.com> wrote:
>>
>> There are two options buult into GeoMoose:
>>
>> A partial option (works for the html/js part of GeoMoose only, not the PHP services) is to add a
>>
>> ?mapbook=url-to-mapbook.xml
>>
>> to the GeoMoose URL.
>>
>> The other option is to modify getmapbook.php (maybe the actual function is in config.php, it isn't in front of me) to be aware of the user that is logged in and return the appropriate mapbook.  One of the reasons getmapbook.php exists is to create a spot where people could hook in this type of functionality.
>>
>> IIRC a couple of the PHP services that need mapbook data also use this method so they should keep working.


Maybe it's not too late to point out to a third option to manage
mapbooks, ie setting an apache (if it's your webserver choice)
environment variable like this

SetEnv GEOMOOSE_LOCAL_SETTINGS /path/to/geomoose/conf/my_site01.ini

then specify your mapbook in my_site0.ini in [defaults] section:

[defaults]
mapbook=mapbook_cen_default.xml

Then you should control the environment variable using a "wrapper"
page, eg in PHP using something like:
apache_setenv("GEOMOOSE_LOCAL_SETTINGS",
"/path/to/geomoose/conf/my_site01.ini");

It should work

Regards
/r

PS my old issue on github with some comments from devs:
https://github.com/geomoose/geomoose/issues/59


More information about the Geomoose-users mailing list