Smart M.App discussions

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Frequent Contributor
Posts: 113
Registered: ‎01-20-2016
Accepted Solution

Add scale bar to BI Map


how can I add a scale bar to my BI map?


It worked well with leaflet in a custom panel.


var mymap ='mapid').setView([51.505, -0.09], 13);
var scaleBar = L.control.scale().addTo(mymap);



In my BI Map I do not know which div to address. "Map" didn't work and I lost the zooming functionality using mainMap.


Any help is appreciated



Technical Evangelist
Posts: 35
Registered: ‎04-07-2016

Re: Add scale bar to BI Map

Hello Ruth,


Scale Bar can be added using Leaflet controls but you must use a private API. To achieve this, paste the following snippet into the customization panel:


JS panel:

var scaleBar;
scaleBar = L.control.scale({position: "bottomright"}).addTo(adapter.__map);

CSS panel:

.leaflet-right {
    right: 0 !important;
    padding: 30px;
    z-index: 1;

Scale Bar will appear on bottom-right part of a map.


Best regards,


Frequent Contributor
Posts: 113
Registered: ‎01-20-2016

Re: Add scale bar to BI Map



thank you, this works well!