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