All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.apis.vectortiles.model.TileSource Maven / Gradle / Ivy

The newest version!
package org.opentripplanner.apis.vectortiles.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.List;

/**
 * Represent a data source where Maplibre can fetch data for rendering directly in the browser.
 */
public sealed interface TileSource {
  @JsonSerialize
  String type();

  String id();

  /**
   * Represents a vector tile source which is rendered into a map in the browser.
   */
  record VectorSource(String id, String url) implements TileSource {
    @Override
    public String type() {
      return "vector";
    }
  }

  /**
   * Represents a raster-based source for map tiles. These are used mainly for background
   * map layers with vector data being rendered on top of it.
   */
  record RasterSource(String id, List tiles, int maxzoom, int tileSize, String attribution)
    implements TileSource {
    @Override
    public String type() {
      return "raster";
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy