Why am I not able to see different coloured map markers?


Hi my manager_config.json looks like this :

{
  "loadLocales": true,
  "markers": {
  "TruckAsset": {
    "attributeName": "can_rpm",
    "showLabel": true,
    "showUnits": true,
    "colours": {
      "type": "range",
      "ranges": [
              {
                "min": 0,
                "colour": "00FF00"
              },
              {
                "min": 800,
                "colour": "FFFF00"
              },
              {
                "min": 1500,
                "colour": "FF0000"
              }
            ]
    }
  },
  "LightAsset": {
    "attributeName": "onOff",
    "showLabel": false,
    "showUnits": false,
    "colours": {
      "type": "boolean",
      "true": "6ae8fc",
      "false": "016170"
    }
  },
  "realms": {
    "default": {
      "appTitle": "GreenVision : Saarthi GreenTech",
      "styles": ":host > * {--or-app-color2: 
#F9F9F9; --or-app-color3: 
#22211f; --or-app-color4: 
#0c4da2; --or-app-color5: 
#CCCCCC;}",
      "logo": "/images/logo.png",
      "logoMobile": "/images/logo-mobile.png",
      "favicon": "/images/favicon.ico",
      "language": "en"
    }
  }
}

TruckAsset is my custom asset that i have created but the name is exactly “TruckAsset” in the file that I have created.

I have used the fleet-management repo
But my map markers remain blue

Hi has anyone encountered this error before? Still facing the issue.
Thanks in advance.

Hi!

I just checked my own configuration, and I think the format should be like this:

{
    "loadLocales": true,
    "realms": {
        ...
    }
    "pages": {
        "map": {
            "markers": {
                "MyCustomAsset": {
                    "attributeName": "myAttributeToShowTheValueOf",
                    "showLabel": true,
                    "showUnits": true,
                    "colours": {
                        "type": "range",
                        "ranges": [
                            {
                                "min": 0,
                                "colour": "00FF00"
                            },
                            {
                                "min": 800,
                                "colour": "FFFF00"
                            },
                            {
                                "min": 1500,
                                "colour": "FF0000"
                            }
                        ]
                    }
                }
            }
        }
    }
}

Hope this helps!

Hi, it still isn’t working for me:

{
  "loadLocales": true,
  "realms": {
    "master": {
      "appTitle": "GreenVision : Saarthi GreenTech",
      "styles": ":host > * {--or-app-color2: #F9F9F9; --or-app-color3: #22211f; --or-app-color4: #0c4da2; --or-app-color5: #CCCCCC;}",
      "logo": "/images/logo.png",
      "logoMobile": "/images/logo-mobile.png",
      "favicon": "/images/favicon.ico",
      "language": "en"
    }
  }
  "pages": {
    "map": {
      "markers": {
        "TruckAsset": {
          "attributeName": "can_rpm",
          "showLabel": true,
          "showUnits": true,
          "colours": {
            "type": "range",
            "ranges": [
              {
                "min": 0,
                "colour": "00FF00"
              },
              {
                "min": 800,
                "colour": "FFFF00"
              },
              {
                "min": 1500,
                "colour": "FF0000"
              }
            ]
          }
        }
      }
    }
  }
}

what I am thinking the issue is that can_rpm is an attribute I added via the GUI, meaning that in the truck asset, can_rpm doesn’t exist by default. Is that why the colour remains the same?
I have also added the map styling via a JSON generated by chatgpt which gaves rivers and landfills the colours. So is the issue?

Here is my truckasset for introspection :

package org.openremote.model.custom;

import jakarta.persistence.Entity;
import org.openremote.model.asset.AssetDescriptor;

/**
 * TruckAsset is an extension of the CarAsset class for fleet management.
 * It inherits all attributes from CarAsset and is used specifically for truck vehicles.
 */
@Entity
public class TruckAsset extends CarAsset {
    public static final AssetDescriptor<TruckAsset> DESCRIPTOR = new AssetDescriptor<>("truck", null, TruckAsset.class);

    protected TruckAsset() {
    }

    public TruckAsset(String name) {
        super(name);
    }

    public AssetDescriptor<TruckAsset> getAssetDescriptor() {
        return DESCRIPTOR;
    }
}

Do I need to add the attribute in this file for it to work?

Hey, @martin.peeters , can you take a look at this? I am still stuck.
Thanks

Hey @Saarthi, the marker “range” config will only apply when the attribute is present, has the correct type “number/integer/…” and the value matches any of the configured values.

So by default if the attribute doesn’t contain a value within any of the specified ranges it should show the label you specified with the default asset color.

image

Once you specify a value within any of the ranges you should see the color change.

image