Back to Blog

research

Choosing MapLibre Tile Sources: A Practical Guide for Agents

Learn how the maplibre-tile-sources skill helps agents pick the right data source for MapLibre maps, from GeoJSON to PMTiles.

OpenAgentSkillPublished:

Where this fits

You're building an agent that generates a map for a local business directory. The agent needs to decide: should it render 200 store locations as GeoJSON, or use a hosted vector tile service for a city-wide transit map? Without clear guidance, it might default to a heavy tile server for a tiny dataset or try to load a global basemap as inline GeoJSON. The maplibre-tile-sources skill gives agents a decision framework for matching data sources to scale, update frequency, and infrastructure constraints.

Why agents benefit

  • Source selection logic: The skill encodes when to use GeoJSON vs. PMTiles vs. hosted services, so agents can reason about trade-offs instead of guessing.
  • Configuration accuracy: It provides exact style JSON snippets for each source type, reducing syntax errors and missing type fields.
  • Sprite and glyph setup: Agents learn to configure sprites for icons and understand how they interact with tile sources, avoiding blank-map pitfalls.
  • Debugging guidance: The skill includes troubleshooting steps for missing tiles or blank maps, letting agents self-correct during map generation.
  • Migration support: For agents helping users move from Mapbox, it lists equivalent source types and style patterns, smoothing the transition.

Practical scenarios

Scenario 1: Store locator with a few hundred points

An agent builds a map for a coffee chain with 300 locations. The skill recommends using a GeoJSON source with clustering enabled, avoiding the overhead of a tile server. It provides the exact style snippet with cluster: true and clusterRadius.

Scenario 2: City transit map with frequent updates

For a transit agency that updates routes weekly, the agent uses a hosted vector tile service (like MapTiler or Stadia Maps) to keep data fresh without managing infrastructure. The skill explains how to reference the service's style URL and override specific layers.

Scenario 3: Offline-first mapping for a field crew

An agent prepares a map for a remote survey team. The skill suggests serverless PMTiles hosted on S3, enabling efficient offline caching. It shows how to add a PMTiles source and set the attribution and maxzoom correctly.

Add it to your agent workflow

Install the skill with:

npx skills add maplibre/maplibre-agent-skills --skill maplibre-tile-sources

Then, when your agent needs to render a map, it can reference the skill's decision tree. For example, if the user asks for a map of all national parks in the US, the agent will check the skill and choose a PMTiles source for the boundary data and a GeoJSON source for park markers, generating a style like:

{
  "sources": {
    "parks": {
      "type": "geojson",
      "data": "https://example.com/parks.geojson"
    }
  },
  "layers": [{
    "id": "parks-point",
    "type": "circle",
    "source": "parks"
  }]
}

Compare before adopting

Before adding this skill, compare it with other MapLibre agent skills (e.g., maplibre-fonts-glyphs) to see if your workflow also needs font handling. Evaluate the skill's freshness by checking the GitHub repo's commit history and issue responses. Also consider whether your agent already has a similar internal knowledge base—this skill is most valuable when you need authoritative, up-to-date source configuration patterns.

Why it is worth tracking

This skill is maintained by the MapLibre organization, has 137 stars, and is marked as verified, indicating it's been tested against real MapLibre versions. The MapLibre community actively evolves tile source best practices (e.g., PMTiles adoption), so tracking this skill ensures your agent's map decisions stay current. It's worth evaluating whenever you extend your agent to handle geospatial tasks or migrate from Mapbox. For a broader view of agent skills, see this skill on OpenAgentSkill.

Featured Skill

maplibre-tile-sources

Skill by maplibre