Page 1 of 1

So modifizieren Sie die Skala -Balken -Schriftgröße in der Blattkarte

Posted: 17 Apr 2025, 23:37
by Anonymous
Wie kann die Schriftart des Maßstabs in der Flugblatt modifiziert werden? Beispiel unten von dem, was ich ohne Erfolg versucht habe: < /p>

Code: Select all

 library(leaflet)
library(htmltools)

# Create a basic Leaflet map
map %
addTiles() %>%
setView(lng = -121.2722, lat = 38.1341, zoom = 10)

# Add a scale bar to the map
map %
addScaleBar() %>%
onRender("
function(el, x) {
var map = this;
L.control.scale({
position: 'bottomleft',
imperial: false,
onRender: function(options) {
var scaleContainer = this._container;
scaleContainer.style.fontSize = '30px' !important;
}
}).addTo(map);
}
")
map