Skip to content

Feat: Support "symbol" Layer type to display Icon as Data Point instead of circles. #64

@arnaudfnr

Description

@arnaudfnr

Currently in coordo-PY, when reading a resource from the datapackage, the layer_type is always set to "cricle".

See code here :

layer_type = "circle"

This due to the fact that when computing the colum "geom" of the config.json, the result will be a Point, Polygon, or Line type, which are usually depicted respectively with circle, fill or line in MapLibre Style Spec.

But as we can see in their doc here, it is also possible to set the layer type to "symbol" and add Layout properties to define the icon in the specifications, more or less like this:

{
  "layers":[
    {
      "id":"inventaire",
      "type":"symbol",
      "source":"maplibre",
      "layout":{
        "icon-image":"poi",
        "icon-size":0.5,
        "text-field":"{name}",
        "text-font":[
          "Noto Sans Regular"
        ],
        "text-size":12
      }
    }
  ]
}

To use an icon, we need to define a "sprite" URL at the root of the json style. (see doc here
After a thorough research, I found only a few sprites directly available on the web, with limited icons

The best way would be be to create our own spirte url, hosted on github, with lucide icons for instance. Here is a guide that can help doing that:
maplibre/maplibre-gl-js#3243

Metadata

Metadata

No fields configured for Feature.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions