forked from MapComplete/MapComplete
MapComplete now always zooms up to level 21 with overzoom, fix #606
This commit is contained in:
parent
7a43b55245
commit
965faca0e5
6 changed files with 18 additions and 13 deletions
|
@ -156,11 +156,12 @@ export default class AvailableBaseLayersImplementation implements AvailableBaseL
|
||||||
|
|
||||||
const isUpper = urlObj.searchParams["LAYERS"] !== null;
|
const isUpper = urlObj.searchParams["LAYERS"] !== null;
|
||||||
const options = {
|
const options = {
|
||||||
maxZoom: maxZoom ?? 19,
|
maxZoom: Math.max(maxZoom ?? 19, 21),
|
||||||
|
maxNativeZoom: maxZoom ?? 19,
|
||||||
attribution: attribution + " | ",
|
attribution: attribution + " | ",
|
||||||
subdomains: domains,
|
subdomains: domains,
|
||||||
uppercase: isUpper,
|
uppercase: isUpper,
|
||||||
transparent: false
|
transparent: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const paramater of paramaters) {
|
for (const paramater of paramaters) {
|
||||||
|
@ -186,8 +187,9 @@ export default class AvailableBaseLayersImplementation implements AvailableBaseL
|
||||||
return L.tileLayer(url,
|
return L.tileLayer(url,
|
||||||
{
|
{
|
||||||
attribution: attribution,
|
attribution: attribution,
|
||||||
maxZoom: maxZoom,
|
maxZoom: Math.max(21, maxZoom ?? 19),
|
||||||
minZoom: 1,
|
maxNativeZoom: maxZoom ?? 19,
|
||||||
|
minZoom: 1,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
wmts: isWMTS ?? false,
|
wmts: isWMTS ?? false,
|
||||||
subdomains: domains
|
subdomains: domains
|
||||||
|
|
|
@ -93,7 +93,7 @@ export default class UserRelatedState extends ElementsState {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.layoutToUse.id.startsWith("http")){
|
if(this.layoutToUse?.id?.startsWith("http")){
|
||||||
if(!this.installedThemes.data.some(installed => installed.id === this.layoutToUse.id)){
|
if(!this.installedThemes.data.some(installed => installed.id === this.layoutToUse.id)){
|
||||||
|
|
||||||
this.installedThemes.data.push({
|
this.installedThemes.data.push({
|
||||||
|
|
|
@ -23,9 +23,9 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
||||||
private readonly _leafletoptions: any;
|
private readonly _leafletoptions: any;
|
||||||
private readonly _onFullyLoaded: (leaflet: L.Map) => void
|
private readonly _onFullyLoaded: (leaflet: L.Map) => void
|
||||||
private readonly _attribution: BaseUIElement | boolean;
|
private readonly _attribution: BaseUIElement | boolean;
|
||||||
private readonly _lastClickLocation: UIEventSource<{ lat: number; lon: number }>;
|
|
||||||
private readonly _bounds: UIEventSource<BBox> | undefined;
|
private readonly _bounds: UIEventSource<BBox> | undefined;
|
||||||
private readonly _addLayerControl: boolean;
|
private readonly _addLayerControl: boolean;
|
||||||
|
private readonly _options : MinimapOptions;
|
||||||
|
|
||||||
private constructor(options: MinimapOptions) {
|
private constructor(options: MinimapOptions) {
|
||||||
super()
|
super()
|
||||||
|
@ -39,8 +39,8 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
||||||
this._leafletoptions = options.leafletOptions ?? {}
|
this._leafletoptions = options.leafletOptions ?? {}
|
||||||
this._onFullyLoaded = options.onFullyLoaded
|
this._onFullyLoaded = options.onFullyLoaded
|
||||||
this._attribution = options.attribution
|
this._attribution = options.attribution
|
||||||
this._lastClickLocation = options.lastClickLocation;
|
|
||||||
this._addLayerControl = options.addLayerControl ?? false
|
this._addLayerControl = options.addLayerControl ?? false
|
||||||
|
this._options = options
|
||||||
MinimapImplementation._nextId++
|
MinimapImplementation._nextId++
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,7 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
||||||
touchZoom: this._allowMoving,
|
touchZoom: this._allowMoving,
|
||||||
// Disabling this breaks the geojson layer - don't ask me why! zoomAnimation: this._allowMoving,
|
// Disabling this breaks the geojson layer - don't ask me why! zoomAnimation: this._allowMoving,
|
||||||
fadeAnimation: this._allowMoving,
|
fadeAnimation: this._allowMoving,
|
||||||
|
maxZoom: 21
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.Merge(this._leafletoptions, options)
|
Utils.Merge(this._leafletoptions, options)
|
||||||
|
@ -244,7 +245,6 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
map.addLayer(newLayer);
|
map.addLayer(newLayer);
|
||||||
map.setMaxZoom(layer.max_zoom ?? map.getMaxZoom())
|
|
||||||
if (self._attribution !== true && self._attribution !== false) {
|
if (self._attribution !== true && self._attribution !== false) {
|
||||||
self._attribution?.AttachTo('leaflet-attribution')
|
self._attribution?.AttachTo('leaflet-attribution')
|
||||||
}
|
}
|
||||||
|
@ -300,8 +300,8 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this._lastClickLocation) {
|
if (this._options.lastClickLocation) {
|
||||||
const lastClickLocation = this._lastClickLocation
|
const lastClickLocation = this._options.lastClickLocation
|
||||||
map.on("click", function (e) {
|
map.on("click", function (e) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
lastClickLocation?.setData({lat: e.latlng.lat, lon: e.latlng.lng})
|
lastClickLocation?.setData({lat: e.latlng.lat, lon: e.latlng.lng})
|
||||||
|
|
|
@ -633,7 +633,7 @@
|
||||||
"mapRendering": [
|
"mapRendering": [
|
||||||
{
|
{
|
||||||
"icon": {
|
"icon": {
|
||||||
"render": "circle:#FE6F32;./assets/layers/bench/bench.svg"
|
"render": "./assets/layers/bench/bench.svg"
|
||||||
},
|
},
|
||||||
"iconSize": {
|
"iconSize": {
|
||||||
"render": "35,35,center"
|
"render": "35,35,center"
|
||||||
|
|
|
@ -436,6 +436,6 @@
|
||||||
"anonymous": "Anonymous user",
|
"anonymous": "Anonymous user",
|
||||||
"loginToAddComment": "Login to add a comment",
|
"loginToAddComment": "Login to add a comment",
|
||||||
"loginToAddPicture": "Login to add a picture",
|
"loginToAddPicture": "Login to add a picture",
|
||||||
"loginToClose": "Login to close this note",
|
"loginToClose": "Login to close this note"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -986,8 +986,11 @@
|
||||||
},
|
},
|
||||||
"name": "OpenStreetMap notes",
|
"name": "OpenStreetMap notes",
|
||||||
"tagRenderings": {
|
"tagRenderings": {
|
||||||
"Spam": {
|
"report-contributor": {
|
||||||
"render": "<a href='https://www.openstreetmap.org/reports/new?reportable_id={_first_user_id}&reportable_type=User' target='_blank' class='subtle'>Report {_first_user} as spam</a>"
|
"render": "<a href='https://www.openstreetmap.org/reports/new?reportable_id={_first_user_id}&reportable_type=User' target='_blank' class='subtle'>Report {_first_user} as spam</a>"
|
||||||
|
},
|
||||||
|
"report-note": {
|
||||||
|
"render": "<a href='https://www.openstreetmap.org/reports/new?reportable_id={id}&reportable_type=Note' target='_blank'>Report this note as spam or inappropriate</a>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue