<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I believe the default WxS behavior is to expose no attributes. You need to be explicit and I don’t see the gml_include_items metadata property in the mapfile
 for the layer allcountries. You’d need something like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">“gml_include_items”    “mapcolor7”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Added to the allcountries layer. The mvt-demo does this for most layers…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">--Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> mapserver-users [mailto:mapserver-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>karsten<br>
<b>Sent:</b> Monday, February 04, 2019 4:33 PM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] styling based on attribute for MapServer derived MVTiles<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Dear All,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">I was working on the configuration of MapServer generated MVT tiles for a demo country world map and had success with MS v 7.2 outputting tiles in MVT format ( all
 thanks to <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsdlime%2Fmvt-demo&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006408831&sdata=QYGGj%2FDN87pFfCjzP0CHZBoomTp38zRhupXy2%2BjGyi8%3D&reserved=0">
https://github.com/sdlime/mvt-demo</a> ).</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">I am trying to work on the client side style for my demo map (using mapbox-gl.js) and defined them in a similar way as JSON as in Steve's mvt-demo above. The whole
 thing is later intended to be used in a benchmark for MapServer MVT rendering speed versus T-Rex ( see
<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.sourcepole.ch%2F2018%2F09%2F06%2Fthe-tale-of-a-vector-tile-benchmark%2F&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006418845&sdata=F7kfmr8XBKaraOdKcglqApDt%2BSuWAHSJ7x%2BTI6GJCHw%3D&reserved=0">
http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/</a> ) .</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">For now I am struggling with specifying the correct style syntax for the client side and it seem that I missing something as I was not yet able to successfully use
 attribute properties to render Countries as different colors based on an attribute field of my PostGIS source.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Below is the configuration of my 'allcountries' layer. The mapcolor7 filed is an integer field (in the input PostGIS source) but my set-up fails to output multiple
 colors , instead I am getting all default black for the country fill color. A second layer where I specified only Italy as one Country 'country-italy' to show up renders fine -  see
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fcountries_mvt.png&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006428858&sdata=1XeorZJ2Tf%2FeYSD2Cs5N3JcvszoU1nplrtrqDMc%2BqXw%3D&reserved=0">
https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">My complete style JSON is at
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fms_ne_simple.json&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006438854&sdata=O4%2F91Tdg2%2BCCiHCJr1hvWqc9f4K%2B%2FBa%2FJAW4vBHbY58%3D&reserved=0">
https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">and the corresponding map file is here
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fne.map&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006448867&sdata=CJawtbiFdYOcG2fa1PxgWHHfqV1Hz18tSz71k4N59ws%3D&reserved=0">
https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Would anyone know what I need to change in order to render the countries with different colors according to the 'mapcolor7' attribute ?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">To me it seems that somehow the attribute is not available to the renderer even though in the MapServer map file I am selecting all fields in the sub-query ...</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Thanks</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Karsten</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">--------------------------------------------</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">{<br>
    "id": "country-fill",<br>
    "type": "fill",<br>
    "source": "compass",<br>
    "source-layer": "allcountries",<br>
    "paint": {<br>
      "fill-color": {<br>
        "property": "mapcolor7",<br>
        "stops": [<br>
            [1, "#fdaf6b"],<br>
            [2, "#fdc663"],<br>
            [3, "#fae364"],<br>
            [4, "#d3e46f"],<br>
            [5, "#aadb78"],<br>
            [6, "#a3cec5"],<br>
            [7, "#ceb5cf"]<br>
        ]<br>
      }<br>
    }<br>
},{<br>
    "id": "country-italy",<br>
    "type": "fill",<br>
    "source": "compass",<br>
    "source-layer": "italy",<br>
    "paint": {<br>
      "fill-color": "#fdc663"<br>
      }<br>
  }</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana",sans-serif">Karsten Vennemann<br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Terra GIS
</span><o:p></o:p></p>
</div>
</body>
</html>