How do I change the scale displayed in Google Maps API v3 to imperial (miles) units
google-maps-api-3
Solution
Try this temp solution (here it is in a ready function):
var scaleInterval = setInterval(function() {
var scale = $(".gm-style-cc:not(.gmnoprint):contains(' km')");
if (scale.length) {
scale.click();
clearInterval(scaleInterval);
}
}, 100);
Problem
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 changing the units of the scale to imperial. Here's my code: ``` var mapOptions = { zoom: 4, mapTypeControl: false, center: new google.maps.LatLng(38.8282, -98.5795), mapTypeId: google.maps.MapTypeId.ROADMAP, scaleControl: true, scaleControlOptions: {position: google.maps.ControlPosition.BOTTOM_LEFT} }; google.maps.visualRefresh = true; map = new google.maps.Map(document.getElementById('map'),mapOptions); ``` Note: The ControlPosition appears not to work, always goes to bottom right.