Skip to content

Commit

Permalink
Use map style options to style minimap bbox rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanboniface committed Nov 29, 2023
1 parent 34e0461 commit f8d2ecd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions umap/static/umap/js/umap.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,17 @@ L.U.Map.include({
if (this.options.miniMap && !this.options.noControl) {
this.whenReady(function () {
if (this.selected_tilelayer) {
this._controls.miniMap = new L.Control.MiniMap(this.selected_tilelayer).addTo(
this
)
this._controls.miniMap = new L.Control.MiniMap(this.selected_tilelayer, {
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()
}
})
Expand Down Expand Up @@ -1304,6 +1312,7 @@ L.U.Map.include({

builder = new L.U.FormBuilder(this, shapeOptions, {
callback: function (e) {
if (this._controls.miniMap) this.renderControls()
this.eachVisibleDataLayer((datalayer) => {
datalayer.redraw()
})
Expand Down

0 comments on commit f8d2ecd

Please sign in to comment.