「217-ol3ex.js」
var raster = 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({
/** ol.source.MapQuest
* Layer source for the MapQuest tile server.
* MapQuest タイルサーバのレイヤソース。(ol3 API
* 2 - ol3ex 23b - MapQuest example 2 参照)
*/
layer: 'sat'
})
});
var vector = new ol.layer.Vector({
/** ol.layer.Vector
* Vector data that is rendered client-side. Note that any
* property set in the options is set as a ol.Object property
* on the layer object; for example, setting title: 'My
* Title' in the options means that title is observable, and
* has get/set accessors.
* クライアント側で描画されたベクタデータ。オプションで設定した任
* 意のプロパティは、レイヤオブジェクトで ol.Object プロパティ
* として設定されていることに注意してください。たとえば、オプショ
* ンで、title:'My Title' を設定することは、タイトルは
* observable で、アクセサを取得/設定することを意味します。
* (ol3 API)
*/
source: new ol.source.GeoJSON({
/** ol.source.GeoJSON
* Static vector source in GeoJSON format
* GeoJSON フォーマットの静的ベクタソース。(ol3 API)
*/
projection: 'EPSG:3857',
//url: 'data/geojson/countries.geojson'
url: 'v3.0.0/examples/data/geojson/countries.geojson'
})
});
var select = new ol.interaction.Select();
/** ol.interaction.Select
* Handles selection of vector data. A
* ol.FeatureOverlay is maintained internally to
* store the selected feature(s). Which features
* are selected is determined by the condition
* option, and optionally the toggle or add/remove
* options.
* ベクタデータの選択を処理します。 ol.FeatureOverlay
* は、選択したフィーチャを格納するために内部的に維持され
* ています。選択されているどのフィーチャでも条件オプショ
* ン、そして部分的にトグルまたは追加/削除オプションによっ
* て決定されます。(ol3 API)
*/
var modify = new ol.interaction.Modify({
/** ol.interaction.Modify
* Interaction for modifying vector data.
* ベクタデータを変形するためのインタラクション。
* (ol3 API)
*/
features: select.getFeatures()
/** getFeatures()
* Get the selected features.
* 選択されたフィーチャを取得します。
* Return: Features collection(ol3 API)
*/
});
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([select, modify]),
/** ol.interaction.defaults
* Set of interactions included in maps by default.
* Specific interactions can be excluded by setting
* the appropriate option to false in the constructor
* options, but the order of the interactions is fixed.
* If you want to specify a different order for
* interactions, you will need to create your own
* ol.interaction.Interaction instances and insert
* them into a ol.Collection in the order you want
* before creating your ol.Map instance.
* デフォルトでマップに含まれるインターラクションのセット。
* 具体的なインターラクションは、コンストラクタのオプションで
* 適切なオプションをfalseに設定することで除外することができます
* が、インターラクションの順番は固定されています。インターラク
* ションに対して別の順番を指定したい場合は、独自の
* ol.interaction.Interaction インスタンスを作成し、ol.Map
* インスタンスを作成する前に望む順番で ol.Collection にそれら
* を挿入する必要があります。(ol3 API)
* (訳注:インターラクションの順番は、API を参照してください。)
*/
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});


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