Use map style options to style minimap bbox rectangle

Ref:

https://forum.openstreetmap.fr/t/option-dexport-mini-carte/19223/6
This commit is contained in:
Yohan Boniface 2023-11-29 16:15:33 +01:00
parent 34e0461ca8
commit f8d2ecdd32

View file

@ -368,9 +368,17 @@ L.U.Map.include({
if (this.options.miniMap && !this.options.noControl) { if (this.options.miniMap && !this.options.noControl) {
this.whenReady(function () { this.whenReady(function () {
if (this.selected_tilelayer) { if (this.selected_tilelayer) {
this._controls.miniMap = new L.Control.MiniMap(this.selected_tilelayer).addTo( this._controls.miniMap = new L.Control.MiniMap(this.selected_tilelayer, {
this aimingRectOptions: {
) color: this.getOption('color'),
fillColor: this.getOption('fillColor'),
stroke: this.getOption('stroke'),
fill: this.getOption('fill'),
weight: this.getOption('weight'),
opacity: this.getOption('opacity'),
fillOpacity: this.getOption('fillOpacity'),
},
}).addTo(this)
this._controls.miniMap._miniMap.invalidateSize() this._controls.miniMap._miniMap.invalidateSize()
} }
}) })
@ -1304,6 +1312,7 @@ L.U.Map.include({
builder = new L.U.FormBuilder(this, shapeOptions, { builder = new L.U.FormBuilder(this, shapeOptions, {
callback: function (e) { callback: function (e) {
if (this._controls.miniMap) this.renderControls()
this.eachVisibleDataLayer((datalayer) => { this.eachVisibleDataLayer((datalayer) => {
datalayer.redraw() datalayer.redraw()
}) })