この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン | |||
yolp_1 [2018/05/14 21:31] 管理者 |
yolp_1 [2018/05/14 21:32] (現在) 管理者 |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
+ | {{tag>プログラミング関連 Yahoo_Map_API}} | ||
+ | [[start]]>[[programming_start]] | ||
+ | ====== Yahoo!Map API 地図の表示 ====== | ||
+ | DokuWiki に Yahoo! JavaScriptマップAPI の地図を表示します。 | ||
+ | ---- | ||
+ | ===== デモ ===== | ||
+ | <HTML> | ||
+ | <style> | ||
+ | #map img{max-width:none;} | ||
+ | </style> | ||
+ | <div id="map" style="width:400px; height:300px"></div> | ||
+ | |||
+ | <script type="text/javascript" charset="utf-8" src="https://map.yahooapis.jp/js/V1/jsapi?appid=dj00aiZpPWRic2U1eUVlUlZTdyZzPWNvbnN1bWVyc2VjcmV0Jng9Y2U-"></script> | ||
+ | <script type="text/javascript"> | ||
+ | window.onload = function(){ | ||
+ | var ymap = new Y.Map("map"); | ||
+ | ymap.drawMap(new Y.LatLng(35.66572, 139.73100), 17, Y.LayerSetId.NORMAL); | ||
+ | } | ||
+ | </script> | ||
+ | <!-- Begin Yahoo! JAPAN Web Services Attribution Snippet --> | ||
+ | <a href="https://developer.yahoo.co.jp/about"> | ||
+ | <img src="https://s.yimg.jp/images/yjdn/yjdn_attbtn2_105_17.gif" width="105" height="17" title="Webサービス by Yahoo! JAPAN" alt="Webサービス by Yahoo! JAPAN" border="0" style="margin:15px 15px 15px 15px"></a> | ||
+ | <!-- End Yahoo! JAPAN Web Services Attribution Snippet --> | ||
+ | </HTML> | ||
+ | |||
+ | ===== PR ===== | ||
+ | <html> | ||
+ | <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | ||
+ | <!-- respon_0 --> | ||
+ | <ins class="adsbygoogle" | ||
+ | style="display:block" | ||
+ | data-ad-client="ca-pub-9251612436023685" | ||
+ | data-ad-slot="1409739163" | ||
+ | data-ad-format="auto"></ins> | ||
+ | <script> | ||
+ | (adsbygoogle = window.adsbygoogle || []).push({}); | ||
+ | </script> | ||
+ | </html> | ||
+ | |||
+ | |||
+ | ===== サンプル ===== | ||
+ | 【アプリケーションID】の部分を各自で取得したIDに書き換えて、このコードを挿入して下さい。 | ||
+ | <code javascript> | ||
+ | <HTML> | ||
+ | <div id="map" style="width:400px; height:300px"></div> | ||
+ | |||
+ | <script type="text/javascript" charset="utf-8" src="https://map.yahooapis.jp/js/V1/jsapi?appid=【アプリケーションID】"></script> | ||
+ | <script type="text/javascript"> | ||
+ | window.onload = function(){ | ||
+ | var ymap = new Y.Map("map"); | ||
+ | ymap.drawMap(new Y.LatLng(35.66572, 139.73100), 17, Y.LayerSetId.NORMAL); | ||
+ | } | ||
+ | </script> | ||
+ | <!-- Begin Yahoo! JAPAN Web Services Attribution Snippet --> | ||
+ | <a href="https://developer.yahoo.co.jp/about"> | ||
+ | <img src="https://s.yimg.jp/images/yjdn/yjdn_attbtn2_105_17.gif" width="105" height="17" title="Webサービス by Yahoo! JAPAN" alt="Webサービス by Yahoo! JAPAN" border="0" style="margin:15px 15px 15px 15px"></a> | ||
+ | <!-- End Yahoo! JAPAN Web Services Attribution Snippet --> | ||
+ | </HTML> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | DokuWikiの標準テンプレートの場合、スタイルシートの影響で上記だけでは表示されません。html構文的に正しくないかもしれませんが下記コードを追加しmapのスタイルシートを標準状態にしてください。 | ||
+ | <code html> | ||
+ | <HTML> | ||
+ | <style> | ||
+ | #map img{max-width:none;} | ||
+ | </style> | ||
+ | </HTML> | ||
+ | </code> | ||
+ | |||
+ | ---- | ||
+ | [[start]]>[[programming_start]] |