EC-CUBE2系
「Google Maps API」→「Google Maps Platform」へのアップデートに伴い以下のように変更になりました。
Google Maps APIは、Webサイトの開発者がAPIキーを発行していなくても利用できましたが、Google Maps PlatformではAPIキーの利用が必須になります。
そのためAPIキーを取得していないと、サイトに埋め込んだGoogle Mapsが正常に表示されない場合があります。
▼修正方法
(1)GoogleMap APIを取得します。
取得方法は「googlemap api 取得」等で検索してください。
(2)下記のAPIキーのコードをファイルに追記してください。
key=***********************************&
赤色がAPIキーです。
■data/Smarty/templates/default/site_frame.tpl(フロントページ)
■data/Smarty/templates/admin/main_frame.tpl(管理画面)
<!--{if ($smarty.server.HTTPS != "") && ($smarty.server.HTTPS != "off")}--> <script type="text/javascript" src="https://maps-api-ssl.google.com/maps/api/js?sensor=false"></script> <!--{else}--> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <!--{/if}-->
↓
<!--{if ($smarty.server.HTTPS != "") && ($smarty.server.HTTPS != "off")}--> <script type="text/javascript" src="https://maps-api-ssl.google.com/maps/api/js?key=***********************************&sensor=false"></script> <!--{else}--> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=***********************************&sensor=false"></script> <!--{/if}-->