2015年4月13日月曜日

2 - ol3.4ex 113a - Mobile full screen example 1

「Mobile full screen example (mobile-full-screen.html)」を参考に地図を表示してみます。

HTML ファイルの作成
a Eclipse のメニューの「ファイル」->「ファイルを開く」をクリックします。





b 「ファイルを開く」ウィンドウで、「user」->「mapsite」->「ol3proj」->「v3.4.0」->「examples」->「mobile-full-screen.html」をクリックして選択し、「OK」ボタンをクリックします。
同じように「mobile-full-screen.js」を開きます。





c メニューの「ファイル」->「新規」 -> 「ファイル」をクリックします。



d 「ファイル」ウィンドウで「ol3proj」をクリックして選択し、「ファイル名」を「2113-ol3ex.html」と入力し、「次へ」ボタンをクリックします。








e 「File Template」ウィンドウで「HTML 5 Template」をクリックして選択し、「OK」ボタンをクリックします。











f 「mobile-full-screen.html」の内容をコピーして「2113-ol3ex.html」に貼り付け、修正します。
g 同じように、新規に「2113-ol3ex.js」ファイルを作成し、「File Template」ウィンドウで「JavaScript Template」をクリックして選択し、「完了」ボタンをクリックして、「mobile-full-screen.js」の内容をコピーして貼り付け、修正します。「mobile-full-screen-require.js」も「2113-ol3ex-require.js」に貼り付けます。

「2113-ol3ex.html」
<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="chrome=1">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <title>Mobile full screen example</title>
  <style type="text/css">
   html, body, .map {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
   }
  </style>
 </head>
 <body>
  <div id="map" class="map"></div>
  <!--
  <script src="../resources/jquery.min.js" type="text/javascript"></script>
  <script src="../resources/example-behaviour.js" type="text/javascript"></script>
  -->
  <!-- ディレクトリ修正
   jQuery Minified版と
   example-behaviour.js(Examples用 JSコード[文字コードなど])
  -->
  <script src="v3.4.0/resources/jquery.min.js" type="text/javascript"></script>
  <script src="v3.4.0/resources/example-behaviour.js" type="text/javascript"></script>
  <!--
  <script src="loader.js?id=mobile-full-screen" type="text/javascript"></script>
  -->
  <!-- ファイル修正 -->  <!-- ディレクトリ修正 -->
  <script src="loader.js?id=2113-ol3ex" type="text/javascript"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.3/fastclick.js" type="text/javascript"></script>
  <div style="display: none;">
   <h4 id="title">Mobile full screen example</h4>
   <p id="shortdesc">Example of a full screen map.</p>
   <div id="tags">fullscreen, bing, geolocation, mobile</div>
  </div>
 </body>
</html>


FastClick
https://github.com/ftlabs/fastclick

FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
FastClick is developed by FT Labs, part of the Financial Times.

FastClick は、モバイルブラウザ上で物理的なタップとクリックイベントの発生の間の300msの遅延を解消するためのシンプルで使いやすいライブラリです。目的は、現在のロジックとの干渉を回避しながら、アプリケーションが少ないラグと高い応答性を感じるようにすることです。
FastClickは、FT研究所、フィナンシャル·タイムズの一部によって開発されています。

0 件のコメント: