2018年7月30日月曜日

v5.0.0 がリリースされました

v5.0.3 がリリースされました
日本時間で(2018.7.11)に v5.0.23がリリースされました。

Releases 5.0.3 - openlayers/openlayers GitHub
(https://github.com/openlayers/openlayers/releases/tag/v5.0.3)より

The v5.0.3 fixes a regression in the vector tile renderer and improves the built examples and release package.

V5.0.2 は、ベクタタイルレンダラで回帰を修正し、構築された example と リリースパッケージ を向上します。


v5.0.2 がリリースされました
日本時間で(2018.7.7)に v5.0.2 がリリースされました。

Releases 5.0.2 - openlayers/openlayers GitHub
(https://github.com/openlayers/openlayers/releases/tag/v5.0.2)より
The v5.0.2 release updates the package readme with new example projects.

V5.0.2 リリースは、新しい example プロジェクトと共に package readme を更新します。


v5.0.1 がリリースされました
日本時間で(2018.7.9)に v5.0.1 がリリースされました。

Releases 5.0.1 - openlayers/openlayers GitHub
(https://github.com/openlayers/openlayers/releases/tag/v5.0.1)より

5.0.1

The v5.0.1 release helps reduce bundle sizes for bundlers that support the "sideEffects": "false"option in package.json, and fixes website documentation regarding cdn locations and debug build which has been replaced by source maps.

V5.0.1 リリースは、package.json  で "sideEffects": "false" オプションをサポートするパンドラのためのパンドルサイズを減らす支援をし、cdnの場所とソースマップによって置換えられたデバッグビルドに関するウェブサイトドキュメントを修正します。


v5.0.0 がリリースされました
日本時間で(2018.6.27)に v5.0.0 がリリースされました。

Releases 5.0.0 - openlayers/openlayers GitHub
(https://github.com/openlayers/openlayers/releases/tag/v5.0.0)より

5.0.0

The main theme of the v5.0.0 release is an improved developer/user experience with OpenLayers. Toward this end, we have reworked the library as a set of ES Modules, completely removing any dependency on the Closure Compiler, and improving compatibility with mainstream module bundlers.

v5.0.0 リリースのメインテーマは、OpenLayers を使用した向上したデベロッパ(開発者)/ユーザ(使用者)エクスペリエンスです。 この目的のために、ES Modules のセットとしてライブラリを再構築(編集しなお)し、 Closure Compiler の依存から完全に移行し、メインストリーム(主流)モジュールパンドラで互換性を向上します。

See the hosted examples, API docs, and bundle tutorial for the new syntax, but basic usage looks like this:

新しい構文は、提供された example、API ドキュメント、バンドルチュートリアルを参照して下さい、ですが基本的な使い方はこのようになります:
import 'ol/ol.css';
import {Map, View} from 'ol';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
const map = new Map({
 target: 'map',
 layers: [
  new TileLayer({
   source: new OSM()
  })
 ],
 view: new View({
  center: [0, 0],
  zoom: 0
 })
});
See below for specific notes on upgrading from 4.x releases. We'll be working on updating the website with improved documentation and examples. Take a look at the issue tracker if you're interested in contributing.

4.x リリースからのアップグレードについて特定の注意は下記を参照して下さい。ドキュメントや例の向上と共にウェブサイトの更新作業を続けています。貢献に興味があるならissue tracker を見てください。


Upgrade Notes

Renamed ol/source/TileUTFGrid to ol/source/UTFGrid
ol/source/TileUTFGrid を ol/source/UTFGrid に改名

The module name is now ol/source/UTFGrid (ol.source.UTFGrid in the full build).

モジュール名は、現在、ol/source/UTFGrid (フルビルドで ol.source.UTFGrid)です。


Renaming of the defaultDataProjection in the options and property of the ol/format/Feature class and its subclasses
ol/format/Feature クラスとそのサブクラスのオプションとプロパティで defaultDataProjection の改名

The defaultDataProjection option is now named dataProjection. The protected property available on the class is also renamed.

 defaultDataProjection オプションは、現在、dataProjection です。クラスで利用できる保護されたプロパティも改名されます。


transition option of ol/source/VectorTile is ignored
ol/source/VectorTile の transition オプションは無視されます

The transition option to get an opacity transition to fade in tiles has been disabled for ol/source/VectorTile. Vector tiles are now always rendered without an opacity transition.

タイルでのフェードのための opacity transition(不透明度遷移)を取得するための transition オプションは、 ol/source/VectorTile で使えません。ベクタタイルは、現在、通常 opacity transition なしで描画されます。

ol/style/Fill with CanvasGradient or CanvasPattern

The origin for gradients and patterns has changed from the top-left corner of the extent of the geometry being filled to 512 css pixel increments from map coordinate [0, 0]. This allows repeat patterns to be aligned properly with vector tiles. For seamless repeat patterns, width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).

グラデーションとパターンの原点は、マップ座標[0, 0]から512cssピクセルの増分で塗りつぶされる地理的範囲の左上隅から変更されます。これは、ベクタタイルで正確に揃えられたパターンを繰り返すことができます。シームレスに繰り返すパターンのために、パターンイメージの幅と高さは2のべき乗でなければなりません。


Removal of the renderer option for maps
map の renderer オプションの削除

The renderer option has been removed from the Map constructor. The purpose of this change is to avoid bundling code in your application that you do not need. Previously, code for both the Canvas and WebGL renderers was included in all applications - even though most people only use one renderer. The Map constructor now gives you a Canvas (2D) based renderer. If you want to try the WebGL renderer, you can import the constructor from ol/WebGLMap.

renderer オプションは、Map コンストラクタから削除されています。この変更の目的は、必要のないアプリケーションでビルドコードを回避することです。あきらかに、Canvas と WebGL oレンダラ両方のコードは、ほとんどの人が1つのレンダラを使用するだけでさえ、すべてのアプリケーションに含まれていました。Map コンストラクタは、現在、Canvas(2D)基本レンダラを与えます。もし WebGL レンダラを試したいなら、ol/WebGLMap からコンストラクタをインポートします。

Old code:
import Map from 'ol/Map';

const canvasMap = new Map({
  renderer: ['canvas']
  // other options...
});

const webglMap = new Map({
  renderer: ['webgl']
  // other options...
});
New code:
import Map from 'ol/Map';
import WebGLMap from 'ol/WebGLMap';

const canvasMap = new Map({
  // options...
});

const webglMap = new WebGLMap({
  // options...
});


Removal of ol.FeatureStyleFunction
ol.FeatureStyleFunction の削除

The signature of the vector style function passed to the feature has changed. The function now always takes the feature and the resolution as arguments, the feature is no longer bound to this.

feature に渡された vector style ファンクションのサインが変更されています。ファンクションは、現在、引数として feature と resolution(解像度)を常に必要とし、feature はこれをもはや結び付けません。

Old code:
feature.setStyle(function(resolution) {
  var text = this.get('name');
  ...
});
New code:
feature.setStyle(function(feature, resolution) {
  var text = feature.get('name');
  ...
});

Changed behavior of the Draw interaction
Draw インタラクションの変更された動作

For better drawing experience, two changes were made to the behavior of the Draw interaction:
より良い描画体験のために、Draw インタラクションの動作が2つ変更されました:

1. On long press, the current vertex can be dragged to its desired position.
2. On touch move (e.g. when panning the map on a mobile device), no draw cursor is shown, and the geometry being drawn is not updated. But because of 1., the draw cursor will appear on long press. Mouse moves are not affected by this change.

1. 長押しで、現在の頂点を望む位置にドラッグできます。
2. ムーブタッチ(モバイルデバイスでマップをパンするときなど)で、draw(描画)カーソルは表示されず、描画されるジオメトリは更新されません。しかし 1. のため、draw カーソルは長押しで現れます。マウスムーブはこの変更によって影響されません。


Changes in proj4 integration
proj4 integration での変更

Because relying on a globally available proj4 is not practical with ES modules, we have made a change to the way we integrate proj4:

ES modules と一緒では世界的に利用できる proj4 を信頼することは実用的でないので、 proj4 を統合する方法を変更します。

● The setProj4() function from the ol/proj module was removed.
● A new ol/proj/proj4 module with a register() function was added. Regardless of whether the application imports proj4 or uses a global proj4, this function needs to be called with the proj4 instance as argument whenever projection definitions were added to proj4's registry with (proj4.defs).

● ol/proj モジュールから setProj4() を削除されました。
● register() と共に新しい ol/proj/proj4 が追加されました。アプリケーションが proj4 をインポートするか global proj4 を使用するかに関係なく、このファンクションは、projection(解像度)定義が proj4 レジストリに(proj4.defs)で追加されたときはいつでも、引数として proj4 インスタンスと共に呼び出されます。

It is also recommended to no longer use a global proj4. Instead,
global proj4 はもはや推奨されません。かわりに、

npm install proj4

and import it:
そしてそれをインポートします:

import proj4 from 'proj4';

Applications can be updated by importing the register function from the ol/proj/proj4 module
アプリケーションは ol/proj/proj4 モジュールから register ファンクションをインポートすることによって更新されます

import {register} from 'ol/proj/proj4'

and calling it before using projections, and any time the proj4 registry was changed by proj4.defs() calls:
projection を使用する前にそれを呼び出し、いつでも proj4.defs()  によって変更された proj4 レジストリが呼び出します:

register(proj4);


Removal of logos
ロゴの削除

The map and sources no longer accept a logo option. Instead, if you wish to append a logo to your map, add the desired markup directly in your HTML. In addition, you can use the attributions property of a source to display arbitrary markup per-source with the attribution control.

マップとソースはもはや logo オプションを受けつけません。かわりに、マップにロゴを付加したいなら、直接 HTML に望むマークアップを追加します。加えて、attribution コントロールを使ってソースごとに任意のマークアップを表示するためにソースの attribution プロパティを使います。


Replacement of ol/Sphere constructor with ol/sphere functions
ol/sphere ファンクションを使用して ol/Sphere コンストラクタを置換

The ol/Sphere constructor has been removed. If you were using the getGeodesicArea method, use the getArea function instead. If you were using the haversineDistance method, use the getDistance function instead.

ol/Sphere は削除されました。もし getGeodesicArea メソッドを使っているなら、代わりに、getArea ファンクションを使います。もし haversineDistance メソッドを使っているなら、代わりに getDistance ファンクションを使います。

Examples before:
// using ol@4
import Sphere from 'ol/sphere';

var sphere = new Sphere(Sphere.DEFAULT_RADIUS);
var area = sphere.getGeodesicArea(polygon);
var distance = sphere.haversineDistance(g1, g2);
Examples after:
// using ol@5
import {circular as circularPolygon} from 'ol/geom/Polygon';
import {getArea, getDistance} from 'ol/sphere';

var area = getArea(polygon);
var distance = getDistance(g1, g2);
var circle = circularPolygon(center, radius);


New signature for the circular function for creating polygons
ポリゴンを作成する circular ファンクションの新しいサイン

The circular function exported from ol/geom/Polygon no longer requires a Sphere as the first argument.
ol/geom/Polygon からエクスポートされた circular は、最初の引数として Sphere をもはや必要としません。

Example before:
// using ol@4
import Polygon from 'ol/geom/polygon';
import Sphere from 'ol/sphere';

var poly = Polygon.circular(new Sphere(Sphere.DEFAULT_RADIUS), center, radius);
Example after:
// using ol@5
import {circular as circularPolygon} from 'ol/geom/Polygon';

var poly = circularPolygon(center, radius);

Removal of optional this arguments.
オプショナル this 引数の削除

The optional this (i.e. opt_this) arguments were removed from the following methods. Please use closures, the es6 arrow function or the bind method to achieve this effect (Bind is explained here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).

オプショナル this(例えば opt_this)引数は、次のメソッドから削除されました。この効果を達成するために closures、es6 arrow ファンクション、または、bind メソッドを使って下さい。

● Collection#forEach
● geom/LineString#forEachSegment
● Observable#on, #once, #un
● Map#forEachLayerAtPixel
● source/TileUTFGrid#forDataAtCoordinateAndResolution
● source/Vector#forEachFeature, #forEachFeatureInExtent, #forEachFeatureIntersectingExtent


Map#forEachLayerAtPixel parameters have changed
Map#forEachLayerAtPixel を変更

If you are using the layer filter, please note that you now have to pass in the layer filter via an AtPixelOptions object. If you are not using the layer filter the usage has not changed.

もし layer filter を使っているなら、layer filter に AtPixelOptions オブジェクト経由で渡さなければならないことに注意してください。 layer filter を使っていないなら、使用方法は変更ありません。

Old syntax:
map.forEachLayerAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis);
New syntax:
map.forEachLayerAtPixel(pixel, callback, {
 layerFilter: layerFilterFn
});
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).

ファンクションをこれにバインドするために、ファンクションの bind メソッドを使ってください。

This change is due to the introduction of the hitTolerance parameter which can be passed in via this AtPixelOptions object, too.

この変更は、この AtPixelOptions オブジェクト経由で渡される hitTolerance パラメータの introduction にも起因します。

(New Features and Fixes は、を参照して下さい。)