[Geomoose-users] GeoMoose 3 - AGS Legend Support

Jim Klassen klassen.js at gmail.com
Fri Jun 12 13:43:56 PDT 2020


I think your use of static/dynamic is fine.

My point is, with a little creativity, there is a lot of potential power in the 'static' legends beyond what is shown in the demo.  And it might be worth documenting that to get people thinking about what they could do with it.

I'm be happy for the Apache trick to land in the docs.  I've been using MapServer that way for ~15 years.  Only reason it isn't in the docs already is when I first came up with it, I was told it was too complicated, so I dropped it.

On 6/12/20 3:15 PM, Brent Fraser wrote:
> See comments below
>    
>    
>    
>   -------- Original Message --------
>> From: "Jim Klassen" <klassen.js at gmail.com>
>> Sent: June 12, 2020 1:50 PM
>> To: bfraser at GeoAnalytic.com, geomoose-users at lists.osgeo.org
>> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>
>> I think you are basically correct.  A couple of minor points:
>>
>> Keep in mind that the legend graphic file could be any URL that returns
> an image and doesn't necessarily need to point to a static file on the web
> server.  So, for example, it could be a legend or preview imaged generated
> from a WMS request (or other URL). However, I suspect that you are correct
> that it will be 'static' as in it will only be loaded once per GeoMoose
> session rather than updated as the map view changes.
>> Also, an HTML legend can be all sorts of creative with what is included
> (<a>, CSS background-image: url(...), etc.).
>    
>   Yeah, static isn't a very good term, but I was trying to illustrate that
> the legend will not change on a pan/zoom as it could with type="mapserver"
> or "wms" if there a zoom sensitive layers set up on the data server.
>    
>     
>> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts for
> 'wms' and 'wfs' where GeoMoose does the url='/cgi-bin/mapserv?map=<file>&'
> substitution for you (using the values from config.js).  (Long ago, the
> 'mapserver' layer type actually made a Mapserver 'mode=map' request, but it
> has been using WMS behind the scenes since at least GeoMoose 2.6.)
>    
>   Yes, and the move to standard protocols (like wms, wfs) is a good thing.
> In fact to test wfs I just created a mapsource like so:
>    
>       <map-source name="wfs-polygons"           type="wfs" >
>          <url>http://localhost/cgi-bin/mapserv.exe</url>
>          <param name="map"
> value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/>
>          <param name="typename" value="ms:parcels"/>
>          <layer name="default" title="wfs Polygons">
>    
>   But there may have been some problems with some Mapserver versions in the
> past (search the GM source for "wgs84Hack")
>
>>
>> Rant/aside/tangent:
>>
>> Personally, I don't like the mapserver layer types and think that this
> path rewrite stuff is better done on the web server so access is consistent
> with other WxS clients (like QGIS).
>> I have Apache setup with Actions and RewriteRules so that
> '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE environment
> variable set to '/srv/datasets/some.map' behind the scenes.
>> This also allows for using Apache to manage access to individual mapfiles
> as well as separates mapfiles in the logs because every request isn't just
> /cgi-bin/mapserv with the actual mapfile being potentially hidden in a
> POST.  This also uses Apache to be sure the .map file exists and is under
> the /srv/datasets tree before executing the request (so things like '..' in
> the path don't let people tell mapserver to access other places on your
> server).
>> This does require a patch to mapserver or the setting the
> "ows_onlineresource" metadata in every mapfile so the links in
> GetCapabilites responses point to the right spot.
>>
>> Something like:
>>
>>          <Directory "/usr/lib/cgi-bin">
>>                  AllowOverride None
>>                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>
>>                  # Only allow specified CGI-BIN files
>>                  Require all denied
>>
>>                  # Mapserver
>>                  <Files "mapserv">
>>                          Require all granted
>>
>>                          SetEnv MS_ERRORFILE "stderr"
>>                          SetEnv MS_MAP_NO_PATH "true"
>>
>>                          RewriteEngine on
>>                          RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
>>                          RewriteCond %{PATH_INFO} ^/datasets/(.*)
>>                          RewriteRule .* -
> [C,env=MS_MAPFILE:/srv/datasets/%1]
>>                          RewriteRule .* - [L]
>>
>>                          RewriteRule .* - [F]
>>                  </Files>
>>          </Directory>
>>
>>          <Directory "/srv/datasets/">
>>                  Require all denied
>>
>>                  Action mapserver /cgi-bin/mapserv
>>                  AddHandler mapserver .map
>>                  <Files "*.map">
>>                          Require all granted
>>                  </Files>
>>          </Directory>
>>          Alias /datasets/ /srv/datasets/
>>
> Ooo! Nice!  How about finding a spot in the docs for that?
>
>
>



More information about the Geomoose-users mailing list