2018年4月5日木曜日

Leaflet 1.3 - 2 ダウンロード

2 ダウンロード

Download Leaflet
http://leafletjs.com/
Download - Leaflet — a JavaScript library for interactive maps

に、次のように書かれています。

VersionDescription
Leaflet 1.3.1Stable version, released on January 18, 2018.
Leaflet 1.3-devIn-progress version, developed on the master branch.
Leaflet 0.7.7Legacy version, released on November 18, 2013 and last updated on October 26, 2015.


Note that the master version can contain incompatible changes, so please read the changelog carefully when upgrading to it.

マスタバージョンは、互換できない変更が含まれているので、アップグレードするときはチェンジログを注意して読んでください。


Using a Hosted Version of Leaflet

The latest stable Leaflet release is available on several CDN’s — to start using it straight away, place this in the head of your HTML code:

最新の安定版 Leaflet は、いくつかの CDN 上のものを利用できます。- 直接、使用し始めるためには、HTML コードの冒頭にこれを設置します。
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"<>/script>

To avoid potential security problems, we recommend and encourage enabling subresource integrity when using Leaflet from a CDN:

含まれているセキュリティ問題を避けるために、Leaflet を CDN から使用するとき、 subresource integrity を可能にすることを推奨し(強く望み)ます。

Subresource Integrity
Subresource Integrity - Web セキュリティ | MDN
https://developer.mozilla.org/ja/docs/Web/Security/Subresource_Integrity
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
  integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
  crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
  integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
  crossorigin=""<>/script>

訳注 Subresource Integrity については、MDN web docs の「Subresource Integrity(https://developer.mozilla.org/ja/docs/Web/Security/Subresource_Integrity)」などを参照してください。


Leaflet is available on the following free CDN’s: unpkg, cdnjs, jsDelivr

Leaflet は、次のフリー CDN: unpkg、cdnjs、jsDelivr が便利です。

Disclaimer: these services are external to Leaflet; for questions or support, please contact them directly.

免責事項: これらのサービスは、Leaflet の外部サイトです。問い合わせやサポートは、そちらに、直接、コンタクトしてください。


Using a Downloaded Version of Leaflet

Inside the archives downloaded from the above links, you will see four things:

上記リンクからダウンロードされるアーカイブ内は、4つのものがあります。

● leaflet.js - This is the minified Leaflet JavaScript code.
● leaflet-src.js - This is the readable, unminified Leaflet JavaScript, which is sometimes helpful for debugging. (The integrity hash for this file is sha512-IkGU/uDhB9u9F8k+2OsA6XXoowIhOuQL1NTgNZHY1nkURnqEGlDZq3GsfmdJdKFe1k1zOc6YU2K7qY+hF9AodA==)
● leaflet.css - This is the stylesheet for Leaflet.
● images - This is a folder that contains images referenced by leaflet.css. It must be in the same directory as leaflet.css.

● leaflet.js - これは、縮小版 Leaflet JavaScript コードです。
● leaflet-src.js - これは、読み取れる、縮小されていない Leaflet JavaScript で、デバッグに役立つこともあります。(このファイルの整合性ハッシュは、sha512-IkGU/uDhB9u9F8k+2OsA6XXoowIhOuQL1NTgNZHY1nkURnqEGlDZq3GsfmdJdKFe1k1zOc6YU2K7qY+hF9AodA== です。)
● leaflet.css - これは、Leaflet のスタイルシートです。
● images - これは、leaflet.css が参照する画像が含まれているフォルダです。leaflet.css と同じディレクトリになければなりません。

Unzip the downloaded archive to your website’s directory and add this to the head of your HTML code:

ダウンロードされたアーカイブをウェブディレクトリで unzip を実行(解凍)し、次のように HTNL コードの冒頭に追加します。
<link rel="stylesheet" href="/path/to/leaflet.css" />
<script src="/path/to/leaflet.js"></script>

Using a JavaScript package manager

If you use the npm package manager, you can fetch a local copy of Leaflet by running:

npm パッケージマネージャを使用する場合、次のように実行して Leaflet のローカルコピーを取ってくることができます。

npm install leaflet

You will find a copy of the Leaflet release files in node_modules/leaflet/dist.

node_modules/leaflet/dist に Leaflet リリースファイルのコピーを見つけられます。


Leaflet Source Code

These download packages above only contain the library itself. If you want to download the full source code, including unit tests, files for debugging, build scripts, etc., you can download it from the GitHub repository.

上記のこれらのダウンロードパッケージは、ライブラリ自身があるだけです。ユニットテストやデバッグのためのファイル、ビルドスクリプトなど、全てのソースコードをダウンロードしたい場合は、GitHub リポジトリからダウンロードできます。


Building Leaflet from the Source

Leaflet build system is powered by the Node.js platform, which installs easily and works well across all major platforms. Here are the steps to set it up:

Leaflet ビルドシステムは、Node.js プラットフォームによって動作しているので、全ての主要なプラットフォームに渡ってかんたんにインストールでき、良好に動作します。
このステップでセットアップします:

1. Download and install Node
2. Run the following command in the command line:

1. Node をダウンロードし、インストールします
2. コマンドラインで次のコマンドを実行します

npm install

Now that you have everything installed, run npm run build inside the Leaflet directory. This will combine and compress the Leaflet source files, saving the build to the dist folder.

Leaflet ディレクトリにインストールされているすべてのものがあり、npm を実行し、build を実行します。これは、Leaflet ソースファイルを結合して圧縮し、build を dist フォルダに保存します。

0 件のコメント: