「2174-ol4ex.js」
var style = new ol.style.Style({
/** ol.style.Style
* Container for vector feature rendering styles. Any
* changes made to the style or its children through
* set*() methods will not take effect until the feature
* or layer that uses the style is re-rendered.
* ベクタフィーチャがスタイルを描画するためのコンテナ。
* スタイルや set*() メソッドを通じてその子に加えられた変
* 更は、スタイルを使用するフィーチャまたはレイヤが再レン
* ダリングされるまで有効になりません。
* (ol4 API)
*/
text: new ol.style.Text({
/** text:
* Text style.(ol4 API)
*/
/** ol.style.Text * Set text style for vector features. * ベクタフィーチャの文字列のスタイルを設定します。 * (ol4 API) */
font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"', /** font: * Font style as CSS 'font' value, see: https:// * developer.mozilla.org/en-US/docs/Web/API/ * CanvasRenderingContext2D/font. Default is '10px * sans-serif' * CSS「font」値と同じフォントスタイル。デフォルトは、 * 「10px sans-serif」。(ol4 API) */
placement: 'line', /** placement: * Text placement.(ol4 API) */
fill: new ol.style.Fill({
/** fill:
* Fill style. If none is provided, we'll use a dark
* fill-style (#333).
* 塗りつぶしスタイル。名前が提供されていなければダーク
* フィルスタイル(#333)を使用します。(ol4 API)
*/
/** ol.style.Fill * Set fill style for vector features. * ベクタフィーチャの塗りつぶしスタイルを設定。 * (ol4 API) */
color: 'white'
/** color:
* A color, gradient or pattern. See ol.color and
* ol.colorlike for possible formats. Default null;
* if null, the Canvas/renderer default black will
* be used.
* 色、グラデーション、または、パターン。可能なフォー
* マットは、ol.color と ol.colorlike を参照して
* ください。デフォルトは null。null の場合
* Canvas/renderer のデフォルト black(黒)が使
* 用されます。(ol4 API)
*/
}) }) });
var viewExtent = [1817379, 6139595, 1827851, 6143616];
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.
* プリレンダリング(事前描画)を提供するレイヤソースのた
* めの、特定の解像度でのズームレベルによって編成されてい
* るグリッドのタイルイメージ。(ol4 API)
*/
source: new ol.source.BingMaps({
/** source:
* Source for this layer. Required.
* このレイヤのソース。必須。(ol4 API)
*/
/** ol.source.BingMaps * Layer source for Bing Maps tile data. * Bing Maps タイルデータのレイヤソース。(ol4 API) */
key: 'As1Hi...(省略)', /** key: * Bing Maps API key. Get yours at * http://www.bingmapsportal.com/. Required. * (ol4 API) */
imagerySet: 'Aerial' /** imagerySet: * Type of imagery. Required. * 画像のタイプ。必須。(ol4 API) */
})
}), new ol.layer.Vector({
/** ol.layer.Vector
* Vector data that is rendered client-side.
* クライアント側で描画されるベクタデータ。(ol4 API)
*/
declutter: true, /** declutter: * Declutter images and text. Decluttering is * applied to all image and text styles, and the * priority is defined by the z-index of the style. * Lower z-index means higher priority. Default is * false. * 画像とテキストをぼかします。 ぼかし(デクラッタ)は、 * すべての画像とテキストスタイルに適用され、優先順位は、 * スタイルのZ-インデックスによって定義されます。 Z-イ * ンデックスが低いほど優先度が高くなります。デフォルト * は、false です。(ol4 API) */
source: new ol.source.Vector({
/** ol.source.Vector
* Provides a source of features for vector layers.
* Vector features provided by this source are
* suitable for editing. See ol.source.VectorTile
* for vector data that is optimized for rendering.
* ベクタレイヤのフィーチャのソースを提供します。このソー
* スが提供するベクタフィーチャは、編集に適しています。レ
* ンダリングのために最適化されたベクタデータのための
* ol.source.VectorTile を参照してください。
* (ol4 API)
*/
format: new ol.format.GeoJSON(), /** format: * The feature format used by the XHR feature loader * when url is set. Required if url is set, otherwise * ignored. Default is undefined. * url が設定されたときに XHR フィーチャローダに使用さ * れるフィーチャフォーマット。url が設定された場合、必 * 須で、それ以外は無視されます。デフォルトは、未定義です。 * (ol4 API) */
/** ol.format.GeoJSON * Feature format for reading and writing data in the * GeoJSON format. * GeoJSON フォーマットのデータを読み書きするためのフィー * チャフォーマット。(ol4 API) */
url: 'data/geojson/vienna-streets.geojson' /** url * Setting this option instructs the source to load * features using an XHR loader (see * ol.featureloader.xhr). Use a string and an * ol.loadingstrategy.all for a one-off download of * all features from the given URL. Use a * ol.FeatureUrlFunction to generate the url with * other loading strategies. Requires format to be * set as well. When default XHR feature loader is * provided, the features will be transformed from * the data projection to the view projection during * parsing. If your remote data source does not * advertise its projection properly, this * transformation will be incorrect. For some formats, * the default projection (usually EPSG:4326) can be * overridden by setting the defaultDataProjection * constructor option on the format. Note that if a * source contains non-feature data, such as a * GeoJSON geometry or a KML NetworkLink, these will * be ignored. Use a custom loader to load these. * このオプションを設定すると、XHR ローダを * (ol.featureloader.xhr参照)を使用してフィーチャを * ロードするためのソースを指示します。指定された URL から * のすべてのフィーチャの1回限りのダウンロードのために * string と ol.loadingstrategy.all を使用してくださ * い。他のローディングストラテジと共に URL を生成するため * に、ol.FeatureUrlFunctionを使用してください。format * も同様に設定する必要があります。デフォルトの XHR フィー * チャローダが提供される場合、フィーチャは、解析中にデータ * 投影からビュー投影へ変換されます。リモート・データ・ソー * スが適切に投影を示していない場合は、この変換は不正確にな * ります。いくつかのフォーマットでは、デフォルトの投影(通 * 常は EPSG:4326)は、フォーマット上の * defaultDataProjection constructor オプションを設 * 定することで上書きすることができます。ソースが、このよう * な GeoJSON ジオメトリ、または、 KML NetworkLink などの * 非フィーチャデータを含んでいる場合、これらは無視される * ことに注意してください。これらをロードするために、カス * タムローダを使用してください。 * (ol4 API) */
}),
style: function(feature) {
/** style:
* Layer style. See ol.style for default style which
* will be used if this is not defined.
* レイヤスタイル。これが定義されたいない場合、使用されるデ
* フォルトスタイルについて ol.style を参照してください。
* (ol4 API)
*/
style.getText().setText(feature.get('name'));
/** getText()
* Get the text style.(ol4 API)
*/
/** setText()
* Set the text style.(ol4 API)
*/
/** get(key)
* Gets a value.(ol4 API)
*/
return style;
}
})],
target: 'map',
view: new ol.View({
extent: viewExtent,
center: ol.extent.getCenter(viewExtent), /** ol.extent.getCenter(extent) * Get the center coordinate of an extent. * 範囲の中心座標を取得します。(ol4 API) */
zoom: 17, minZoom: 14 }) });


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