+
+L.Control.OSMReportAProblem = L.Control.Attribution.extend({
+ options: {
+ position: "bottomright",
+ prefix: "<a href=\"https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}\" target=\"_blank\">" + I18n.t("javascripts.embed.report_problem") + "</a>"
+ },
+
+ onAdd: function (map) {
+ var container = L.Control.Attribution.prototype.onAdd.call(this, map);
+
+ map.on("moveend", this._update, this);
+
+ return container;
+ },
+
+ _update: function () {
+ L.Control.Attribution.prototype._update.call(this);
+
+ this._container.innerHTML =
+ this._container.innerHTML
+ .replace("{x}", this._map.getCenter().lat)
+ .replace("{y}", this._map.getCenter().lng)
+ .replace("{z}", this._map.getZoom());
+ }
+});