<div dir="ltr"><div>That is a much improved version of the very basic html legend that I had working!</div><div>Thanks for sharing!</div><div><br></div><div>Chris<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 12, 2020 at 4:36 PM Brent Fraser <<a href="mailto:bfraser@geoanalytic.com">bfraser@geoanalytic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This works for me (v3.6.2-beta:<br>
 )<br>
     <map-source name="ags-vector-polygons"    type="ags-vector"><br>
<br>
<url><a href="https://gis2.co.dakota.mn.us/arcgis/rest/services/DCGIS_OL_Transportation/MapServer/21" rel="noreferrer" target="_blank">https://gis2.co.dakota.mn.us/arcgis/rest/services/DCGIS_OL_Transportati<br>
on/MapServer/21</a></url><br>
        <layer name="runways" selectable="true" title="Runways"><br>
            <style><![CDATA[<br>
            {<br>
                "line-color" : "red",<br>
                "line-width" : 2,<br>
                "fill-color": "#FF4500",<br>
                "fill-opacity": 0.20<br>
            }<br>
            ]]></style><br>
            <legend type="html"><![CDATA[<br>
            <div style='padding-top: 3px; padding-bottom: 5px;'><br>
                <div style='vertical-align: middle; display: inline-block; <br>
width: 2em; height: 1em;   background-color: rgb(255, 69, 0, 0.2); border: <br>
solid 2px red;'></div><br>
                <b>Runways</b><br>
            </div><br>
            ]]></legend><br>
<br>
<br>
<br>
 -------- Original Message --------<br>
> From: "Christopher Hughes" <<a href="mailto:chughes@co.lincoln.or.us" target="_blank">chughes@co.lincoln.or.us</a>><br>
> Sent: June 12, 2020 5:10 PM<br>
> To: "GeoMoose Users" <<a href="mailto:geomoose-users@lists.osgeo.org" target="_blank">geomoose-users@lists.osgeo.org</a>><br>
> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support<br>
><br>
> Thanks for all the feedback!<br>
><br>
> HTML legends look like they may be a viable option that I need to <br>
explore<br>
> more.<br>
><br>
> There may be a bug/oversight as I haven't been able to get the legend<br>
> working for the demo's ags-vector layer<br>
> that has its style declared in the map-source (or perhaps the map-source<br>
> needs to be configured in a certain way<br>
> for the legend to show).<br>
><br>
> Best Regards,<br>
><br>
> Chris<br>
><br>
> On Fri, Jun 12, 2020 at 1:44 PM Jim Klassen <<a href="mailto:klassen.js@gmail.com" target="_blank">klassen.js@gmail.com</a>> <br>
wrote:<br>
><br>
> > I think your use of static/dynamic is fine.<br>
> ><br>
> > My point is, with a little creativity, there is a lot of potential <br>
power<br>
> > in the 'static' legends beyond what is shown in the demo. And it might <br>
be<br>
> > worth documenting that to get people thinking about what they could do <br>
with<br>
> > it.<br>
> ><br>
> > I'm be happy for the Apache trick to land in the docs. I've been using<br>
> > MapServer that way for ~15 years. Only reason it isn't in the docs <br>
already<br>
> > is when I first came up with it, I was told it was too complicated, so <br>
I<br>
> > dropped it.<br>
> ><br>
> > On 6/12/20 3:15 PM, Brent Fraser wrote:<br>
> > > See comments below<br>
> > ><br>
> > ><br>
> > ><br>
> > > -------- Original Message --------<br>
> > >> From: "Jim Klassen" <<a href="mailto:klassen.js@gmail.com" target="_blank">klassen.js@gmail.com</a>><br>
> > >> Sent: June 12, 2020 1:50 PM<br>
> > >> To: bfraser@GeoAnalytic.com, <a href="mailto:geomoose-users@lists.osgeo.org" target="_blank">geomoose-users@lists.osgeo.org</a><br>
> > >> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support<br>
> > >><br>
> > >> I think you are basically correct. A couple of minor points:<br>
> > >><br>
> > >> Keep in mind that the legend graphic file could be any URL that <br>
returns<br>
> > > an image and doesn't necessarily need to point to a static file on <br>
the<br>
> > web<br>
> > > server. So, for example, it could be a legend or preview imaged<br>
> > generated<br>
> > > from a WMS request (or other URL). However, I suspect that you are<br>
> > correct<br>
> > > that it will be 'static' as in it will only be loaded once per <br>
GeoMoose<br>
> > > session rather than updated as the map view changes.<br>
> > >> Also, an HTML legend can be all sorts of creative with what is <br>
included<br>
> > > (<a>, CSS background-image: url(...), etc.).<br>
> > ><br>
> > > Yeah, static isn't a very good term, but I was trying to illustrate<br>
> > that<br>
> > > the legend will not change on a pan/zoom as it could with<br>
> > type="mapserver"<br>
> > > or "wms" if there a zoom sensitive layers set up on the data server.<br>
> > ><br>
> > ><br>
> > >> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts <br>
for<br>
> > > 'wms' and 'wfs' where GeoMoose does the<br>
> > url='/cgi-bin/mapserv?map=<file>&'<br>
> > > substitution for you (using the values from config.js). (Long ago, <br>
the<br>
> > > 'mapserver' layer type actually made a Mapserver 'mode=map' request, <br>
but<br>
> > it<br>
> > > has been using WMS behind the scenes since at least GeoMoose 2.6.)<br>
> > ><br>
> > > Yes, and the move to standard protocols (like wms, wfs) is a good<br>
> > thing.<br>
> > > In fact to test wfs I just created a mapsource like so:<br>
> > ><br>
> > > <map-source name="wfs-polygons" type="wfs" ><br>
> > > <url><a href="http://localhost/cgi-bin/mapserv.exe" rel="noreferrer" target="_blank">http://localhost/cgi-bin/mapserv.exe</a></url><br>
> > > <param name="map"<br>
> > > value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/><br>
> > > <param name="typename" value="ms:parcels"/><br>
> > > <layer name="default" title="wfs Polygons"><br>
> > ><br>
> > > But there may have been some problems with some Mapserver versions <br>
in<br>
> > the<br>
> > > past (search the GM source for "wgs84Hack")<br>
> > ><br>
> > >><br>
> > >> Rant/aside/tangent:<br>
> > >><br>
> > >> Personally, I don't like the mapserver layer types and think that <br>
this<br>
> > > path rewrite stuff is better done on the web server so access is<br>
> > consistent<br>
> > > with other WxS clients (like QGIS).<br>
> > >> I have Apache setup with Actions and RewriteRules so that<br>
> > > '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE<br>
> > environment<br>
> > > variable set to '/srv/datasets/some.map' behind the scenes.<br>
> > >> This also allows for using Apache to manage access to individual<br>
> > mapfiles<br>
> > > as well as separates mapfiles in the logs because every request <br>
isn't<br>
> > just<br>
> > > /cgi-bin/mapserv with the actual mapfile being potentially hidden in <br>
a<br>
> > > POST. This also uses Apache to be sure the .map file exists and is <br>
under<br>
> > > the /srv/datasets tree before executing the request (so things like <br>
'..'<br>
> > in<br>
> > > the path don't let people tell mapserver to access other places on <br>
your<br>
> > > server).<br>
> > >> This does require a patch to mapserver or the setting the<br>
> > > "ows_onlineresource" metadata in every mapfile so the links in<br>
> > > GetCapabilites responses point to the right spot.<br>
> > >><br>
> > >> Something like:<br>
> > >><br>
> > >> <Directory "/usr/lib/cgi-bin"><br>
> > >> AllowOverride None<br>
> > >> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<br>
> > >><br>
> > >> # Only allow specified CGI-BIN files<br>
> > >> Require all denied<br>
> > >><br>
> > >> # Mapserver<br>
> > >> <Files "mapserv"><br>
> > >> Require all granted<br>
> > >><br>
> > >> SetEnv MS_ERRORFILE "stderr"<br>
> > >> SetEnv MS_MAP_NO_PATH "true"<br>
> > >><br>
> > >> RewriteEngine on<br>
> > >> RewriteCond %{env:REDIRECT_HANDLER} ^mapserver<br>
> > >> RewriteCond %{PATH_INFO} ^/datasets/(.*)<br>
> > >> RewriteRule .* -<br>
> > > [C,env=MS_MAPFILE:/srv/datasets/%1]<br>
> > >> RewriteRule .* - [L]<br>
> > >><br>
> > >> RewriteRule .* - [F]<br>
> > >> </Files><br>
> > >> </Directory><br>
> > >><br>
> > >> <Directory "/srv/datasets/"><br>
> > >> Require all denied<br>
> > >><br>
> > >> Action mapserver /cgi-bin/mapserv<br>
> > >> AddHandler mapserver .map<br>
> > >> <Files "*.map"><br>
> > >> Require all granted<br>
> > >> </Files><br>
> > >> </Directory><br>
> > >> Alias /datasets/ /srv/datasets/<br>
> > >><br>
> > > Ooo! Nice! How about finding a spot in the docs for that?<br>
> > ><br>
> > ><br>
> > ><br>
> ><br>
> > _______________________________________________<br>
> > Geomoose-users mailing list<br>
> > <a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank">Geomoose-users@lists.osgeo.org</a><br>
> > <a href="https://lists.osgeo.org/mailman/listinfo/geomoose-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a><br>
><br>
><br>
><br>
> --<br>
> Chris Hughes<br>
><br>
> GIS Analyst<br>
> Lincoln County Surveyor Department<br>
> 880 NE 7th St. l Newport, OR 97365<br>
> Tel: (541) 574 1283<br>
> _______________________________________________ Geomoose-users mailing <br>
list <a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank">Geomoose-users@lists.osgeo.org</a> <br>
<a href="https://lists.osgeo.org/mailman/listinfo/geomoose-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a><br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><font size="4">Chris Hughes</font><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">GIS Analyst</div><div style="font-size:12.8px"><font size="1">Lincoln County Surveyor Department </font></div><div><font size="1"><span style="font-family:Roboto,arial,sans-serif">880 NE 7th S</span><span style="font-family:Roboto,arial,sans-serif">t</span>. l Newport, OR 97365</font></div><div style="font-size:12.8px"><font size="1">Tel: (541) 574 1283</font></div></div></div>