style.js

  1import { layers } from "@protomaps/basemaps";
  2
  3const rtw_custom_style = {
  4  background: "#FFFEFA00",
  5  earth: "#FFFEFA00",
  6  park_a: "hsla(72, 46%, 41%, 0.25)",
  7  park_b: "hsla(72, 46%, 41%, 0.25)",
  8  hospital: "#D7CFB2",
  9  industrial: "#D7CFB2",
 10  school: "#E1E1D1",
 11  wood_a: "hsla(72, 46%, 41%, 0.44)",
 12  wood_b: "hsla(72, 46%, 41%, 0.44)",
 13  pedestrian: "#E1E1D1",
 14  scrub_a: "hsla(72, 46%, 41%, 0.44)",
 15  scrub_b: "hsla(72, 46%, 41%, 0.44)",
 16  glacier: "hsla(0, 0%, 100%, 0.7)",
 17  sand: "hsla(54,81%,53%,0.3)",
 18  beach: "hsla(54,81%,53%,0.3)",
 19  aerodrome: "#D7CFB2",
 20  runway: "#D7CFB2",
 21  water: "#3BABA2",
 22  zoo: "#D7CFB2",
 23  military: "#D7CFB2",
 24
 25  tunnel_other_casing: "#e0e0e0",
 26  tunnel_minor_casing: "#e0e0e0",
 27  tunnel_link_casing: "#e0e0e0",
 28  tunnel_major_casing: "#e0e0e0",
 29  tunnel_highway_casing: "#e0e0e0",
 30  tunnel_other: "#d5d5d5",
 31  tunnel_minor: "#d5d5d5",
 32  tunnel_link: "#d5d5d5",
 33  tunnel_major: "#d5d5d5",
 34  tunnel_highway: "#d5d5d5",
 35
 36  pier: "#D7CFB2",
 37  buildings: "#CBC4A9",
 38
 39  minor_service_casing: "#ECCB60",
 40  minor_casing: "#ECCB60",
 41  link_casing: "#DFB431",
 42  major_casing_late: "#D0A215",
 43  highway_casing_late: "#D0A215",
 44  other: "#F1D67E",
 45  minor_service: "#ECCB60",
 46  minor_a: "#ECCB60",
 47  minor_b: "#ECCB60",
 48  link: "#DFB431",
 49  major_casing_early: "#D1A215",
 50  major: "#D1A215",
 51  highway_casing_early: "#D1A215",
 52  highway: "#D1A215",
 53
 54  railway: "#a7b1b3",
 55  boundaries: "#3F3D3B",
 56
 57  bridges_other_casing: "#F1D67E",
 58  bridges_minor_casing: "#ECCB60",
 59  bridges_link_casing: "#DFB431",
 60  bridges_major_casing: "#D1A215",
 61  bridges_highway_casing: "#D1A215",
 62  bridges_other: "#ebebeb",
 63  bridges_minor: "#ffffff",
 64  bridges_link: "#ffffff",
 65  bridges_major: "#f5f5f5",
 66  bridges_highway: "#ffffff",
 67
 68  roads_label_minor: "#272625",
 69  roads_label_minor_halo: "#ffffff",
 70  roads_label_major: "#272625",
 71  roads_label_major_halo: "#ffffff",
 72  ocean_label: "#272625",
 73  subplace_label: "#272625",
 74  subplace_label_halo: "#e0e0e0",
 75  city_label: "#272625",
 76  city_label_halo: "#e0e0e0",
 77  state_label: "#272625",
 78  state_label_halo: "#e0e0e0",
 79  country_label: "#272625",
 80
 81  address_label: "#272625",
 82  address_label_halo: "#ffffff",
 83
 84  pois: {
 85    blue: "#3171B2",
 86    green: "#768D21",
 87    lapis: "#2F968D",
 88    pink: "#B74583",
 89    red: "#C03E35",
 90    slategray: "#878580",
 91    tangerine: "#CB6120",
 92    turquoise: "#3AA99F",
 93  },
 94
 95  landcover: {
 96    grassland: "hsla(88, 40%, 78%, 0.8)",
 97    barren: "#FFFEFA00",
 98    urban_area: "#D7CFB200",
 99    farmland: "#EDEECF00",
100    glacier: "rgba(255, 255, 255, 1)",
101    scrub: "hsla(72, 46%, 41%, 0.25)",
102    forest: "hsla(72, 46%, 41%, 0.38)",
103  },
104};
105
106export const rtw_style = {
107  version: 8,
108  glyphs:
109    "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf",
110  sprite: "https://protomaps.github.io/basemaps-assets/sprites/v4/light",
111  sources: {
112    protomaps: {
113      type: "vector",
114      tiles: ["http://127.0.0.1:9090/india-nepal/{z}/{x}/{y}.mvt"],
115      attribution:
116        '<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org">OpenStreetMap</a>',
117    },
118    terrain: {
119      type: "raster-dem",
120      tiles: ["https://tiles.mapterhorn.com/{z}/{x}/{y}.webp"],
121      encoding: "terrarium",
122    },
123  },
124  layers: [
125    {
126      id: "rtw-hillshade",
127      source: "terrain",
128      type: "hillshade",
129      paint: {
130        "hillshade-method": "igor",
131        "hillshade-exaggeration": 0.2,
132        "hillshade-highlight-color": "rgb(255, 255, 228)",
133        "hillshade-shadow-color": "rgb(114, 124, 131)",
134      },
135    },
136    ...layers("protomaps", rtw_custom_style, { lang: "en" }),
137  ],
138};