「292-ol3ex.js」
var domMap = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
/** ol.source.MapQuest
* Layer source for the MapQuest tile server.
* MapQuest タイルサーバのレイヤソース。(ol3 API
* 2 - ol3ex 23b - MapQuest example 2 参照)
*/
})
],
renderer: 'dom',
target: 'domMap',
view: new ol.View({
center: [0, 0],
zoom: 1
})
});
if (ol.has.WEBGL) {
/** ol.has.WEBGL{boolean}
* True if browser supports WebGL.
* ブラウザが WebGL をサポートしていたら true。(ol3 API)
*/
var webglMap = new ol.Map({
renderer: 'webgl',
target: 'webglMap'
});
webglMap.bindTo('layergroup', domMap);
/** bindTo()
* The bindTo method allows you to set up a two-way
* binding between a `source` and `target` object.
* The method returns an object with a `transform`
* method that you can use to provide `from` and
* `to` functions to transform values on the way
* from the source to the target and on the way back.
* bindTo メソッドは、`source` と ` target` オブジェク
* ト間の結合を双方向に設定することができます。メソッドは、
* ソースからターゲットに、および、その逆方向に値を変換
* する、 `from` と ` to` ファンクションを提供するため
* に使用することがでる `transform` メソッドをともなっ
* た、オブジェクトを返します。
* (ol3 API[説明は Stable Only のチェックを外すと表示])
*/
webglMap.bindTo('view', domMap);
} else {
var info = document.getElementById('no-webgl');
/**
* display error message
*/
info.style.display = '';
}
var canvasMap = new ol.Map({
target: 'canvasMap'
});
canvasMap.bindTo('layergroup', domMap);
canvasMap.bindTo('view', domMap);


0 件のコメント:
コメントを投稿