1 //= require maplibre-gl/dist/maplibre-gl
2 //= require maplibre/controls
3 //= require maplibre/dom_util
4 //= require maplibre/styles
6 maplibregl.Map.prototype._getUIString = function (key) {
7 const snakeCaseKey = key.replaceAll(/(?<=\w)[A-Z]/g, "_$&").toLowerCase();
8 return OSM.i18n.t(`javascripts.map.${snakeCaseKey}`);
11 OSM.MapLibre.Map = class extends maplibregl.Map {
12 constructor({ allowRotation, ...options } = {}) {
13 const rotationOptions = {};
14 if (allowRotation === false) {
15 Object.assign(rotationOptions, {
18 pitchWithRotate: false,
26 if (allowRotation === false) {
27 map.touchZoomRotate.disableRotation();
28 map.keyboard.disableRotation();
34 OSM.MapLibre.SecondaryMap = class extends OSM.MapLibre.Map {
35 constructor(options = {}) {
36 const defaultHomeZoom = 11;
39 style: OSM.MapLibre.Styles.Mapnik,
40 attributionControl: false,
43 center: OSM.home ? [OSM.home.lon, OSM.home.lat] : [0, 0],
44 zoom: OSM.home ? defaultHomeZoom : 0,