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

后端 未结 5 1108
离开以前
离开以前 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:27

    I came here from the Google Issue Tracker https://issuetracker.google.com/issues/35825255

    Here's an improved full example of the "click hack" from earlier posts:

    • uses just js (not Jquery)
    • regex to only match "km" and "m"
    • waits 1 second so Google Map can fully load first

    #map {
      height: 100%;
    }
    html, body {
      height: 100%;
      margin: 0;
      padding: 0;
    }

提交回复
热议问题