[mapserver-users] CSS in a WMS GetFeatureInfo request

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Thu Aug 12 07:21:21 PDT 2021


James,

Thanks for the reply. The reason I need to have the CSS in the return is that I want to use Variable substitution inside the CSS from the template.  I need to style some stuff from the TEMPLATE call and attributes from the DB.

My next try was going to be with inline Styles, but for some reason DIV tags are not being  passed through the TEMPLATE call, need to figure that out first I think, maybe there is a way around requiring DIVs

Bobb



On 8/12/21, 3:27 AM, "mapserver-users on behalf of James Passmore - BGS" <mapserver-users-bounces at lists.osgeo.org on behalf of jpass at bgs.ac.uk> wrote:

    Think Before You Click: This email originated outside our organization.


    Message: 1
    Date: Wed, 11 Aug 2021 19:15:42 +0000
    From: "Basques, Bob (CI-StPaul)" <bob.basques at ci.stpaul.mn.us>
    To: "mapserver-users at lists.osgeo.org"
            <mapserver-users at lists.osgeo.org>
    Subject: [mapserver-users] CSS in a WMS GetFeatureInfo request.
    Message-ID:
            <DM8PR09MB6342C99F46D5BF87B78C8A8CF7F89 at DM8PR09MB6342.namprd09.prod.outlook.com>

    Content-Type: text/plain; charset="us-ascii"

    Can/should CSS stuff be returned in a GetFeatureInfo request?  Does it need to be formatted a certain way?

    Thanks

    Bobb
    ----

    I add CSS  mostly as a file on the web server and reference the file in the HTML Query_header.html

    like:

    <!-- MapServer Template -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>Terrafirma legacy PSI data service OGC WMS query result</title>
    ...
    <script type="text/javascript" src="http://ogc.bgs.ac.uk/jq/jquery.min.js"></script>
    <script type="text/javascript" src="http://ogc.bgs.ac.uk/jq/jquery.jqplot.min.js"></script>
    <script type="text/javascript" src="http://ogc.bgs.ac.uk/jq/jqplot.dateAxisRenderer.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://ogc.bgs.ac.uk/jq/jquery.jqplot.min.css" />
    <link rel="stylesheet" type="text/css" href="http://ogc.bgs.ac.uk/BGS_ESA_EN_Terrafirma/default.css" />
    </head>
    <body>
    <h1>Legend</h1>
    <img src="http://ogc.bgs.ac.uk/cgi-bin/TFL-PSI/ows?language=eng&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&format=image/png&STYLE=default&layer=[layer]&" alt="Legend for [layer]" />
    <!-- query header to here -->

    but use some  inline styling in the template like:

    <!--MapServer Template -->
    <div style="display:none;">Request debugging:<br />crs=[CRS]<br />i=[I]<br />j=[J]<br />query_layers=[query_layers]<br />bbox=[BBOX]<br />feature_count=[FEATURE_COUNT]</div>
    <table summary="Query response for Terrafirma 1:5k ground motion WMS layer" class="hasTS">
    <thead><tr><th class="title">Terrafirma 1:5000 ground motion report</th></tr></thead>
    <tfoot><tr><td title="Time series data for selected point">
    <script type="text/javascript"><!--
    ...



    then a GetFeatureInfo request result looks like:

    http://ogc.bgs.ac.uk/cgi-bin/TFL-PSI/ows?language=eng&REQUEST=GetFeatureInfo&SERVICE=WMS&VERSION=1.3.0&LAYERS=GBR_Stoke-on-Trent_ESA_EN_5k_psi_TS&STYLES&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:4326&BBOX=53.0052235378464,-2.28573545848794,53.1251768672774,-2.13175281574312&WIDTH=1086&HEIGHT=846&QUERY_LAYERS=GBR_Stoke-on-Trent_ESA_EN_5k_psi_TS&i=337&j=255&info_format=text/html&



    James Passmore
    -------------------------------
    British Geological Survey,
    Environmental Science Centre,
    KEYWORTH,
    United Kingdom,
    NG12 5GG

    orcid: https://orcid.org/0000-0002-9891-6265
    -------------------------------
    Phone: +44 (0)115 936 3125
    -------------------------------
    Skype: BGSjames




    This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.

    _______________________________________________
    mapserver-users mailing list
    mapserver-users at lists.osgeo.org
    https://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list