Merge pull request #1443 from umap-project/minimap-style

Use map style options to style minimap bbox rectangle
This commit is contained in:
Yohan Boniface 2023-11-29 17:51:40 +01:00 committed by GitHub
commit 312863b2d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()
}) })