「2113-ol3ex.js」
var view = new ol.View({
center: [0, 0],
zoom: 2
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
/** ol.source.BingMaps
* Layer source for Bing Maps tile data.
* Bing Maps タイルデータのレイヤソース。(ol3 API)
*/
key: 'Ak-dzM4w...(省略)',
imagerySet: 'Road'
})
})
],
renderer: exampleNS.getRendererFromQueryString(),
// 'example-behavior.js' により URL にある renderer を返します
target: 'map',
view: view
});
var geolocation = new ol.Geolocation({
/** ol.Geolocation
* Helper class for providing HTML5 Geolocation capabilities.
* The Geolocation API is used to locate a user's position.
* HTML5 Geolocation 機能を提供するためのヘルパークラス。
* Geolocation API は、ユーザの位置を特定するために使用されま
* す。(ol3 API)
*/
projection: view.getProjection(), /** projection * The projection the position is reported in. * 位置が報告されている東映。(ol3 API) */
/** getProjection() * Get the projection associated with the position. * 位置をともなった投影を取得します。(ol3 API) */
tracking: true /** tracking * Start Tracking. Default is false. * トラッキングを始めます。デフォルトは false。(ol3 API) */ });
geolocation.once('change:position', function() {
/** once()
* Listen once for a certain type of event.
* あるタイプのイヴェントを1回リッスンします。
* Return: Unigue key for the listener.(ol3 API)
*/
view.setCenter(geolocation.getPosition()); /** setCenter() * Set the center of the current view. * 現在のビューの中心を設定します。(ol3 API) */
/** getPosition() * Get the position of the device. * デバイスの位置を取得します。(ol3 API) * Returns: The current position of the device * reported in the current projection. */
view.setResolution(2.388657133911758); /** setResolution(resolution) * Set the resolution for this view. * ビューの解像度を設定します。(ol3 API) */
});
** Use FastClick to eliminate the 300ms delay between a * physical tap and the firing of a click event on mobile * browsers. See http://updates.html5rocks.com/2013/12/ * 300ms-tap-delay-gone-away for more information. * 物理的なタップとモバイルブラウザ上のクリックイベントの発生の * 間の 300ms の遅延を解消する FastClick を使用してください。 * 詳細については、http://updates.html5rocks.com/2013/12/ * 300ms-tap-delay-gone-away を参照してください。 */
$(function() {
FastClick.attach(document.body);
/** body に FastClick をインスタンス化する
* FastClick の 「Usage」
* https://github.com/ftlabs/fastclick#usage
* を参照してください。
*/
});



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