Use Token or Replacement Patterns support to change pin color / marker icon depending on the entity field / property

Created on 12 June 2024, 16 days ago
Updated 26 June 2024, 1 day ago

Problem/Motivation

I have a map of users i want the markers to be different depending on the role (the role is the field i am using for the tooltip) . how can i make the color change depending on the role?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Fixed

Version

10.2

Component

Documentation

Created by

🇺🇸United States dianacastillo Miami

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dianacastillo
  • Status changed to Fixed 16 days ago
  • 🇮🇹Italy itamair

    Hi @Diana, thanks for your support request.

    To accomplish your task you should consider that both the Leaflet Map View style and the Leaflet Formatter have the "Icon URL" option that support Token and Replacement Patterns,
    so you could use inside that some dynamic values that change depending on some property (field value) of the entity that you want to render, and that (for instance) generate a dynamic url pointing to the specific Marker Icon Url you want to associate to the specific entity/feature being processed in the map.
    It could be a specific field/property value of the entity, or the field/property value of a specific taxonomy term that is attribute to the entity, etc.
    Hope a couple of attached screenshot could make what I explained even more clear ...

    Feel free to reopen this if you still need clarification and support.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024