Hi Ashish,

Sorry, I was a bit hasty in my response earlier.  I see that you are actually 
trying to conditionally style features of a single resource model now.  This is 
also possible, but a bit trickier…  I’ve managed to do this by exploiting the 
“displaydescription” property.  If you can include the typology information in 
your description for this resource model, then you can style on the contents of 
that.

For example, the following layer styles on “consultation type” in my local 
database (a typological field, concept datatype, which I have added to the 
description in the primary descriptor function) so that instances of type 
“Post-Application” and “Condition Application” get a distinct icon (you could 
add as many additional conditional icons as you desire):

    {
        "id": "search-results-points-markers",
        "type": "symbol",
        "paint": {},
        "filter": [
            "all",
            [
                "==",
                "$type",
                "Point"
            ],
            [
                "!=",
                "highlight",
                true
            ]
        ],
        "layout": {
            "icon-size": 1.3,
            "icon-image": [
                "case",                
                ["in", "Condition Application", ["get", "displaydescription"]], 
"airplane-15",
                ["in", "Post-Application", ["get", "displaydescription"]], 
"bicycle-15",
                "marker-15"
            ],
            "icon-offset": [
                0,
                -6
            ],
            "icon-allow-overlap": true
        },
        "source": "search-results-points"
    }

I had to use the “displaydescription” field here as there is only a limited 
number of fields exposed in the marker features.  Hopefully that works for you!

- Rob


> On Jul 10, 2020, at 9:19 AM, Rob Gaston <rgas...@fargeo.com> wrote:
> 
> Hi Ashish,
> 
> Yes, this is possible.  You can simply define your layer style to 
> conditionally style the “icon-image” on “graph_id” as in the example below:
> 
> [
>     {
>         "id": "search-results-points-markers",
>         "type": "symbol",
>         "paint": {},
>         "filter": [
>             "all",
>             [
>                 "==",
>                 "$type",
>                 "Point"
>             ],
>             [
>                 "!=",
>                 "highlight",
>                 true
>             ]
>         ],
>         "layout": {
>             "icon-size": 1.3,
>             "icon-image": [
>                 "match",
>                 ["get", "graph_id"],
>                 "8d41e49e-a250-11e9-9eab-00224800b26d",
>                 "bicycle-15",
>                 "marker-15"
>             ],
>             "icon-offset": [
>                 0,
>                 -6
>             ],
>             "icon-allow-overlap": true
>         },
>         "source": "search-results-points"
>     }
> ]
> 
> The “graph_id” property will always be available to style on when using the 
> “search-results-points” data source which is used to show map markers, so you 
> can style on that however you choose.
> 
> The question of how you can style these is not really an Arches question, but 
> really a Mapbox Style Spec one.  In the future, you can find all of the 
> information you need on how to style data using the Mapbox Style Spec here: 
> https://docs.mapbox.com/mapbox-gl-js/style-spec/ 
> <https://docs.mapbox.com/mapbox-gl-js/style-spec/>
> 
> I hope that helps!
> 
> - Rob
> 
> 
>> On Jul 9, 2020, at 5:00 AM, Ashish Karmacharya <chetan.ash...@gmail.com 
>> <mailto:chetan.ash...@gmail.com>> wrote:
>> 
>> Dears,
>> 
>> Are there already known ways to display location (point data) with our own 
>> custom icons on the Search Map. More importantly, are there ways to display 
>> different icons based on the different typologies within the same Resource 
>> Model. For example, in DANAM: https://uni-heidelberg.de/danam/ 
>> <https://uni-heidelberg.de/danam/>, we different types of monuments within 
>> Monuments Resource Model defined in the typology branch and we want to 
>> provide each typology a unique icon.
>> 
>> Thanks.
>> 
>> Ashish
>> 
>> -- 
>> -- To post, send email to archesproject@googlegroups.com 
>> <mailto:archesproject@googlegroups.com>. To unsubscribe, send email to 
>> archesproject+unsubscr...@googlegroups.com 
>> <mailto:archesproject+unsubscr...@googlegroups.com>. For more information, 
>> visit https://groups.google.com/d/forum/archesproject?hl=en 
>> <https://groups.google.com/d/forum/archesproject?hl=en>
>> --- You received this message because you are subscribed to the Google 
>> Groups "Arches Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to archesproject+unsubscr...@googlegroups.com 
>> <mailto:archesproject+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/archesproject/5F0706D6.4080302%40gmail.com 
>> <https://groups.google.com/d/msgid/archesproject/5F0706D6.4080302%40gmail.com>.
> 

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/archesproject/D16B31D5-A1C6-45D5-BBC5-284E9C9506ED%40fargeo.com.

Reply via email to