diff --git a/baremaps-server/src/main/resources/assets/maplibre-gl-framerate.js b/baremaps-server/src/main/resources/assets/maplibre-gl-framerate.js new file mode 100644 index 000000000..5df1302c9 --- /dev/null +++ b/baremaps-server/src/main/resources/assets/maplibre-gl-framerate.js @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2019, Mapbox + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Source: + * https://github.com/mapbox/mapbox-gl-framerate + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.FrameRateControl = factory()); +}(this, (function () { 'use strict'; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } + + return target; + } + + var FrameRateControl = function FrameRateControl(options) { + var _this = this; + + _classCallCheck(this, FrameRateControl); + + _defineProperty(this, "onAdd", function (map) { + _this.map = map; + var dpr = window.devicePixelRatio; + var _this$options = _this.options, + width = _this$options.width, + graphWidth = _this$options.graphWidth, + graphHeight = _this$options.graphHeight, + color = _this$options.color, + background = _this$options.background, + font = _this$options.font; + var el = _this.container = document.createElement('div'); + el.className = 'maplibregl-ctrl maplibregl-ctrl-fps'; + el.style.backgroundColor = background; + el.style.borderRadius = '6px'; + _this.readOutput = document.createElement('div'); + _this.readOutput.style.color = color; + _this.readOutput.style.fontFamily = font; + _this.readOutput.style.padding = '0 5px 5px'; + _this.readOutput.style.fontSize = '9px'; + _this.readOutput.style.fontWeight = 'bold'; + _this.readOutput.textContent = 'Waiting…'; + _this.canvas = document.createElement('canvas'); + _this.canvas.className = 'maplibregl-ctrl-canvas'; + _this.canvas.width = width; + _this.canvas.height = graphHeight; + _this.canvas.style.cssText = "width: ".concat(width / dpr, "px; height: ").concat(graphHeight / dpr, "px;"); + el.appendChild(_this.readOutput); + el.appendChild(_this.canvas); + + _this.map.on('movestart', _this.onMoveStart); + + _this.map.on('moveend', _this.onMoveEnd); + + return _this.container; + }); + + _defineProperty(this, "onMoveStart", function () { + _this.frames = 0; + _this.time = performance.now(); + + _this.map.on('render', _this.onRender); + }); + + _defineProperty(this, "onMoveEnd", function () { + var now = performance.now(); + + _this.updateGraph(_this.getFPS(now)); + + _this.frames = 0; + _this.time = null; + + _this.map.off('render', _this.onRender); + }); + + _defineProperty(this, "onRender", function () { + _this.frames++; + var now = performance.now(); + + if (now >= _this.time + 1e3) { + _this.updateGraph(_this.getFPS(now)); + + _this.frames = 0; + _this.time = now; + } + }); + + _defineProperty(this, "getFPS", function (now) { + _this.totalTime += now - _this.time, _this.totalFrames += _this.frames; + return Math.round(1e3 * _this.frames / (now - _this.time)) || 0; + }); + + _defineProperty(this, "updateGraph", function (fpsNow) { + var _this$options2 = _this.options, + barWidth = _this$options2.barWidth, + graphRight = _this$options2.graphRight, + graphTop = _this$options2.graphTop, + graphWidth = _this$options2.graphWidth, + graphHeight = _this$options2.graphHeight, + background = _this$options2.background, + color = _this$options2.color; + + var context = _this.canvas.getContext('2d'); + + var fps = Math.round(1e3 * _this.totalFrames / _this.totalTime) || 0; + var rect = (barWidth); + context.fillStyle = background; + context.globalAlpha = 1; + context.fillRect(0, 0, graphWidth, graphTop); + context.fillStyle = color; + _this.readOutput.textContent = "".concat(fpsNow, " FPS (").concat(fps, " Avg)"); + context.drawImage(_this.canvas, graphRight + rect, graphTop, graphWidth - rect, graphHeight, graphRight, graphTop, graphWidth - rect, graphHeight); + context.fillRect(graphRight + graphWidth - rect, graphTop, rect, graphHeight); + context.fillStyle = background; + context.globalAlpha = 0.75; + context.fillRect(graphRight + graphWidth - rect, graphTop, rect, (1 - fpsNow / 100) * graphHeight); + }); + + _defineProperty(this, "onRemove", function () { + _this.map.off('render', _this.onRender); + + _this.map.off('movestart', _this.onMoveStart); + + _this.map.off('moveend', _this.onMoveEnd); + + _this.container.parentNode.removeChild(_this.container); + + _this.map = null; + return _this; + }); + + var _dpr = window.devicePixelRatio; + var defaultOptions = { + background: 'rgba(0,0,0,0.9)', + barWidth: 4 * _dpr, + color: '#7cf859', + font: 'Monaco, Consolas, Courier, monospace', + graphHeight: 60 * _dpr, + graphWidth: 90 * _dpr, + graphTop: 0, + graphRight: 5 * _dpr, + width: 100 * _dpr + }; + this.frames = 0; + this.totalTime = 0; + this.totalFrames = 0; + this.options = _objectSpread({}, options, defaultOptions); + }; + + if (window.maplibregl) { + maplibregl.FrameRateControl = FrameRateControl; + } + + return FrameRateControl; + +}))); \ No newline at end of file diff --git a/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.css b/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.css index 6730686ec..ac300630d 100644 --- a/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.css +++ b/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.css @@ -1,3 +1,38 @@ +/** + * BSD 3-Clause License + * + * Copyright (c) 2017, Lukas Martinelli + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Source: + * https://github.com/acalcutt/maplibre-gl-inspect + */ + .maplibregl-inspect_popup { color: #333; display: table; diff --git a/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.js b/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.js index 04f6d7570..a2ef598ce 100644 --- a/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.js +++ b/baremaps-server/src/main/resources/assets/maplibre-gl-inspect.js @@ -1 +1,35 @@ +/** + * BSD 3-Clause License + * + * Copyright (c) 2017, Lukas Martinelli + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Source: + * https://github.com/acalcutt/maplibre-gl-inspect + */ !function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MaplibreInspect=t()}(function(){return function r(o,i,s){function a(e,t){if(!i[e]){if(!o[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(u)return u(e,!0);throw(n=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",n}n=i[e]={exports:{}},o[e][0].call(n.exports,function(t){return a(o[e][1][t]||t)},n,n.exports,r,o,i,s)}return i[e].exports}for(var u="function"==typeof require&&require,t=0;t
'+t+'
'+(null==(e=e)?e:e instanceof Date?e.toLocaleString():"object"==typeof e||"number"==typeof e||"string"==typeof e?e.toString():e)+"
"}function r(t){return t.map(function(t){return'
'+(n='
'+((e=t).layer["source-layer"]||e.layer.source)+"
",r=o("$type",e.geometry.type),t=Object.keys(e.properties).map(function(t){return o(t,e.properties[t])}),[n,r].concat(t).join(""))+"
";var e,n,r}).join("")}e.exports=function(t){return'
'+r(t)+"
"}},{}],6:[function(t,e,n){function a(t,e,n){t={id:[e,n,"circle"].join("_"),source:e,type:"circle",paint:{"circle-color":t,"circle-radius":2},filter:["==","$type","Point"]};return n&&(t["source-layer"]=n),t}function u(t,e,n,r){t={id:[n,r,"polygon"].join("_"),source:n,type:"fill",paint:{"fill-color":t,"fill-antialias":!0,"fill-outline-color":t},filter:["==","$type","Polygon"]};return r&&(t["source-layer"]=r),t}function c(t,e,n){t={id:[e,n,"line"].join("_"),source:e,layout:{"line-join":"round","line-cap":"round"},type:"line",paint:{"line-color":t},filter:["==","$type","LineString"]};return n&&(t["source-layer"]=n),t}n.polygonLayer=u,n.lineLayer=c,n.circleLayer=a,n.generateInspectStyle=function(n,t,e){var e={id:"background",type:"background",paint:{"background-color":(e=Object.assign({backgroundColor:"#fff"},e)).backgroundColor}},r={};return Object.keys(n.sources).forEach(function(t){var e=n.sources[t];"vector"!==e.type&&"geojson"!==e.type||(r[t]=e)}),Object.assign(n,{layers:[e].concat(t),soources:r})},n.generateColoredLayers=function(e,n){var r=[],o=[],i=[];function s(t){t=n.bind(null,t);return{circle:t(.8),line:t(.6),polygon:t(.3),polygonOutline:t(.6),default:t(1)}}return Object.keys(e).forEach(function(n){var t=e[n];t&&0!==t.length?t.forEach(function(t){var e=s(t);o.push(a(e.circle,n,t)),i.push(c(e.line,n,t)),r.push(u(e.polygon,e.polygonOutline,n,t))}):(t=s(n),o.push(a(t.circle,n)),i.push(c(t.line,n)),r.push(u(t.polygon,t.polygonOutline,n)))}),r.concat(i).concat(o)}},{}],7:[function(t,Ft,Ht){!function($t){!function(){var r="__lodash_hash_undefined__",b=1,y=2,h=9007199254740991,p="[object Arguments]",f="[object Array]",e="[object AsyncFunction]",d="[object Boolean]",g="[object Date]",_="[object Error]",n="[object Function]",o="[object GeneratorFunction]",v="[object Map]",m="[object Number]",i="[object Null]",w="[object Object]",s="[object Promise]",a="[object Proxy]",j="[object RegExp]",k="[object Set]",O="[object String]",M="[object Symbol]",u="[object Undefined]",c="[object WeakMap]",I="[object ArrayBuffer]",C="[object DataView]",l=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[p]=A[f]=A[I]=A[d]=A[C]=A[g]=A[_]=A[n]=A[v]=A[m]=A[w]=A[j]=A[k]=A[O]=A[c]=!1;var t="object"==typeof $t&&$t&&$t.Object===Object&&$t,P="object"==typeof self&&self&&self.Object===Object&&self,z=t||P||Function("return this")(),L="object"==typeof Ht&&Ht&&!Ht.nodeType&&Ht,x=L&&"object"==typeof Ft&&Ft&&!Ft.nodeType&&Ft,R=x&&x.exports===L,E=R&&t.process,T=function(){try{return E&&E.binding&&E.binding("util")}catch(t){}}(),P=T&&T.isTypedArray;function B(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function $(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var F,H,x=Array.prototype,L=Function.prototype,N=Object.prototype,t=z["__core-js_shared__"],q=L.toString,D=N.hasOwnProperty,U=(T=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",G=N.toString,V=RegExp("^"+q.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=R?z.Buffer:void 0,t=z.Symbol,W=z.Uint8Array,J=N.propertyIsEnumerable,X=x.splice,K=t?t.toStringTag:void 0,Q=Object.getOwnPropertySymbols,T=L?L.isBuffer:void 0,Y=(F=Object.keys,H=Object,function(t){return F(H(t))}),R=kt(z,"DataView"),Z=kt(z,"Map"),x=kt(z,"Promise"),L=kt(z,"Set"),z=kt(z,"WeakMap"),tt=kt(Object,"create"),et=It(R),nt=It(Z),rt=It(x),ot=It(L),it=It(z),t=t?t.prototype:void 0,st=t?t.valueOf:void 0;function at(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=Number.MAX_SAFE_INTEGER);n++)e+=t.charCodeAt(n);return e}(t.seed);else{if(void 0!==t.seed&&null!==t.seed)throw new TypeError("The seed value must be an integer or string");a=null}var e,n;if(null===t.count||void 0===t.count)return function(t,e){switch(e.format){case"hsvArray":return t;case"hslArray":return y(t);case"hsl":var n=y(t);return"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)";case"hsla":var r=y(t),o=e.alpha||Math.random();return"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+o+")";case"rgbArray":return f(t);case"rgb":return"rgb("+f(t).join(", ")+")";case"rgba":r=f(t),o=e.alpha||Math.random();return"rgba("+r.join(", ")+", "+o+")";default:return function(t){t=f(t);function e(t){t=t.toString(16);return 1==t.length?"0"+t:t}return"#"+e(t[0])+e(t[1])+e(t[2])}(t)}}([e=function(t){{if(0o.length;){var s=c(t);null!==a&&(t.seed=a),o.push(s)}return t.count=r,o}var l=[];function p(t){for(var e in 334<=t&&t<=360&&(t-=360),u){var n=u[e];if(n.hueRange&&t>=n.hueRange[0]&&t<=n.hueRange[1])return u[e]}return"Color not found"}function h(t){if(null===a){var e=Math.random();return e+=.618033988749895,e%=1,Math.floor(t[0]+e*(t[1]+1-t[0]))}var n=t[1]||1,e=t[0]||0,t=(a=(9301*a+49297)%233280)/233280;return Math.floor(e+t*(n-e))}function t(t,e,n){var r=n[0][0],o=n[n.length-1][0],i=n[n.length-1][1],s=n[0][1];u[t]={hueRange:e,lowerBounds:n,saturationRange:[r,o],brightnessRange:[i,s]}}function f(t){var e=t[0];360===(e=0===e?1:e)&&(e=359),e/=360;var n=t[1]/100,r=t[2]/100,t=Math.floor(6*e),e=6*e-t,o=r*(1-n),i=r*(1-e*n),s=r*(1-(1-e)*n),a=256,u=256,c=256;switch(t){case 0:a=r,u=s,c=o;break;case 1:a=i,u=r,c=o;break;case 2:a=o,u=r,c=s;break;case 3:a=o,u=i,c=r;break;case 4:a=s,u=o,c=r;break;case 5:a=r,u=o,c=i}return[Math.floor(255*a),Math.floor(255*u),Math.floor(255*c)]}function d(t){t=3===(t=t.replace(/^#/,"")).length?t.replace(/(.)/g,"$1$1"):t;var e=parseInt(t.substr(0,2),16)/255,n=parseInt(t.substr(2,2),16)/255,r=parseInt(t.substr(4,2),16)/255,o=Math.max(e,n,r),i=o-Math.min(e,n,r),s=o?i/o:0;switch(o){case e:return[(n-r)/i%6*60||0,s,o];case n:return[60*((r-e)/i+2)||0,s,o];case r:return[60*((e-n)/i+4)||0,s,o]}}function y(t){var e=t[0],n=t[1]/100,r=t[2]/100,t=(2-n)*r;return[e,Math.round(n*r/(t<1?t:2-t)*1e4)/100,t/2*100]}return c},"object"==typeof n?(i=o(),(n="object"==typeof e&&e&&e.exports?e.exports=i:n).randomColor=i):r.randomColor=o()},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.css b/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.css index 3f4b10d66..72324efc8 100644 --- a/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.css +++ b/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.css @@ -1,3 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .maplibregl-ctrl-hide-boundaries { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --%3E%3Cpath d='M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zm96 64c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm0-384c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zM320 480c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm0-448c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zm0 256c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zM224 416c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zm0-320c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zM416 480c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm0-384c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zM32 32C14.3 32 0 46.3 0 64S14.3 96 32 96s32-14.3 32-32s-14.3-32-32-32zM416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zM32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zM224 384c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm192-64c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zM32 384c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zM416 128c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32zM32 192c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32zm192-64c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32s-14.3-32-32-32z'/%3E%3C/svg%3E"); background-repeat: no-repeat; @@ -11,4 +28,3 @@ background-size: 20px 20px; background-position: 5px 5px; } - diff --git a/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.js b/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.js index 2e1d089f0..75991dd01 100644 --- a/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.js +++ b/baremaps-server/src/main/resources/assets/maplibre-gl-tile-boundaries.js @@ -1,3 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + function container(child, show) { var container = document.createElement('div'); container.className = 'maplibregl-ctrl maplibregl-ctrl-group'; diff --git a/baremaps-server/src/main/resources/assets/viewer.html b/baremaps-server/src/main/resources/assets/viewer.html index 48d7a73c7..c20877bca 100644 --- a/baremaps-server/src/main/resources/assets/viewer.html +++ b/baremaps-server/src/main/resources/assets/viewer.html @@ -21,6 +21,7 @@ + @@ -109,7 +110,11 @@ bearing: map.getBearing(), hash: false, interactive: false, - }) + }); + + // Add the framerate control to the map + const fps = new maplibregl.FrameRateControl(); + map.addControl(fps); // Add the navigation control to the map map.addControl(new maplibregl.NavigationControl());