[Geomoose-users] AGS vector and styling

TC Haddad tchaddad at gmail.com
Sun Mar 24 17:49:32 PDT 2019


You could try having more than one layer in the map source - one for each
filter item?

On Sun, Mar 24, 2019 at 10:51 AM Kevin Grootendorst <kgrootendorst at gmail.com>
wrote:

> Update:
> I'm able to use <filter> to style for one condition, but am unable to do
> for 2 or more conditions.
>
> In the example below, I can filter the REST service to only show Trails
> that are "Seasonal".
>
>     <map-source name="ags5" type="ags-vector" srs="EPSG:3857"
> title="Norfolk Trails">
>         <url>
> http://services1.arcgis.com/mSGV2hCLXHNsfQqK/arcgis/rest/services/Trails/FeatureServer/0
> </url>
>
>         <layer name="Trails" status="on">
>                 <style><![CDATA[
>                     {
>                         "line-color" : "#A1A138",
>                         "line-width" : 2
>                     }
>                     ]]>
>                 </style>
>                 <filter><![CDATA[
>                 ["==", "STATUS", "Seasonal"]
>                 ]]></filter>
>         </layer>
>     </map-source>
>
> There is another "STATUS" = "Maintained" that I wish to also style.
> I've tried adding another <style> and <filter> for "Maintained" trails,
> but it will only draw the first <style> tags, which correspond to
> "Seasonal" trails.
> I also tried using <div> tags to somehow separate the two but that had no
> effect.
>
> Any other ideas on what I could try?
>
> Thanks.
> Kevin
>
>
> On Sun, 17 Mar 2019 at 17:24, Kevin Grootendorst <kgrootendorst at gmail.com>
> wrote:
>
>> Hello,
>> Can an ags-vector data type be styled based on attributes?
>> I understand the <style> tags, but they currently return one style for
>> the entire layer.
>> <layer name="Municipal_Land_Use_Plans" status="off">
>>             <style><![CDATA[
>>                 {
>>                     "line-color" : "#0e57cc",
>>                     "line-width" : 2
>>                 }
>>                 ]]>
>>             </style>
>>             <template name="identify" auto="true"/>
>>             <param name="FORMAT" value="png"/>
>>         </layer>
>>
>> If the layer has a field called 'Type' with unique attributes (wetland,
>> farm, etc.), can I style it based on this field?
>>
>> Thanks.
>>
>> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geomoose-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20190324/41d342d1/attachment.html>


More information about the Geomoose-users mailing list