import MapboxStyleLayer from "../MapboxStyleLayer";
const lineWidth = 15;
class HighlightRoutesLayer extends MapboxStyleLayer {
  highlightRoutes() {
    let names = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    let property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "route_names_gttos";
    const {
      mbMap,
      loaded
    } = this.mapboxLayer || {};
    if (loaded && mbMap && mbMap.getStyle()) {
      let lineWidthProp = 0;
      if (names.length) {
        const any = ["any"];
        names.forEach(name => {
          any.push(["in", name, ["get", property]]);
        });
        lineWidthProp = ["case", any, lineWidth, 0];
      }
      mbMap.getStyle().layers.filter(this.styleLayersFilter).forEach(layer => {
        mbMap.setPaintProperty(layer.id, "line-opacity", 0.8);
        mbMap.setPaintProperty(layer.id, "line-width", lineWidthProp);
      });
    }
  }
}
export default HighlightRoutesLayer;
//# sourceMappingURL=StsHighlightRoutesLayer.js.map