最近研究了 Google My Maps 這是一個可以加標記、路線、測量距離的地圖工具,而且可以和他人協作! 也可以用來作行程規劃 (旅行、商務之類的) 我目前是把它用來標註我家附近曾經開過的商店XD (懷舊派) 測試用的自訂地圖 不過當我需要用到圓形的範圍圖時 卻無法在自訂地圖上叫出 (為了製作另一個小工具「範圍內通勤時間能接受的工作地點」) 於是我就找到了Google Map相關的API 目前Google主要是放在 Google Maps Platform 裡 後來到 Maps JavaScript API裡面的Shapes找到了circle的程式碼 把它改編然後去 增加相關金鑰(Key) 後 執行時出現錯誤... 此時開Chrome的開發人員工具 發現Console上寫說「You must enable Billing on the Google Cloud」 於是我就到 Google Cloud Platform 上使用VISA卡開通了享有300美金額度的權限 (額度用完的話就要真正花錢啦!) 開通後用了新的金鑰執行我的程式就變成了以下的結果 (終於成功啦!) 程式碼為 (「*yourKey*」部分記得改成自己的金鑰): <!DOCTYPE html> <div id="map"></div> <!-- Replace the value of the key parameter with your own API key. --> <script async defer src="https://maps.googleapis.com/maps/api/js?key=*yourKey*&callback=initMap"> </script> <style type="text/css"> /* Always set the map height explicitly to define the size of the div * element that contains the map. */ #map {