2016年2月29日月曜日

v3.14.0 がリリースされました

日本時間で(2016.2.24)に v3.14.0 がリリースされました。

Releases - openlayers/ol3 GitHub
(https://github.com/openlayers/ol3/releases)より

v3.14.0
Summary

The v3.14.0 release includes features and fixes from 93 pull requests since the v3.13.1 release. New features and improvements include:

v3.14.0 リリースは v3.13.1 のリリースから 71 プルリクエスト(訳注:Git でリクエストを出す機能)からの機能と修正が含まれています。新機能と改良点は次のとおりです。


● New source option for the ol.control.FullScreen, to allow including other elements besides the map in a full screen view (#4679).
● New target property for the Drag&Drop interaction allows using a different drop target than the map viewport (#4876).
● ol.style.RegularShape has a new rotateWithView option, for controlling how regular shape symbols are rendered on rotated views (#4698).
● New layers option for ol.format.WMSGetFeatureInfo format, to selectively only read features from specific layers (#4700).
● New precision parameter for formatting coordinates with ol.coordinate.toStringHDMS (#4787).
● Smarter tile queue for improved tile loading user experience when more than one tile layer is used (#4794).
● Improved rendering performance for tile layers by rendering tiles directly to the map canvas (#4597).
● The goog.events event system was replaced with our own lightweight event system. This significally reduces the build size (#4711). Replacement of other goog.* components with ES5 features or custom code marks a huge step towards the complete removal of the Closure Library dependency.

● フルスクリーン表示でマップに加えて他の要素を含むことを可能にする ol.control.FullScreen の新しいソースオプション(#4679)。
● ドラッグ&ドロップインタラクションのための新しいターゲットプロパティは、マップビューポートとは異なるドロップターゲットを使用できます(#4876)。
● ol.style.RegularShapeは、標準的な形状のシンボルが回転したビュー上にレンダリングされる方法を制御するために、新しい rotateWithView オプションを持ちます(#4698)。
● 選択的に特定のレイヤからフィーチャを読み取るだけのための ol.format.WMSGetFeatureInfo フォーマットのための新しいレイヤのオプション(#4700)。
● 書式設定のための新しい高精度のパラメータは、ol.coordinate.toStringHDMS で調整します(#4787)。
● ーつ以上のタイルレイヤが使用されている場合、ユーザーエクスペリエンスをローディングする改良されたタイルのためのよりスマートなタイルキュ(#4794)。
● マップのキャンバスに直接タイルをレンダリングすることにより、タイルレイヤのための改善されたレンダリング性能(#4597)。
● goog.events イベントシステムは、独自の軽量イベントシステムと交換しました。これは、ビルドサイズを減らせます(#4711)。 ES5の機能による他の goog.* コンポーネントの交換、または、カスタムコードは、クロージャライブラリの依存関係の完全な除去に向けた大きな一歩をマークします。


Upgrade notes

Internet Explorer 9 support

As of this release, OpenLayers requires a requestAnimationFrame/cancelAnimationFrame polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.

このリリースでは、OpenLayersをはIE9のサポートのためのrequestAnimationFrameの/ cancelAnimationFrameのポリフィルを必要とします。 http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrameを参照してください。

Layer pre-/postcompose event changes

It is the responsibility of the application to undo any canvas transform changes at the end of a layer 'precompose' or 'postcompose' handler. Previously, it was ok to set a null transform. The API now guarantees a device pixel coordinate system on the canvas with its origin in the top left corner of the map. However, applications should not rely on the underlying canvas being the same size as the visible viewport.

レイヤ 'precompose' または 'postcompose' ハンドラの終了時にすべてのcanvas transform changes を元に戻すことは、アプリケーションの責任です。以前は、null transform を設定しても大丈夫でした。 APIは、現在、地図の左上隅にその原点を持つ、キャンバス上のデバイスピクセル座標系を保証します。ただし、アプリケーションは、可視ビューポートと同じサイズとなる基礎となるキャンバスに頼るべきではありません。

Old code:
layer.on('precompose', function(e) {
  // rely on canvas dimensions to move coordinate origin to center
  e.context.translate(e.context.canvas.width / 2, e.context.canvas.height / 2);
  e.context.scale(3, 3);
  // draw an x in the center of the viewport
  e.context.moveTo(-20, -20);
  e.context.lineTo(20, 20);
  e.context.moveTo(-20, 20);
  e.context.lineTo(20, -20);
  // rely on the canvas having a null transform
  e.context.setTransform(1, 0, 0, 1, 0, 0);
});

New code:
layer.on('precompose', function(e) {
  // use map size and pixel ratio to move coordinate origin to center
  var size = map.getSize();
  var pixelRatio = e.frameState.pixelRatio;
  e.context.translate(size[0] / 2 * pixelRatio, size[1] / 2 * pixelRatio);
  e.context.scale(3, 3);
  // draw an x in the center of the viewport
  e.context.moveTo(-20, -20);
  e.context.lineTo(20, 20);
  e.context.moveTo(-20, 20);
  e.context.lineTo(20, -20);
  // undo all transforms
  e.context.scale(1 / 3, 1 / 3);
  e.context.translate(-size[0] / 2 * pixelRatio, -size[1] / 2 * pixelRatio);
});


(Full list of changes と fixes リストはサイトをみてください。)


v3.14.0 の examples を試してみます
OpenLayers 3 のホームページ(http://openlayers.org/)の「LATEST」の文中の「v3.14.0」をクリックします。
開いたページ「Downloads for the v3.14.0 release(http://openlayers.org/download/)」の「v3.14.0.zip」ボタンをクリックしてダウンロードします。
展開したフォルダを Eclipse の ol3proj にコピーします。

ディレクトリは次のようにしました。
ol3proj
|-v3.0.0/
|-v3.1.1/
|-v3.2.0/
|-v3.2.1/
|-v3.3.0/
|-v3.4.0/
|-v3.5.0/
|-v3.6.0/
|-v3.7.0/
|-v3.8.2/
|-v3.9.0/
|-v3.10.1/
|-v3.11.2/
|-v3.12.1/
|-v3.13.1/
|-v3.14.0/
|-2xx-ol3ex.html
|-2xx-ol3ex.js
|-2xx-ol3ex-require.js
|-loader.js
|-loader-v3.0.0.js
|-loader-v3.1.1.js
|-loader-v3.2.0.js
|-loader-v3.2.1.js
|-loader-v3.3.0.js
|-loader-v3.4.0.js
|-loader-v3.5.0.js
|-loader-v3.6.0.js
|-loader-v3.7.0.js
|-loader-v3.8.2.js
|-loader-v3.9.0.js
|-loader-v3.10.1.js
|-loader-v3.11.2.js
|-loader-v3.12.1.js

v.3.13.1 の loader.js の名前を loader-v3.13.1.js に変更し、v3.14.0/examples/loader.js を ol3proj 直下にコピーします。
ol3proj
|-v3.0.0/
|-v3.1.1/
|-v3.2.0/
|-v3.2.1/
|-v3.3.0/
|-v3.4.0/
|-v3.5.0/
|-v3.6.0/
|-v3.7.0/
|-v3.8.2/
|-v3.9.0/
|-v3.10.1/
|-v3.11.2/
|-v3.12.1/
|-v3.13.1/
|-v3.14.0/
|-2xx-ol3ex.html
|-2xx-ol3ex.js
|-2xx-ol3ex-require.js
|-loader.js
|-loader-v3.0.0.js
|-loader-v3.1.1.js
|-loader-v3.2.0.js
|-loader-v3.2.1.js
|-loader-v3.3.0.js
|-loader-v3.4.0.js
|-loader-v3.5.0.js
|-loader-v3.6.0.js
|-loader-v3.7.0.js
|-loader-v3.8.2.js
|-loader-v3.9.0.js
|-loader-v3.10.1.js
|-loader-v3.11.2.js
|-loader-v3.12.1.js
|-loader-v3.13.1.js

loader.js の内容を次のように修正します。

---
  if (!raw) {
    // document.write('<scr' + 'ipt type="text/javascript" src="../build/ol.js"></scr' + 'ipt>');
     // ディレクトリ修正
    document.write('<scr' + 'ipt type="text/javascript" src="v3.14.0/build/ol.js"></scr' + 'ipt>');

  } else {
    window.CLOSURE_NO_DEPS = true; // we've got our own deps file
    // document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
    // document.write('<scr' + 'ipt type="text/javascript" src="../build/ol-deps.js"></scr' + 'ipt>');
     // ディレクトリ修正
    document.write('<scr' + 'ipt type="text/javascript" src="v3.14.0/closure-library/closure/goog/base.js"></scr' + 'ipt>');
    document.write('<scr' + 'ipt type="text/javascript" src="v3.14.0/build/ol-deps.js"></scr' + 'ipt>');

    document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '-require.js"></scr' + 'ipt>');
  }
  document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '.js"></scr' + 'ipt>');
}());

0 件のコメント: