How do I change the scale displayed in Google Maps API v3 to imperial (miles) units

后端 未结 5 1106
离开以前
离开以前 2020-12-31 05:45

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

5条回答
  •  心在旅途
    2020-12-31 06:25

    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);
    

提交回复
热议问题