I\'m simply displaying a map, with no routing or directions. I can add the control with mapOptions = {...scaleControl: true,...} but I could find no documentation about cha
Ok so I came up with this BUT I would use this as a short term fix only.
function switchScale(mapId){
var spn = document.getElementById(mapId).getElementsByTagName("span");
for(var i in spn){
if( (/\d+\s?(mi|km)/g).test(spn[i].innerText) ){
spn[i].click();
}
}
}
This worked in chrome but I've heard that '.click()' can cause issues in some browser that use '.onclick()' instead.