One more thing… I notice that I used the icon name “airplane-15”.  This icon 
does not actually exist in the default sprite sheet that arches includes, so 
you will need to make sure you specify icons that are available to the map to 
display or else you won’t see anything on the map.  Hopefully that’s obvious, 
but if you try to use the style below verbatim it will not work by default.  
You could change “airplane-15” to something like “music-15” which is included 
in the default sprite sheet (supported icons for the default sprite sheet can 
be found here: 
https://api.mapbox.com/styles/v1/mapbox/basic-v9/spr...@2x.json?access_token=pk.eyJ1IjoiY2hpYXR0IiwiYSI6ImZRLTZDbVkifQ.2ZLLC1kInvxJ7isk_0_OMw
 
<https://api.mapbox.com/styles/v1/mapbox/basic-v9/spr...@2x.json?access_token=pk.eyJ1IjoiY2hpYXR0IiwiYSI6ImZRLTZDbVkifQ.2ZLLC1kInvxJ7isk_0_OMw>).

- Rob

> On Jul 10, 2020, at 12:24 PM, Rob Gaston <rgas...@fargeo.com> wrote:
> 
> 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 
>> <mailto: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/0E6A24FF-F15A-4A48-85AB-816712FACA91%40fargeo.com.

Reply via email to