Google Maps APIで正常にマップを取得できていたのですが、
数日後に確認したらなぜかマップを取得せずに、
下記のようなパスの画像を取得するようになっていました。
調べたのですが原因が分からず・・・。
心当たりがあるとすれば、非SSLのサイトなので、それが原因かもとは思っていますが。
下記のスクリプトで正常に表示されていました。
<script src="https://maps.googleapis.com/maps/api/js?key=(APIキー)&callback=initMap" async defer></script> <script> function initMap() { //一つ目の地図 var latlng = new google.maps.LatLng(35.679815, 139.764544); var myOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map_01 = new google.maps.Map( document.getElementById("map1"), //一つ目の地図のIDを指定 myOptions ); var marker = new google.maps.Marker({ position: latlng, map: map_01, }); //二つ目の地図 var latlng = new google.maps.LatLng(35.674611, 139.768935); var myOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map_02 = new google.maps.Map( document.getElementById("map2"), //二つ目の地図のIDを指定 myOptions ); var marker = new google.maps.Marker({ position: latlng, map: map_02, }); } </script> <div id="map1"></div> <div id="map2"></div>あなたの回答
tips
プレビュー