2015年11月30日月曜日

2 - ol3.11ex 140b - Reprojection with EPSG.io database search 2

「reprojection-by-code.js(2140-ol3ex.js)」は、マップを表示するための JavaScript ファイルです。

「2140-ol3ex.js」
var map = new ol.Map({
 layers: [
  new ol.layer.Tile({
  /** ol.layer.Tile 
   * For layer sources that provide pre-rendered, tiled 
   * images in grids that are organized by zoom levels for 
  * specific resolutions. 
   * プリレンダリング(事前描画)を提供するレイヤソースのため
   * の、特定の解像度でのズームレベルによって編成されているグ
   * リッドのタイルイメージ。(ol3 API)
   */
   source: new ol.source.MapQuest({layer: 'osm'})
 /** ol.source.MapQuest
  * Layer source for the MapQuest tile server.
  * MapQuest タイルサーバのレイヤソース。(ol3 API
  * 2 - ol3ex 23b - MapQuest example 2 参照)
  */
  })
 ],
 renderer: common.getRendererFromQueryString(),
// 'common.js' により URL にある renderer を返します
 target: 'map',
 view: new ol.View({
  projection: 'EPSG:3857',
  center: [0, 0],
  zoom: 1
 })
});
var queryInput = document.getElementById('epsg-query');
var searchButton = document.getElementById('epsg-search');
var resultSpan = document.getElementById('epsg-result');
var renderEdgesCheckbox = document.getElementById('render-edges');
function setProjection(code, name, proj4def, bbox) {
 if (code === null || name === null || proj4def === null || bbox === null) {
  resultSpan.innerHTML = 'Nothing usable found, using EPSG:3857...';
  map.setView(new ol.View({
  /** setView(view)
   * Set the view for this map.
   * map の view を設定します。(ol3 API)
   */
   projection: 'EPSG:3857',
   center: [0, 0],
   zoom: 1
  }));
  return;
 }
 resultSpan.innerHTML = '(' + code + ') ' + name;

 var newProjCode = 'EPSG:' + code;
 proj4.defs(newProjCode, proj4def);
 var newProj = ol.proj.get(newProjCode);
 var fromLonLat = ol.proj.getTransform('EPSG:4326', newProj);
/** ol.proj.getTransform(source, destination)
 * Given the projection-like objects, searches for a
 * transformation function to convert a coordinates 
 * array from the source projection to the destination 
 * projection.
 * projection 系オブジェクトを与えられると、変換関数のための
 * 検索は、ソース投影から宛先の投影にの座標の配列に変換します。
 * (ol3 API)
 */
 // very approximate calculation of projection extent
 // 投影範囲のより正確な近似計算
 var extent = ol.extent.applyTransform(
  [bbox[1], bbox[2], bbox[3], bbox[0]], fromLonLat);
 /** ol.extent.applyTransform(extent, transformFn, 
  * opt_extent)
  * Apply a transform function to the extent.
  * 範囲の transform 関数を適用します。(ol3 API)
  */
 newProj.setExtent(extent);
 /** setExtent(extent)
  * Set the validity extent for this projection.
  * この投影の有効範囲を設定します。(ol3 API)
  */
 var newView = new ol.View({
  projection: newProj
 });
 map.setView(newView);
 var size = map.getSize();
 /** getSize()
  * Get the size of this map.
  * Returns: The size in pixels of the map in the DOM.
  * マップのサイズを取得。(ol3 API)
  */
 if (size) {
  newView.fit(extent, size);
 /** fit(geometry, size, opt_options)
  * Fit the given geometry or extent based on the given map 
  * size and border. The size is pixel dimensions of the box 
  * to fit the extent into. In most cases you will want to 
  * use the map size, that is map.getSize(). Takes care of 
  * the map angle.
  * 指定されたマップのサイズと境界線に基づいて、指定されたジオメ
  * トリまたは範囲を合わせます。サイズは範囲に合わせてピクセル寸
  * 法のボックスです。ほとんどの場合、マップのサイズを使用します
  * が、それは map.getSize()。マップアングルに注意してくださ
  * い。
  * (ol3 API[説明は Stable Only のチェックを外すと表示])
  */
 }
}
function search(query) {
 resultSpan.innerHTML = 'Searching...';
 $.ajax({
 /** jQuery.ajax()
  * Perform an asynchronous HTTP (Ajax) request.
  * 非同期 HTTP(Ajax)リエストを実行します。
  * (jQuery[http://api.jquery.com/jquery.ajax/])
  */
 url: 'http://epsg.io/?format=json&q=' + query,
 dataType: 'jsonp',
 success: function(response) {
  if (response) {
   var results = response['results'];
   if (results && results.length > 0) {
    for (var i = 0, ii = results.length; i < ii; i++) {
     var result = results[i];
     if (result) {
      var code = result['code'], name = result['name'],
      proj4def = result['proj4'], bbox = result['bbox'];
      if (code && code.length > 0 && proj4def && proj4def.length > 0 &&
       bbox && bbox.length == 4) {
        setProjection(code, name, proj4def, bbox);
        return;
       }
      }
     }
    }
   }
   setProjection(null, null, null, null);
  }
 });
}
/**
 * @param {Event} e Change event.
 */
/** 「@param」
 * The @param tag provides the name, type, and 
 * description of a function parameter.
 * The @param tag requires you to specify the name of 
 * the parameter you are documenting. You can also 
 * include the parameter's type, enclosed in curly 
 * brackets, and a description of the parameter.
 * @paramタグは、関数パラメータの名前と型、説明を提供します。
 * @paramタグを使用すると、文書化されたパラメータの名前を
 * 指定する必要があります。また、パラメータのタイプと、中括弧
 * で囲まれたおよびパラメータの説明を含めることができます。
 * (@use JSDoc [http://usejsdoc.org/tags-param.html])
 */
searchButton.onclick = function(e) {
 search(queryInput.value);
 e.preventDefault();
 /** Event.preventDefault()
  * Cancels the event if it is cancelable, without 
  * stopping further propagation of the event.
  * イベントのさらなる伝播を停止させることなく、解約された場合
  * に、イベントをキャンセルします。
  * (MDN[https://developer.mozilla.org/en-US/docs/Web/
  * API/Event/preventDefault])
  */
};
/**
 * @param {Event} e Change event.
 */
renderEdgesCheckbox.onchange = function(e) {
/** GlobalEventHandlers.onchange()
 * The onchange property sets and returns the event handler 
 * for the change event.
 * onchange プロパティは、change イベントに対してイベントハ
 * ンドラを設定、および、返します。
 * (MDN[https://developer.mozilla.org/en-US/docs/Web/
 * API/GlobalEventHandlers/onchange])
 */
 map.getLayers().forEach(function(layer) {
 /** getLayers()
  * Get the collection of layers associated with this 
  * map.
  * このマップと関連するレイヤのコレクションを取得します。
  * (ol3 API)
  */
  if (layer instanceof ol.layer.Tile) {
  /** instanceof
   * instanceof 演算子は、オブジェクトが自身のプロトタイプに
   * コンストラクタの prototype プロパティを持っているかを確
   * 認します。
   * (MDN[https://developer.mozilla.org/ja/docs/
   * JavaScript/Reference/Operators/instanceof])
   */
   var source = layer.getSource();
   /** getSource()
    * Return the associated tilesource of the the layer.
    * タイルレイヤの関連するタイルソースを返します。(ol3 API)
    */
   if (source instanceof ol.source.TileImage) {
   /** ol.source.TileImage 
    * Base class for sources providing images divided into 
    * a tile grid.
    * タイルグリッドに分割された画像を提供するソースの基本クラ
    * ス。(ol3 API)
    */
    source.setRenderReprojectionEdges(renderEdgesCheckbox.checked);
    /** setRenderReprojectionEdges(render)
     * Sets whether to render reprojection edges or not 
     * (usually for debugging).
     * 再投影エッジをレンダリングするかしないか(通常はデバッグ
     * 用)を設定します。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
     */
   }
  }
 });
};

2 - ol3.11ex 140a - Reprojection with EPSG.io database search 1

「Reprojection with EPSG.io database search (reprojection-by-code.html)」を参考に地図を表示してみます。
説明に次のようにあります。

This example shows client-side raster reprojection capabilities from MapQuest OSM (EPSG:3857) to arbitrary projection by searching in EPSG.io database.
この例では、 EPSG.ioデータベースで検索することにより、MapQuest の OSM(3857 EPSG)から任意の投影へ:クライアント側のラスタ再投影キャパビリティを示しています。

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





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





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




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








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











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

「2140-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">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-combined.min.css" type="text/css">
  <!--
  <link rel="stylesheet" href="../css/ol.css" type="text/css">
  <link rel="stylesheet" href="./resources/layout.css" type="text/css">

  <link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
  <script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
  「resources」の位置が変わりました。
  -->
  <!-- ディレクトリ修正 -->
  <link rel="stylesheet" href="v3.11.2/css/ol.css" type="text/css">
  <link rel="stylesheet" href="v3.11.2/examples/resources/layout.css" type="text/css">

  <link rel="stylesheet" href="v3.11.2/examples/resources/prism/prism.css" type="text/css">
  <script src="v3.11.2/examples/resources/zeroclipboard/ZeroClipboard.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js">&lt/script>
  <title>Reprojection with EPSG.io database search</title>
 </head>
 <body>
  <!-- 
  bootstrap-combined.min.css, ol.css, layout.css,
  CSSファイルで設定されたセレクタを使用。
  -->
  <header class="navbar" role="navigation">
   <div class="container" id="navbar-inner-container">
    <!--
    <a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
    -->
    <!-- ディレクトリ修正 -->
    <a class="navbar-brand" href="v3.11.2/examples/"><img src="v3.11.2/examples/resources/logo-70x70.png"> OpenLayers 3 Examples</a>
   </div>
  </header>
  <div class="container-fluid">
   <div class="row-fluid">
    <div class="span12">
     <div id="map" class="map"></div>
    </div>
    <form class="form-inline">
     <label for="epsg-query">Search projection:</label>
     <input type="text" id="epsg-query" placeholder="4326, 27700, US National Atlas, Swiss, France, ..." class="form-control" size="50" />
     <button id="epsg-search" class="btn">Search</button>
     <span id="epsg-result"></span>
     <div>
      <label for="render-edges"><input type="checkbox" id="render-edges" />Render reprojection edges</label>
     </div>
    </form>
   </div>
   <div class="row-fluid">
    <div class="span12">
     <h4 id="title">Reprojection with EPSG.io database 
      search</h4>
     <p id="shortdesc">Demonstrates client-side raster 
      reprojection of MapQuest OSM to arbitrary 
       projection</p>
     <div id="docs"><p>This example shows client-side 
      raster reprojection capabilities from MapQuest OSM 
      (EPSG:3857) to arbitrary projection by searching in 
      <a href="http://epsg.io/">EPSG.io</a> database.</p>
     </div>
     <div id="tags">reprojection, projection, proj4js, 
      mapquest, epsg.io</div>
     <div id="api-links">Related API documentation: 
      <ul class="inline">
       <li>
      <!-- <a href="../apidoc/ol.Attribution.html" title="API documentation for ol.Attribution">ol.Attribution</a> -->
       <a href="v3.11.2/apidoc/ol.Attribution.html" title="API documentation for ol.Attribution">ol.Attribution</a>
       </li>,
      <li>
       <!-- <a href="../apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a> -->
       <a href="v3.11.2/apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a> -->
        <a href="v3.11.2/apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a> -->
        <a href="v3.11.2/apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.format.WMTSCapabilities.html" title="API documentation for ol.format.WMTSCapabilities">ol.format.WMTSCapabilities</a> -->
        <a href="v3.11.2/apidoc/ol.format.WMTSCapabilities.html" title="API documentation for ol.format.WMTSCapabilities">ol.format.WMTSCapabilities</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a> -->
        <a href="v3.11.2/apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a> -->
        <a href="v3.11.2/apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a>
       </li>,
      <li>
        <!-- <a href="../apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a> -->
        <a href="v3.11.2/apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.TileImage.html" title="API documentation for ol.source.TileImage">ol.source.TileImage</a> -->
        <a href="v3.11.2/apidoc/ol.source.TileImage.html" title="API documentation for ol.source.TileImage">ol.source.TileImage</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.TileWMS.html" title="API documentation for ol.source.TileWMS">ol.source.TileWMS</a> -->
        <a href="v3.11.2/apidoc/ol.source.TileWMS.html" title="API documentation for ol.source.TileWMS">ol.source.TileWMS</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.WMTS.html" title="API documentation for ol.source.WMTS">ol.source.WMTS</a> -->
        <a href="v3.11.2/apidoc/ol.source.WMTS.html" title="API documentation for ol.source.WMTS">ol.source.WMTS</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.XYZ.html" title="API documentation for ol.source.XYZ">ol.source.XYZ</a> -->
        <a href="v3.11.2/apidoc/ol.source.XYZ.html" title="API documentation for ol.source.XYZ">ol.source.XYZ</a>
       </li>,
        <li>
        <!-- <a href="../apidoc/ol.tilegrid.TileGrid.html" title="API documentation for ol.tilegrid.TileGrid">ol.tilegrid.TileGrid</a> -->
        <a href="v3.11.2/apidoc/ol.tilegrid.TileGrid.html" title="API documentation for ol.tilegrid.TileGrid">ol.tilegrid.TileGrid</a>
       </li>
      </ui>
     </div>
   </div>
  </div>
  <div class="row-fluid">
    <div id="source-controls">
     <a id="copy-button">
      <i class="fa fa-clipboard"></i> Copy
     </a>
     <a id="jsfiddle-button">
      <i class="fa fa-jsfiddle"></i> Edit
     </a>
    </div>
    <form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
    <textarea class="hidden" name="js">
// --- 省略 ---
&lt;/html&gt;</code></pre>
   </div>
  </div>
  <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <!--
  <script src="./resources/common.js"></script>
  <script src="./resources/prism/prism.min.js"></script>
  -->
  <!-- ディレクトリ修正
   CommonJS と
   prism.js
 -->
  <script src="v3.11.2/examples/resources/common.js"></script>
  <script src="v3.11.2/examples/resources/prism/prism.min.js"></script>
  <!-- 
  <script src="loader.js?id=reprojection"></script>
  -->
  <!-- ファイル修正 -->  <!-- ディレクトリ修正 -->
  <script src="loader.js?id=2140-ol3ex"></script>
  </body>
</html>


COMMONJS は

COMMONJS
http://webpack.github.io/docs/commonjs.html

に、次のようにあります。

The CommonJS group defined a module format to solve JavaScript scope issues by making sure each module is executed in its own namespace.
This is achieved by forcing modules to explicitly export those variables it wants to expose to the “universe”, and also by defining those other modules required to properly work.
To achieve this CommonJS give you two tools:
the require() function, which allows to import a given module into the current scope.
the module object, which allows to export something from the current scope.

CommonJSグループは、それ自身の名前空間内で実行されている各モジュールを確認することによって、JavaScriptのスコープ問題を解決するためのモジュールフォーマットを定義しました。
これは、それが「universe(?)」に公開したい変数を明示的にエクスポートするモジュールを強制することによって、同じように、正常に動作するのに必要な他のモジュールを定義することによって、達成されます。
この CommonJS を達成するために2つのツールを与えます:
require()関数、指定したモジュールを現在のスコープにインポートすることができます。
モジュールオブジェクト、現在のスコープからエクスポートすることができます。


Prism は、

Prism
http://prismjs.com/

に、次のようにあります。

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.
Prismは、最新のWeb標準に構築されたことを考慮し軽量で拡張可能なシンタックスハイライトです。それは Dabblet からスピンオフで、何千人も日々そこで試験されています。


ZeroClipboard は

ZeroClipboard v2.x
http://zeroclipboard.org/

に、次のようにあります。

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
ZeroClipboard ライブラリは、見えない Adobe Flash ムービーとJavaScript のインターフェイスを使用してテキストをクリップボードにコピーする簡単な方法を提供します。

Debian 8 では動作しませんでした。ボタンを右クリックしたときに flash のコンテキストメニューが表示されると動作しています。

2 - ol3.11ex 139b - Raster reprojection example 2

「reprojection.js(2139-ol3ex.js)」は、マップを表示するための JavaScript ファイルです。

「2139-ol3ex.js」
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
 '+x_0=400000 +y_0=-100000 +ellps=airy ' +
 '+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
 '+units=m +no_defs');
var proj27700 = ol.proj.get('EPSG:27700');
/** ol.proj.get(projectionLike)
 * Fetches a Projection object for the code specified.
 * 指定されたコードのプロジェクション·オブジェクトを取得
 * (ol3 API)
 */
proj27700.setExtent([0, 0, 700000, 1300000]);
/** setExtent(extent)
 * Set the validity extent for this projection.
 * この投影の有効範囲を設定します。(ol3 API)
 */
proj4.defs('EPSG:23032', '+proj=utm +zone=32 +ellps=intl ' +
 '+towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs');
var proj23032 = ol.proj.get('EPSG:23032');
proj23032.setExtent([-1206118.71, 4021309.92, 1295389.00, 8051813.28]);
proj4.defs('EPSG:5479', '+proj=lcc +lat_1=-76.66666666666667 +lat_2=' +
 '-79.33333333333333 +lat_0=-78 +lon_0=163 +x_0=7000000 +y_0=5000000 ' +
 '+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
var proj5479 = ol.proj.get('EPSG:5479');
proj5479.setExtent([6825737.53, 4189159.80, 9633741.96, 5782472.71]);
proj4.defs('EPSG:21781', '+proj=somerc +lat_0=46.95240555555556 ' +
 '+lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel ' +
 '+towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs');
var proj21781 = ol.proj.get('EPSG:21781');
proj21781.setExtent([485071.54, 75346.36, 828515.78, 299941.84]);
proj4.defs('EPSG:3413', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 ' +
 '+x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
var proj3413 = ol.proj.get('EPSG:3413');
proj3413.setExtent([-4194304, -4194304, 4194304, 4194304]);
proj4.defs('EPSG:2163', '+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 ' +
 '+a=6370997 +b=6370997 +units=m +no_defs');
var proj2163 = ol.proj.get('EPSG:2163');
proj2163.setExtent([-8040784.5135, -2577524.9210, 3668901.4484, 4785105.1096]);
proj4.defs('ESRI:54009', '+proj=moll +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 ' +
 '+units=m +no_defs');
var proj54009 = ol.proj.get('ESRI:54009');
proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]);
var layers = [];
layers['bng'] = new ol.layer.Tile({
/** ol.layer.Tile 
 * For layer sources that provide pre-rendered, tiled 
 * images in grids that are organized by zoom levels for 
 * specific resolutions. 
 * プリレンダリング(事前描画)を提供するレイヤソースのため
 * の、特定の解像度でのズームレベルによって編成されているグ
 * リッドのタイルイメージ。(ol3 API)
 */
 source: new ol.source.XYZ({
 /** ol.source.XYZ
  * Layer source for tile data with URLs in a set XYZ 
  * format that are defined in a URL template. By 
  * default, this follows the widely-used Google grid 
  * where x 0 and y 0 are in the top left. Grids like 
  * TMS where x 0 and y 0 are in the bottom left can 
  * be used by using the {-y} placeholder in the URL 
  * template, so long as the source does not have a 
  * custom tile grid. In this case, ol.source.TileImage 
  * can be used with a tileUrlFunction such as:
  *
  * tileUrlFunction: function(coordinate) { 
  *  return 'http://mapserver.com/' 
  *  + coordinate[0] + '/' 
  *  + coordinate[1] + '/' 
  *  + coordinate[2] + '.png'; }
  * 
  * URL テンプレートで定義されているセット XYZ 形式の URL 
  * を持つタイルデータのレイヤソース。デフォルトでは、これは、
  * x0 と y0 が左上にある広く使用されている Google のグリッド
  * に従います。x0 と y0 が左下にある TMS のようなグリッドは、
  * ソースがカスタムタイルグリッドを持っていない限り、URL テ
  * ンプレートに {-y} プレースホルダを使用して使用することが
  * できます。この場合、ol.source.TileImage は tileUrlFunction 
  * で次のように使用できます。(ol3 API)
  */
  projection: 'EPSG:27700',
  url: 'http://tileserver.maptiler.com/miniscale/{z}/{x}/{y}.png',
  /** url
   * URL template. Must include {x}, {y} or {-y}, and 
   * {z} placeholders. A {?-?} template pattern, for 
   * example subdomain{a-f}.domain.com, may be used 
   * instead of defining each one separately in the 
   * urls option.
   * URLテンプレート。 {x}、{y} または {-y}、と {z} プレース
   * ホルダを含める必要があります。例えば 
   * subdomain{a-f}.domain.com の {?-?} テンプレートパターン
   * は、urls オプションでそれぞれを個別に定義する代わりに、
   * 使用することができます。(ol3 API)
   */
  crossOrigin: '',
  /** crossOrigin
   * The crossOrigin attribute for loaded images. Note 
   * that you must provide a crossOrigin value if you 
   * are using the WebGL renderer or if you want to 
   * access pixel data with the Canvas renderer. See 
   * https://developer.mozilla.org/en-US/docs/Web/HTML/
   * CORS_enabled_image for more detail.
   * ロードされたイメージの crossOrigin属性。WebGLのレンダ
   * ラーを使用している場合、または、キャンバスレンダラでピ
   * クセルデータにアクセスする場合、crossOrigin 値を提供な
   * ければならないことに注意してください。詳細は 
   * https://developer.mozilla.org/en-US/docs/Web/HTML/
   * CORS_enabled_image を参照してください。(ol3 API)
   */
  maxZoom: 6
 })
});
layers['mapquest'] = new ol.layer.Tile({
 source: new ol.source.MapQuest({layer: 'osm'})
 /** ol.source.MapQuest
  * Layer source for the MapQuest tile server.
  * MapQuest タイルサーバのレイヤソース。(ol3 API
  * 2 - ol3ex 23b - MapQuest example 2 参照)
  */
});
layers['wms4326'] = new ol.layer.Tile({
 source: new ol.source.TileWMS({
 /** ol.source.TileWMS
  * Layer source for tile data from WMS servers.
  * WMS サーバからのタイルデータのレイヤソース。
  * (ol3 API)
  */
  url: 'http://demo.boundlessgeo.com/geoserver/wms',
  crossOrigin: '',
  params: {
  /** params
   * WMS request parameters. At least a LAYERS param is 
   * required. STYLES is '' by default. VERSION is 
   * 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS 
   * for WMS version < 1.3.0) will be set dynamically. 
   * Required.
   * WMSは、パラメータを要求します。少なくとも LAYERS の 
   * param が必要です。スタイルは「デフォルト」に従います。 
   * VERSION は、デフォルトでは 1.3.0 です。WIDTH、HIGHT、
   * BBOX と CRS(WMS バージョン 1.3.0 未満用 SRS)は、動的
   * に設定されます。 必須。(ol3 API)
   */
   'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
  },
  projection: 'EPSG:4326'
 })
});
layers['wms21781'] = new ol.layer.Tile({
 source: new ol.source.TileWMS({
  attributions: [new ol.Attribution({
  /** ol.Attribution
   * An attribution for a layer source.
   * レイヤソースの属性(ol3 API)
   */
   html: '&copy; ' +
    '<a href="http://www.geo.admin.ch/internet/geoportal/' +
    'en/home.html"≶' +
    'Pixelmap 1:1000000 / geo.admin.ch</a≶'
  })],
  crossOrigin: 'anonymous',
  params: {
   'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
   'FORMAT': 'image/jpeg'
  },
  url: 'http://wms.geo.admin.ch/',
  projection: 'EPSG:21781'
 })
});
var parser = new ol.format.WMTSCapabilities();
/** ol.format.WMTSCapabilities
 * Format for reading WMTS capabilities data
 * WMTS capabilities データを読み込むためのフォーマット。
 * (ol3 API)
 */
$.ajax('http://map1.vis.earthdata.nasa.gov/wmts-arctic/' +
 'wmts.cgi?SERVICE=WMTS&request=GetCapabilities').then(function(response) {
/** jQuery.ajax()
 * Perform an asynchronous HTTP (Ajax) request.
 * 非同期 HTTP(Ajax)リエストを実行します。
 * (jQuery[http://api.jquery.com/jquery.ajax/])
 */
/** deferred.then()
 * Add handlers to be called when the Deferred object is 
 * resolved, rejected, or still in progress. 
 * deferred オブジェクトが resolved、rejected か、まだ処理
 * 途中(progress)のとき呼び出されるハンドラを追加します。
 * (juery[http://api.jquery.com/deferred.then/])
 */
 var result = parser.read(response);
 /** read()
  * Read a WMTS capabilities document.
  * (ol3 API[説明は Stable Only のチェックを外すと表示])
  */
 var options = ol.source.WMTS.optionsFromCapabilities(result,
 /** ol.source.WMTS.optionsFromCapabilities
  * Return: WMTS source options object.
  * (ol3 API[説明は Stable Only のチェックを外すと表示])
  */
  {layer: 'OSM_Land_Mask', matrixSet: 'EPSG3413_250m'});
 options.crossOrigin = '';
 options.projection = 'EPSG:3413';
 options.wrapX = false;
 layers['wmts3413'] = new ol.layer.Tile({
  source: new ol.source.WMTS(options)
 });
});
layers['grandcanyon'] = new ol.layer.Tile({
 source: new ol.source.XYZ({
  url: 'http://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png',
  crossOrigin: '',
  tilePixelRatio: 2,
  /** tilePixelRatio
   * The pixel ratio used by the tile service. For 
   * example, if the tile service advertizes 256px by 
   * 256px tiles but actually sends 512px by 512px 
   * tiles (for retina/hidpi devices) then 
   * tilePixelRatio should be set to 2. Default is 1.
   * タイルサービスによって使用されるピクセル比。たとえば、タ
   * イルサービスが 256px x 256px タイルを通知する場合、実際
   * には 512px x 512px  タイル(retina / hidpiデバイス用)
   * を送信し、それから、タイル Pixel Ratio は 2 に設定しな
   * ければなりません。デフォルトは 1 です。
  * (ol3 API[説明は Stable Only のチェックを外すと表示])
   */
  maxZoom: 15,
  attributions: [new ol.Attribution({
   html: 'Tiles © USGS, rendered with ' +
    '<a href="http://www.maptiler.com/"≶MapTiler</a≶'
  })]
 })
});
var startResolution =
 ol.extent.getWidth(ol.proj.get('EPSG:3857').getExtent()) / 256;
 /** ol.extent.getWidth(extent)
  * Return: Width.(ol3 API)
  */
/** ol.proj.get(projectionLike)
 * Fetches a Projection object for the code specified.
 * 指定されたコードのプロジェクション·オブジェクトを取得
 * (ol3 API)
 */
/** getExtent()
 * Get the validity extent for this projection.
 * この投影の有効範囲を取得。(ol3 API)
 */
var resolutions = new Array(22);
/** Array(arraylength)
 * JavaScript は配列を扱うことができます。配列とは順序を持つ複
 * 数のデータの集合であり、JavaScript のグローバルオブジェクト 
 * である Array は、高位の、(C言語等で云うところの)「リス
 * ト」の様な、配列のコンストラクタです。
 * arraylength
 * Array コンストラクタに渡される唯一の引数(arrayLength)に 
 * 0 から 4,294,967,295( 232-1 ) までの整数値を指定する場合
 * その値を要素数とする配列が作成されます。その際に範囲外の値
 * は、を指定した場合には、例外: RangeError がスローされます。
 * (MDN[https://developer.mozilla.org/ja/docs/Web/
 * JavaScript/Reference/Global_Objects/Array])
 */
for (var i = 0, ii = resolutions.length; i < ii; ++i) {
 resolutions[i] = startResolution / Math.pow(2, i);
 /** Math.pow(base, exponent)
  * base を exponent 乗した値、つまり、base^exponent の
  * 値を返します。
  * (MDN[https://developer.mozilla.org/ja/docs/Web/
  * JavaScript/Reference/Global_Objects/Math/pow])
  */
}
layers['states'] = new ol.layer.Tile({
 source: new ol.source.TileWMS({
  url: 'http://demo.boundlessgeo.com/geoserver/wms',
  crossOrigin: '',
  params: {'LAYERS': 'topp:states', 'TILED': true},
  serverType: 'geoserver',
  /** serverType
   * The type of the remote WMS server. Currently 
   * only used when hidpi is true. Default is 
   * undefined.
   * リモート WMS サーバのタイプ。 現在、hidpi が true 
   * の場合のみ使用。デフォルトでは定義されていません。
  * (ol3 API[説明は Stable Only のチェックを外すと表示])
   */
  tileGrid: new ol.tilegrid.TileGrid({
  /** tileGrid
   * Tile grid. Base this on the resolutions, 
   * tilesize and extent supported by the server. 
   * If this is not defined, a default grid will be 
   * used: if there is a projection extent, the 
   * grid will be based on that; if not, a grid 
   * based on a global extent with origin at 
   * 0,0 will be used.
   * タイルグリッド。サーバーがサポートしていル解像度、タイル
   * サイズと範囲に関してこれに基づいています。これが定義され
   * ていない場合、デフォルトのグリッドが使用されます:投影範
   * 囲が存在する場合、グリッドはそれに基づくことになります。
   * そうでない場合は、0, 0 を原点とするグローバルな範囲に基
   * づいたグリッドが使用されます。(ol3 API)
   */
  /** ol.tilegrid.TileGrid
   * Base class for setting the grid pattern for 
   * sources accessing tiled-image servers.
   * タイル画像サーバにアクセスするソースのグリッドパターンを
   * 設定するための基本クラス。(ol3 API)
   */
   extent: [-13884991, 2870341, -7455066, 6338219],
   /** extent
    * Extent for the tile grid. No tiles outside this 
    * extent will be requested by ol.source.Tile 
    * sources. When no origin or origins are 
    * configured, the origin will be set to the 
    * top-left corner of the extent.
    * タイルグリッドの範囲。この範囲外ではタイルは 
    * ol.source.Tile ソースによって要求されません。origin 
    * がない、または、origins が構成されていない場合には、原点
    * は exten の左上隅に設定されます。
   * (ol3 API[説明は Stable Only のチェックを外すと表示])
    */
   resolutions: resolutions,
   /** resolutions
    * Resolutions. The array index of each resolution 
    * needs to match the zoom level. This means that 
    * even if a minZoom is configured, the resolutions 
    * array will have a length of maxZoom + 1. Required.
    * 解像度。各解像度の配列インデックスは、ズームレベルを一
    * 致させる必要があります。これは minZoom が設定されている
    * 場合でも、解像度配列は maxZoom+1 の長さを有することを意
    * 味します。必須。(ol3 API)
    */
   tileSize: [512, 256]
  }),
  projection: 'EPSG:3857'
 })
});
var map = new ol.Map({
 layers: [
  layers['mapquest'],
  layers['bng']
 ],
 renderer: common.getRendererFromQueryString(),
// 'common.js' により URL にある renderer を返します
 target: 'map',
 view: new ol.View({
  projection: 'EPSG:3857',
  center: [0, 0],
  zoom: 2
 })
});
var baseLayerSelect = document.getElementById('base-layer');
var overlayLayerSelect = document.getElementById('overlay-layer');
var viewProjSelect = document.getElementById('view-projection');
var renderEdgesCheckbox = document.getElementById('render-edges');
var renderEdges = false;
function updateViewProjection() {
 var newProj = ol.proj.get(viewProjSelect.value);
 var newProjExtent = newProj.getExtent();
 var newView = new ol.View({
  projection: newProj,
  center: ol.extent.getCenter(newProjExtent || [0, 0, 0, 0]),
  /** ol.extent.getCenter(extent)
   * Get the center coordinate of an extent.
   * 範囲の中心座標を取得します。(ol3 API)
   */
  zoom: 0,
  extent: newProjExtent || undefined
 });
 map.setView(newView);
 /** setView(view)
  * Set the view for this map.
  * map の view を設定します。(ol3 API)
  */
  // Example how to prevent double occurence of 
  // map by limiting layer extent
  // レイヤの範囲を制限することで、マップの二重の発生を防止
  // する方法の例。
 if (newProj == ol.proj.get('EPSG:3857')) {
  layers['bng'].setExtent([-1057216, 6405988, 404315, 8759696]);
 } else {
  layers['bng'].setExtent(undefined);
 }
}
/**
 * @param {Event} e Change event.
 */
/** 「@param」
 * The @param tag provides the name, type, and 
 * description of a function parameter.
 * The @param tag requires you to specify the name of 
 * the parameter you are documenting. You can also 
 * include the parameter's type, enclosed in curly 
 * brackets, and a description of the parameter.
 * @paramタグは、関数パラメータの名前と型、説明を提供します。
 * @paramタグを使用すると、文書化されたパラメータの名前を
 * 指定する必要があります。また、パラメータのタイプと、中括
 * 弧で囲まれたおよびパラメータの説明を含めることができます。
 * (@use JSDoc [http://usejsdoc.org/tags-param.html])
 */
viewProjSelect.onchange = function(e) {
/** GlobalEventHandlers.onchange()
 * The onchange property sets and returns the event handler 
 * for the change event.
 * onchange プロパティは、change イベントに対してイベントハ
 * ンドラを設定、および、返します。
 * (MDN[https://developer.mozilla.org/en-US/docs/Web/
 * API/GlobalEventHandlers/onchange])
 */
 updateViewProjection();
};

updateViewProjection();

var updateRenderEdgesOnLayer = function(layer) {
 if (layer instanceof ol.layer.Tile) {
 /** instanceof
  * instanceof 演算子は、オブジェクトが自身のプロトタイプに
  * コンストラクタの prototype プロパティを持っているかを確
  * 認します。
  * (MDN[https://developer.mozilla.org/ja/docs/
  * JavaScript/Reference/Operators/instanceof])
  */
  var source = layer.getSource();
  /** getSource()
   * Return the associated tilesource of the the layer.
   * タイルレイヤの関連するタイルソースを返します。(ol3 API)
   */
  if (source instanceof ol.source.TileImage) {
  /** ol.source.TileImage 
   * Base class for sources providing images divided into 
   * a tile grid.
   * タイルグリッドに分割された画像を提供するソースの基本ク
   * ラス。(ol3 API)
   */
   source.setRenderReprojectionEdges(renderEdges);
   /** setRenderReprojectionEdges(render)
    * Sets whether to render reprojection edges or not 
    * (usually for debugging).
    * 再投影エッジをレンダリングするかしないか(通常はデバッ
    * グ用)を設定します。
   * (ol3 API[説明は Stable Only のチェックを外すと表示])
    */
  }
 }
};
/**
 * @param {Event} e Change event.
 */
baseLayerSelect.onchange = function(e) {
 var layer = layers[baseLayerSelect.value];
 if (layer) {
  layer.setOpacity(1);
  /** setOpacity(opacity)
   * Set the opacity of the layer, allowed values range 
   * from 0 to 1.
   * レイヤの不透明度を設定します。許可される値は0から1まで
   * の範囲。(ol3 API)
   */
  updateRenderEdgesOnLayer(layer);
  map.getLayers().setAt(0, layer);
  /** getLayers()
   * Get the collection of layers associated with this 
   * map.
   * このマップと関連するレイヤのコレクションを取得します。
   * (ol3 API)
   */
  /** setAt(index, elem)
   * Set the element at the provided index
   * 提供されたインデックス位置にあるエレメントを設定します
   * (ol3 API)
   */
 }
};
/**
 * @param {Event} e Change event.
 */
overlayLayerSelect.onchange = function(e) {
 var layer = layers[overlayLayerSelect.value];
 if (layer) {
  layer.setOpacity(0.7);
  updateRenderEdgesOnLayer(layer);
  map.getLayers().setAt(1, layer);
 }
};
/**
 * @param {Event} e Change event.
 */
renderEdgesCheckbox.onchange = function(e) {
  renderEdges = renderEdgesCheckbox.checked;
  map.getLayers().forEach(function(layer) {
  /** forEach(f, opt_this)
   * Iterate over each element, calling the provided 
   * callback.
   * 提供されるコールバックを呼び出して、各エレメントを反復
   * 処理します。(ol3 API)
   */
  updateRenderEdgesOnLayer(layer);
 });
};

2 - ol3.11ex 139a - Raster reprojection example 1

「Raster reprojection example (reprojection.html)」を参考に地図を表示してみます。
説明に次のようにあります。

This example shows client-side raster reprojection between various projections.この例では、様々な投影法間のクライアント側のラスタ(ソース)の再投影を示しています。

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





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





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




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








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











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

「2139-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">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-combined.min.css" type="text/css">
  <!--
  <link rel="stylesheet" href="../css/ol.css" type="text/css">
  <link rel="stylesheet" href="./resources/layout.css" type="text/css">

  <link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
  <script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
  「resources」の位置が変わりました。
  -->
  <!-- ディレクトリ修正 -->
  <link rel="stylesheet" href="v3.11.2/css/ol.css" type="text/css">
  <link rel="stylesheet" href="v3.11.2/examples/resources/layout.css" type="text/css">

  <link rel="stylesheet" href="v3.11.2/examples/resources/prism/prism.css" type="text/css">
  <script src="v3.11.2/examples/resources/zeroclipboard/ZeroClipboard.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js">&lt/script>
  <title>Raster reprojection example</title>
 </head>
 <body>
  <!-- 
  bootstrap-combined.min.css, ol.css, layout.css,
  CSSファイルで設定されたセレクタを使用。
  -->
  <header class="navbar" role="navigation">
   <div class="container" id="navbar-inner-container">
    <!--
    <a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
    -->
    <!-- ディレクトリ修正 -->
    <a class="navbar-brand" href="v3.11.2/examples/"><img src="v3.11.2/examples/resources/logo-70x70.png"> OpenLayers 3 Examples</a>
   </div>
  </header>
  <div class="container-fluid">
   <div class="row-fluid">
    <div class="span12">
     <div id="map" class="map"></div>
    </div>
    <form class="form-inline">
     <div class="col-md-3">
      <label>Base map:</label>
      <select id="base-layer">
       <option value="mapquest">MapQuest (EPSG:3857)</option>
       <option value="wms4326">WMS (EPSG:4326)</option>
      </select>
     </div>
     <div class="col-md-4">
      <label>Overlay map:</label>
      <select id="overlay-layer">
       <option value="bng">British National Grid (EPSG:27700)</option>
       <option value="wms21781">Swisstopo WMS (EPSG:21781)</option>
       <option value="wmts3413">NASA Arctic WMTS (EPSG:3413)</option>
       <option value="grandcanyon">Grand Canyon HiDPI (EPSG:3857)</option>
       <option value="states">United States (EPSG:3857)</option>
      </select>
     </div>
     <div class="col-md-5">
      <label>View projection:</label>
      <select id="view-projection">
       <option value="EPSG:3857">Spherical Mercator (EPSG:3857)</option>
       <option value="EPSG:4326">WGS 84 (EPSG:4326)</option>
       <option value="ESRI:54009">Mollweide (ESRI:54009)</option>
       <option value="EPSG:27700">British National Grid (EPSG:27700)</option>
       <option value="EPSG:23032">ED50 / UTM zone 32N (EPSG:23032)</option>
       <option value="EPSG:2163">US National Atlas Equal Area (EPSG:2163)</option>
       <option value="EPSG:3413">NSIDC Polar Stereographic North (EPSG:3413)</option>
       <option value="EPSG:5479">RSRGD2000 / MSLC2000 (EPSG:5479)</option>
      </select>
     </div>
     <label for="render-edges"><input type="checkbox" id="render-edges" />
      Render reprojection edges</label> (only displayed on reprojected data)
    </form>
   </div>
   <div class="row-fluid">
    <div class="span12">
     <h4 id="title">Raster reprojection example</h4>
     <p id="shortdesc">Demonstrates client-side raster 
      reprojection between various projections.</p>
     <div id="docs"><p>This example shows client-side 
      raster reprojection between various projections. </p>
     </div>
     <div id="tags">reprojection, projection, proj4js, 
      mapquest, wms, wmts, hidpi</div>
     <div id="api-links">Related API documentation: 
      <ul class="inline">
       <li>
      <!-- <a href="../apidoc/ol.Attribution.html" title="API documentation for ol.Attribution">ol.Attribution</a> -->
       <a href="v3.11.2/apidoc/ol.Attribution.html" title="API documentation for ol.Attribution">ol.Attribution</a>
       </li>,
      <li>
       <!-- <a href="../apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a> -->
       <a href="v3.11.2/apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a> -->
        <a href="v3.11.2/apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a> -->
        <a href="v3.11.2/apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.format.WMTSCapabilities.html" title="API documentation for ol.format.WMTSCapabilities">ol.format.WMTSCapabilities</a> -->
        <a href="v3.11.2/apidoc/ol.format.WMTSCapabilities.html" title="API documentation for ol.format.WMTSCapabilities">ol.format.WMTSCapabilities</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a> -->
        <a href="v3.11.2/apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a> -->
        <a href="v3.11.2/apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a>
       </li>,
      <li>
        <!-- <a href="../apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a> -->
        <a href="v3.11.2/apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.TileImage.html" title="API documentation for ol.source.TileImage">ol.source.TileImage</a> -->
        <a href="v3.11.2/apidoc/ol.source.TileImage.html" title="API documentation for ol.source.TileImage">ol.source.TileImage</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.TileWMS.html" title="API documentation for ol.source.TileWMS">ol.source.TileWMS</a> -->
        <a href="v3.11.2/apidoc/ol.source.TileWMS.html" title="API documentation for ol.source.TileWMS">ol.source.TileWMS</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.WMTS.html" title="API documentation for ol.source.WMTS">ol.source.WMTS</a> -->
        <a href="v3.11.2/apidoc/ol.source.WMTS.html" title="API documentation for ol.source.WMTS">ol.source.WMTS</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.XYZ.html" title="API documentation for ol.source.XYZ">ol.source.XYZ</a> -->
        <a href="v3.11.2/apidoc/ol.source.XYZ.html" title="API documentation for ol.source.XYZ">ol.source.XYZ</a>
       </li>,
        <li>
        <!-- <a href="../apidoc/ol.tilegrid.TileGrid.html" title="API documentation for ol.tilegrid.TileGrid">ol.tilegrid.TileGrid</a> -->
        <a href="v3.11.2/apidoc/ol.tilegrid.TileGrid.html" title="API documentation for ol.tilegrid.TileGrid">ol.tilegrid.TileGrid</a>
       </li>
      </ui>
     </div>
   </div>
  </div>
  <div class="row-fluid">
    <div id="source-controls">
     <a id="copy-button">
      <i class="fa fa-clipboard"></i> Copy
     </a>
     <a id="jsfiddle-button">
      <i class="fa fa-jsfiddle"></i> Edit
     </a>
    </div>
    <form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
    <textarea class="hidden" name="js">
// --- 省略 ---
&lt;/html&gt;</code></pre>
   </div>
  </div>
  <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <!--
  <script src="./resources/common.js"></script>
  <script src="./resources/prism/prism.min.js"></script>
  -->
  <!-- ディレクトリ修正
   CommonJS と
   prism.js
 -->
  <script src="v3.11.2/examples/resources/common.js"></script>
  <script src="v3.11.2/examples/resources/prism/prism.min.js"></script>
  <!-- 
  <script src="loader.js?id=reprojection"></script>
  -->
  <!-- ファイル修正 -->  <!-- ディレクトリ修正 -->
  <script src="loader.js?id=2139-ol3ex"></script>
  </body>
</html>


COMMONJS は

COMMONJS
http://webpack.github.io/docs/commonjs.html

に、次のようにあります。

The CommonJS group defined a module format to solve JavaScript scope issues by making sure each module is executed in its own namespace.
This is achieved by forcing modules to explicitly export those variables it wants to expose to the “universe”, and also by defining those other modules required to properly work.
To achieve this CommonJS give you two tools:
the require() function, which allows to import a given module into the current scope.
the module object, which allows to export something from the current scope.

CommonJSグループは、それ自身の名前空間内で実行されている各モジュールを確認することによって、JavaScriptのスコープ問題を解決するためのモジュールフォーマットを定義しました。
これは、それが「universe(?)」に公開したい変数を明示的にエクスポートするモジュールを強制することによって、同じように、正常に動作するのに必要な他のモジュールを定義することによって、達成されます。
この CommonJS を達成するために2つのツールを与えます:
require()関数、指定したモジュールを現在のスコープにインポートすることができます。
モジュールオブジェクト、現在のスコープからエクスポートすることができます。


Prism は、

Prism
http://prismjs.com/

に、次のようにあります。

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.
Prismは、最新のWeb標準に構築されたことを考慮し軽量で拡張可能なシンタックスハイライトです。それは Dabblet からスピンオフで、何千人も日々そこで試験されています。


ZeroClipboard は

ZeroClipboard v2.x
http://zeroclipboard.org/

に、次のようにあります。

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
ZeroClipboard ライブラリは、見えない Adobe Flash ムービーとJavaScript のインターフェイスを使用してテキストをクリップボードにコピーする簡単な方法を提供します。

Debian 8 では動作しませんでした。ボタンを右クリックしたときに flash のコンテキストメニューが表示されると動作しています。

2 - ol3.11ex 138b - Image reprojection example 2

「reprojection-image.js(2138-ol3ex.js)」は、マップを表示するための JavaScript ファイルです。

「2138-ol3ex.js」
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
 '+x_0=400000 +y_0=-100000 +ellps=airy ' +
 '+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
 '+units=m +no_defs');
var imageExtent = [0, 0, 700000, 1300000];

var map = new ol.Map({
 layers: [
  new ol.layer.Tile({
  /** ol.layer.Tile 
   * For layer sources that provide pre-rendered, tiled 
   * images in grids that are organized by zoom levels for 
   * specific resolutions. 
   * プリレンダリング(事前描画)を提供するレイヤソースのため
   * の、特定の解像度でのズームレベルによって編成されているグ
   * リッドのタイルイメージ。(ol3 API)
   */
   source: new ol.source.MapQuest({layer: 'osm'})
   /** ol.source.MapQuest
    * Layer source for the MapQuest tile server.
    * MapQuest タイルサーバのレイヤソース。(ol3 API
    * 2 - ol3ex 23b - MapQuest example 2 参照)
    */
  }),
  new ol.layer.Image({
  /** ol.layer.Image
   * Server-rendered images that are available for arbitrary 
   * extents and resolutions. 
   * 任意の範囲と解像度で利用可能な server-rendered イメージ。
   * (ol3 API)
   */
   source: new ol.source.ImageStatic({
   /** source.ImageStatic
    * A layer source for displaying a single, static image.
    * 単一で静的(東映データが付加されていない)画像の表示のため
    * のレイヤソース。(ol3 API)
    */
    url: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' +
     'British_National_Grid.svg/2000px-British_National_Grid.svg.png',
    crossOrigin: '',
    /** crossOrigin
     * The crossOrigin attribute for loaded images. Note 
     * that you must provide a crossOrigin value if you 
     * are using the WebGL renderer or if you want to 
     * access pixel data with the Canvas renderer. See 
     * https://developer.mozilla.org/en-US/docs/Web/HTML/
     * CORS_enabled_image for more detail.
     * ロードされたイメージの crossOrigin属性。WebGLのレンダ
     * ラーを使用している場合、または、キャンバスレンダラでピ
     * クセルデータにアクセスする場合、crossOrigin 値を提供な
     * ければならないことに注意してください。詳細は 
     * https://developer.mozilla.org/en-US/docs/Web/HTML/
     * CORS_enabled_image を参照してください。(ol3 API)
     */
    projection: 'EPSG:27700',
    imageExtent: imageExtent
    /** imageExtent
     * Extent of the image in map coordinates. This is the 
     * [left, bottom, right, top] map coordinates of your 
     * image. Required.
     * マップ座標の画像の範囲が調整。これは、イメージのマップ座標
     * [左、下、右、上]です。 必須。(ol3 API)
     */
   })
  })
 ],
 renderer: common.getRendererFromQueryString(),
// 'common.js' により URL にある renderer を返します
 target: 'map',
 view: new ol.View({
  center: ol.proj.transform(ol.extent.getCenter(imageExtent),
   'EPSG:27700', 'EPSG:3857'),
  /** ol.proj.transform(coordinate, source, destination)
   * Transforms a coordinate from source projection to 
   * destination projection. This returns a new coordinate 
   * (and does not modify the original).
   * ソース投影から変換先投影に座標変換します。これは、新しい座標
   * を返します(オリジナルを変更しません)。(ol3 API)
   */
  /** ol.extent.getCenter(extent)
   * Get the center coordinate of an extent.
   * 範囲の中心座標を取得します。(ol3 API)
   */
  zoom: 4
 })
});

2 - ol3.11ex 138a - Image reprojection example 1

「Image reprojection example (reprojection-image.html)」を参考に地図を表示してみます。
説明に次のようにあります。

This example shows client-side reprojection of single image source.この例では、単一イメージ(画像)ソースのクライアント側の再投影を示しています。

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





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





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




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








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











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

「2138-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">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-combined.min.css" type="text/css">
  <!--
  <link rel="stylesheet" href="../css/ol.css" type="text/css">
  <link rel="stylesheet" href="./resources/layout.css" type="text/css">

  <link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
  <script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
  「resources」の位置が変わりました。
  -->
  <!-- ディレクトリ修正 -->
  <link rel="stylesheet" href="v3.11.2/css/ol.css" type="text/css">
  <link rel="stylesheet" href="v3.11.2/examples/resources/layout.css" type="text/css">

  <link rel="stylesheet" href="v3.11.2/examples/resources/prism/prism.css" type="text/css">
  <script src="v3.11.2/examples/resources/zeroclipboard/ZeroClipboard.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js">&lt/script>
  <title>Image reprojection example</title>
 </head>
 <body>
  <!-- 
  bootstrap-combined.min.css, ol.css, layout.css,
  CSSファイルで設定されたセレクタを使用。
  -->
  <header class="navbar" role="navigation">
   <div class="container" id="navbar-inner-container">
    <!--
    <a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
    -->
    <!-- ディレクトリ修正 -->
    <a class="navbar-brand" href="v3.11.2/examples/"><img src="v3.11.2/examples/resources/logo-70x70.png"> OpenLayers 3 Examples</a>
   </div>
  </header>
  <div class="container-fluid">
   <div class="row-fluid">
    <div class="span12">
     <div id="map" class="map"></div>
    </div>
   </div>
   <div class="row-fluid">
    <div class="span12">
     <h4 id="title">Image reprojection example</h4>
     <p id="shortdesc">Demonstrates client-side reprojection 
       of single image source.</p>
     <div id="docs"><p>This example shows client-side 
      reprojection of single image source. </p>
     </div>
     <div id="tags">reprojection, projection, proj4js, 
      mapquest, image, imagestatic</div>
     <div id="api-links">Related API documentation: 
      <ul class="inline">
       <li>
       <!-- <a href="../apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a> -->
        <a href="v3.11.2/apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a> -->
        <a href="v3.11.2/apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a> -->
        <a href="v3.11.2/apidoc/ol.extent.html" title="API documentation for ol.extent">ol.extent</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.layer.Image.html" title="API documentation for ol.layer.Image">ol.layer.Image</a> -->
        <a href="v3.11.2/apidoc/ol.layer.Image.html" title="API documentation for ol.layer.Image">ol.layer.Image</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a> -->
        <a href="v3.11.2/apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a> -->
        <a href="v3.11.2/apidoc/ol.proj.html" title="API documentation for ol.proj">ol.proj</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.ImageStatic.html" title="API documentation for ol.source.ImageStatic">ol.source.ImageStatic</a> -->
        <a href="v3.11.2/apidoc/ol.source.ImageStatic.html" title="API documentation for ol.source.ImageStatic">ol.source.ImageStatic</a>
       </li>
       <li>
        <!-- <a href="../apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a> -->
        <a href="v3.11.2/apidoc/ol.source.MapQuest.html" title="API documentation for ol.source.MapQuest">ol.source.MapQuest</a>
       </li>
      </ui>
     </div>
   </div>
  </div>
  <div class="row-fluid">
    <div id="source-controls">
     <a id="copy-button">
      <i class="fa fa-clipboard"></i> Copy
     </a>
     <a id="jsfiddle-button">
      <i class="fa fa-jsfiddle"></i> Edit
     </a>
    </div>
    <form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
    <textarea class="hidden" name="js">
// --- 省略 ---
&lt;/html&gt;</code></pre>
   </div>
  </div>
  <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <!--
  <script src="./resources/common.js"></script>
  <script src="./resources/prism/prism.min.js"></script>
  -->
  <!-- ディレクトリ修正
   CommonJS と
   prism.js
 -->
  <script src="v3.11.2/examples/resources/common.js"></script>
  <script src="v3.11.2/examples/resources/prism/prism.min.js"></script>
  <!-- 
  <script src="loader.js?id=reprojection-image"></script>
  -->
  <!-- ファイル修正 -->  <!-- ディレクトリ修正 -->
  <script src="loader.js?id=2138-ol3ex"></script>
  </body>
</html>


COMMONJS は

COMMONJS
http://webpack.github.io/docs/commonjs.html

に、次のようにあります。

The CommonJS group defined a module format to solve JavaScript scope issues by making sure each module is executed in its own namespace.
This is achieved by forcing modules to explicitly export those variables it wants to expose to the “universe”, and also by defining those other modules required to properly work.
To achieve this CommonJS give you two tools:
the require() function, which allows to import a given module into the current scope.
the module object, which allows to export something from the current scope.

CommonJSグループは、それ自身の名前空間内で実行されている各モジュールを確認することによって、JavaScriptのスコープ問題を解決するためのモジュールフォーマットを定義しました。
これは、それが「universe(?)」に公開したい変数を明示的にエクスポートするモジュールを強制することによって、同じように、正常に動作するのに必要な他のモジュールを定義することによって、達成されます。
この CommonJS を達成するために2つのツールを与えます:
require()関数、指定したモジュールを現在のスコープにインポートすることができます。
モジュールオブジェクト、現在のスコープからエクスポートすることができます。


Prism は、

Prism
http://prismjs.com/

に、次のようにあります。

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.
Prismは、最新のWeb標準に構築されたことを考慮し軽量で拡張可能なシンタックスハイライトです。それは Dabblet からスピンオフで、何千人も日々そこで試験されています。


ZeroClipboard は

ZeroClipboard v2.x
http://zeroclipboard.org/

に、次のようにあります。

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
ZeroClipboard ライブラリは、見えない Adobe Flash ムービーとJavaScript のインターフェイスを使用してテキストをクリップボードにコピーする簡単な方法を提供します。

Debian 8 では動作しませんでした。ボタンを右クリックしたときに flash のコンテキストメニューが表示されると動作しています。

2 - ol3.11ex 137b - OpenStreetMap reprojection example 2

「reprojection-wgs84.js(2137-ol3ex.js)」は、マップを表示するための JavaScript ファイルです。

「2137-ol3ex.js」
var map = new ol.Map({
 layers: [
  new ol.layer.Tile({
  /** ol.layer.Tile 
   * For layer sources that provide pre-rendered, tiled 
   * images in grids that are organized by zoom levels for 
   * specific resolutions. 
   * プリレンダリング(事前描画)を提供するレイヤソースのため
   * の、特定の解像度でのズームレベルによって編成されているグ
   * リッドのタイルイメージ。(ol3 API)
   */
   source: new ol.source.OSM()
   /** ol.source.OSM 
    * Layer source for the OpenStreetMap tile server.
    * OpenStreetMap タイルサーバのレイヤソース。(ol3 API)
    */
  })
 ],
 renderer: common.getRendererFromQueryString(),
// 'common.js' により URL にある renderer を返します
 target: 'map',
 view: new ol.View({
  projection: 'EPSG:4326',
  center: [0, 0],
  zoom: 1
 })
});

2 - ol3.11ex 137a - OpenStreetMap reprojection example 1

「OpenStreetMap reprojection example (reprojection-wgs84.html)」を参考に地図を表示してみます。
説明に次のようにあります。

This example shows client-side reprojection of OpenStreetMap in WGS84.
この例では、WGS84 の OpenStreetMap のクライアント側の再投影を示しています。
HTML ファイルの作成
a Eclipse のメニューの「ファイル」->「ファイルを開く」をクリックします。





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





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



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








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











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

「2137-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">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-combined.min.css" type="text/css">
  <!--
  <link rel="stylesheet" href="../css/ol.css" type="text/css">
  <link rel="stylesheet" href="./resources/layout.css" type="text/css">

  <link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
  <script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
  「resources」の位置が変わりました。
  -->
  <!-- ディレクトリ修正 -->
  <link rel="stylesheet" href="v3.11.2/css/ol.css" type="text/css">
  <link rel="stylesheet" href="v3.11.2/examples/resources/layout.css" type="text/css">

  <link rel="stylesheet" href="v3.11.2/examples/resources/prism/prism.css" type="text/css">
  <script src="v3.11.2/examples/resources/zeroclipboard/ZeroClipboard.min.js"></script>
  <title>OpenStreetMap reprojection example</title>
 </head>
 <body>
  <!-- 
  bootstrap-combined.min.css, ol.css, layout.css,
  CSSファイルで設定されたセレクタを使用。
  -->
  <header class="navbar" role="navigation">
   <div class="container" id="navbar-inner-container">
    <!--
    <a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
    -->
    <!-- ディレクトリ修正 -->
    <a class="navbar-brand" href="v3.11.2/examples/"><img src="v3.11.2/examples/resources/logo-70x70.png"> OpenLayers 3 Examples</a>
   </div>
  </header>
  <div class="container-fluid">
   <div class="row-fluid">
    <div class="span12">
     <div id="map" class="map"></div>
    </div>
   </div>
   <div class="row-fluid">
    <div class="span12">
     <h4 id="title">OpenStreetMap reprojection example</h4>
     <p id="shortdesc">Demonstrates client-side reprojection 
       of OpenStreetMap in WGS84.</p>
     <div id="docs"><p>This example shows client-side 
      reprojection of OpenStreetMap in WGS84. </p>
     </div>
     <div id="tags">reprojection, projection, openstreetmap, 
      wgs84, tile</div>
     <div id="api-links">Related API documentation: 
      <ul class="inline">
       <li>
       <!-- <a href="../apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a> -->
        <a href="v3.11.2/apidoc/ol.Map.html" title="API documentation for ol.Map">ol.Map</a>
       </li>,
       <li>
       <!-- <a href="../apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a> -->
        <a href="v3.11.2/apidoc/ol.View.html" title="API documentation for ol.View">ol.View</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a> -->
        <a href="v3.11.2/apidoc/ol.layer.Tile.html" title="API documentation for ol.layer.Tile">ol.layer.Tile</a>
       </li>,
       <li>
        <!-- <a href="../apidoc/ol.source.OSM.html" title="API documentation for ol.source.OSM">ol.source.OSM</a> -->
        <a href="v3.11.2/apidoc/ol.source.OSM.html" title="API documentation for ol.source.OSM">ol.source.OSM</a>
       </li>
      </ui>
     </div>
   </div>
  </div>
  <div class="row-fluid">
    <div id="source-controls">
     <a id="copy-button">
      <i class="fa fa-clipboard"></i> Copy
     </a>
     <a id="jsfiddle-button">
      <i class="fa fa-jsfiddle"></i> Edit
     </a>
    </div>
    <form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
    <textarea class="hidden" name="js">
// --- 省略 ---
&lt;/html&gt;</code></pre>
   </div>
  </div>
  <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <!--
  <script src="./resources/common.js"></script>
  <script src="./resources/prism/prism.min.js"></script>
  -->
  <!-- ディレクトリ修正
   CommonJS と
   prism.js
 -->
  <script src="v3.11.2/examples/resources/common.js"></script>
  <script src="v3.11.2/examples/resources/prism/prism.min.js"></script>
  <!-- 
  <script src="loader.js?id=reprojection-wgs84"></script>
  -->
  <!-- ファイル修正 -->  <!-- ディレクトリ修正 -->
  <script src="loader.js?id=2137-ol3ex"></script>
  </body>
</html>


COMMONJS は

COMMONJS
http://webpack.github.io/docs/commonjs.html

に、次のようにあります。

The CommonJS group defined a module format to solve JavaScript scope issues by making sure each module is executed in its own namespace.
This is achieved by forcing modules to explicitly export those variables it wants to expose to the “universe”, and also by defining those other modules required to properly work.
To achieve this CommonJS give you two tools:
the require() function, which allows to import a given module into the current scope.
the module object, which allows to export something from the current scope.

CommonJSグループは、それ自身の名前空間内で実行されている各モジュールを確認することによって、JavaScriptのスコープ問題を解決するためのモジュールフォーマットを定義しました。
これは、それが「universe(?)」に公開したい変数を明示的にエクスポートするモジュールを強制することによって、同じように、正常に動作するのに必要な他のモジュールを定義することによって、達成されます。
この CommonJS を達成するために2つのツールを与えます:
require()関数、指定したモジュールを現在のスコープにインポートすることができます。
モジュールオブジェクト、現在のスコープからエクスポートすることができます。


Prism は、

Prism
http://prismjs.com/

に、次のようにあります。

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.
Prismは、最新のWeb標準に構築されたことを考慮し軽量で拡張可能なシンタックスハイライトです。それは Dabblet からスピンオフで、何千人も日々そこで試験されています。


ZeroClipboard は

ZeroClipboard v2.x
http://zeroclipboard.org/

に、次のようにあります。

The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
ZeroClipboard ライブラリは、見えない Adobe Flash ムービーとJavaScript のインターフェイスを使用してテキストをクリップボードにコピーする簡単な方法を提供します。

Debian 8 では動作しませんでした。ボタンを右クリックしたときに flash のコンテキストメニューが表示されると動作しています。

2 - ol3.11ex 136b - Advanced Mapbox vector tiles example 2

「mapbox-vector-tiles-advanced.js(2136-ol3ex.js)」は、マップを表示するための JavaScript ファイルです。

「2136-ol3ex.js」
var key = 'pk.eyJ...(省略)';
// For how many zoom levels do we want to use the same 
// vector tiles?  1 means "use tiles from all zoom levels". 
// 2 means "use the same tiles for 2 subsequent zoom 
// levels".
// どのくらいのズームレベル数で同じベクトルのタイルを使用したい
// ですか? 1 は「すべてのズームレベルからタイル使用する」こと
// を意味します。 2 は「2 以降のズームレベルに同じタイルを使用
// する」を意味します。
var reuseZoomLevels = 2;
// Offset of loaded tiles from web mercator zoom level 0.
// 0 means "At map zoom level 0, use tiles from zoom 
// level 0". 1 means "At map zoom level 0, use tiles 
// from zoom level 1".
// ウェブメルカトルズームレベル 0 からロードされたタイルのオフ
// セット。0 は「マップのズームレベル 0 では、ズームレベル 0 か
// らのタイルを使用する」ことを意味します。1 は「マップのズーム
// レベル 0 では、ズームレベル1  からタイルを使用する」ことを意
// 味します。
var zoomOffset = 1;
// Calculation of tile urls
var resolutions = [];
for (var z = zoomOffset / reuseZoomLevels; z <= 22 / reuseZoomLevels; ++z) {
 resolutions.push(156543.03392804097 / Math.pow(2, z * reuseZoomLevels));
 /** Array.push
  * 与えられた要素を追加することによって配列を変異させ、
  * その配列の新しい長さを返します。
  * (MDN [https://developer.mozilla.org/ja/docs/Web/
  * JavaScript/Reference/Global_Objects/Array/push])
  */
 /** Math.pow(base, exponent)
  * base を exponent 乗した値、つまり、base^exponent の値を返
  * します。
  * (MDN[https://developer.mozilla.org/ja/docs/Web/
  * JavaScript/Reference/Global_Objects/Math/pow])
  */
}
function tileUrlFunction(tileCoord) {
 return ('http://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
  '{z}/{x}/{y}.vector.pbf?access_token=' + key)
   .replace('{z}', String(tileCoord[0] * reuseZoomLevels + zoomOffset))
   /** replace [メソッド]
    * 指定された URL に現在の文書を置き換えます。 assign() メ
    * ソッドとの違いは、replace() を用いた後、現在のページは、
    * セッションの履歴には保持されないことです。つまり、ユーザ
    * は、置き換え前のページに戻るために、戻るボタンを使うこと
    * ができません。
    * (MDN[https://developer.mozilla.org/ja/docs/Web/API/
    * Window/location])
    */
   .replace('{x}', String(tileCoord[1]))
   .replace('{y}', String(-tileCoord[2] - 1))
   .replace('{a-d}', 'abcd'.substr(
    ((tileCoord[1] << tileCoord[0]) + tileCoord[2]) % 4, 1));
}
var map = new ol.Map({
 layers: [
  new ol.layer.VectorTile({
  /** ol.layer.VectorTile
   * Layer for vector tile data that is rendered client-side.
   * クライアント側でレンダリングされるベクタタイルデータのレイ
   * ヤ。
   * (ol3 API[説明は Stable Only のチェックを外すと表示])
   */
   preload: Infinity,
   /** preload (Observable Properties)
    * The level to preload tiles up to.
    * タイルをプリロードするための最大レベル。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
    */
   source: new ol.source.VectorTile({
   /** ol.source.VectorTile
    * Class for layer sources providing vector data 
    * divided into a tile grid, to be used with 
    * ol.layer.VectorTile. Although this source receives 
    * tiles with vector features from the server, it is 
    * not meant for feature editing. Features are optimized 
    * for rendering, their geometries are clipped at or 
    * near tile boundaries and simplified for a view 
    * resolution. See ol.source.Vector for vector sources 
    * that are suitable for feature editing. 
    * ol.layer.VectorTile を使用するために、タイルのグリッドに
    * 分割されたベクタデータを提供するレイヤソースのクラス。この
    * ソースは、サーバからのベクタフィーチャと共にタイルを受信し
    * ますが、それはフィーチャ編集のためのものではありません。
    * フィーチャは、レンダリングのために最適化され、そのジオメト
    * リはタイルに、または、その境界付近にクリップされ、ビューの
    * 解像度のために簡略化されます。フィーチャの編集に適したベク
    * タソースための ol.source.Vector を参照してください。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
    */
    attributions: [new ol.Attribution({
    /** ol.Attribution
     * An attribution for a layer source.
     * レイヤソースの属性(ol3 API)
     */
     html: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
      '© <a href="http://www.openstreetmap.org/copyright">' +
      'OpenStreetMap contributors</a>'
    })],
    format: new ol.format.MVT(),
    /** ol.format.MVT
     * Feature format for reading data in the Mapbox MVT 
     * format.
     * Mapbox MVT フォーマットでデータを描画するためのフィーチャ
     * フォーマット。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
     */
    tileGrid: new ol.tilegrid.TileGrid({
    /** ol.tilegrid.TileGrid
     * Base class for setting the grid pattern for 
     * sources accessing tiled-image servers.
     * タイル画像サーバにアクセスするソースのグリッドパターンを
     * 設定するための基本クラス。(ol3 API)
     */
     extent: ol.proj.get('EPSG:3857').getExtent(),
     /** extent
      * Extent for the tile grid. No tiles outside this 
      * extent will be requested by ol.source.Tile sources. 
      * When no origin or origins are configured, the 
      * origin will be set to the top-left corner of the 
      * extent.
      * タイルグリッドの範囲。この範囲外ではタイルは 
      * ol.source.Tile ソースによって要求されません。何の原点
      * または原点が構成されていない場合には、原点は範囲の左上
      * 隅に設定されます。
     * (ol3 API[説明は Stable Only のチェックを外すと表示])
      */
     resolutions: resolutions
    }),
    tilePixelRatio: 16,
    /** tilePixelRatio
     * The pixel ratio used by the tile service. For 
     * example, if the tile service advertizes 256px by 
     * 256px tiles but actually sends 512px by 512px 
     * tiles (for retina/hidpi devices) then 
     * tilePixelRatio should be set to 2. Default is 1.
     * タイルサービスによって使用されるピクセル比。たとえば、タ
     * イルサービスが 256px x 256px タイルを通知する場合、実際
     * には 512px x 512px  タイル(retina / hidpiデバイス用)
     * を送信し、それから、タイル Pixel Ratio は 2 に設定しな
     * ければなりません。デフォルトは 1 です。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
     */
    tileUrlFunction: tileUrlFunction
    /** tileUrlFunction
     * Optional function to get tile URL given a tile 
     * coordinate and the projection.
     * タイル座標と投影法を指定されたタイル URL を取得するための
     * オプション関数。
     * (ol3 API[説明は Stable Only のチェックを外すと表示])
     */
   }),
   style: createMapboxStreetsV6Style()
   /** style
    * Layer style. See ol.style for default style which 
    * will be used if this is not defined.
    * レイヤスタイル。これが定義されていない場合に使用されるデ
    * フォルトのスタイルのための ol.style を参照してください。
    * (ol3 API[説明は Stable Only のチェックを外すと表示])
    */
  })
 ],
 target: 'map',
 view: new ol.View({
  center: [0, 0],
  minZoom: 1,
  zoom: 2
 })
});
// ol.style.Fill, ol.style.Icon, ol.style.Stroke, 
// ol.style.Style and ol.style.Text are required for 
// createMapboxStreetsV6Style()