-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: updated readme for CDN usage (#121)
- Loading branch information
1 parent
77e89a6
commit 2eacdf0
Showing
2 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,25 @@ npm i @watergis/mapbox-gl-export --save | |
|
||
## Use CDN | ||
|
||
import JS and CSS from CDN. | ||
|
||
- from unpkg.com | ||
|
||
```html | ||
<link href="https://www.unpkg.com/@watergis/mapbox-gl-export@latest/dist/mapbox-gl-export.css" rel="stylesheet" /> | ||
<script src='https://api.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.js'></script> | ||
<script src="https://www.unpkg.com/@watergis/mapbox-gl-export@latest/dist/mapbox-gl-export.umd.js"></script> | ||
<script> | ||
map.addControl(new MapboxExportControl({ | ||
PageSize: Size.A3, | ||
PageOrientation: PageOrientation.Portrait, | ||
Format: Format.PNG, | ||
DPI: DPI[96], | ||
Crosshair: true, | ||
PrintableArea: true, | ||
}), 'top-right'); | ||
</script> | ||
<link href="https://www.unpkg.com/@watergis/[email protected]/dist/mapbox-gl-export.css" rel="stylesheet" /> | ||
<script src="https://www.unpkg.com/@watergis/[email protected]/dist/mapbox-gl-export.umd.js"></script> | ||
``` | ||
|
||
Furthermore, you may download specific version's scripts and css locally from [release](https://github.com/watergis/maplibre-gl-export/releases) page. | ||
- from jsdelivr | ||
|
||
```html | ||
<link href="https://cdn.jsdelivr.net/npm/@watergis/[email protected]/dist/mapbox-gl-export.css" rel="stylesheet" /> | ||
<script src="https://cdn.jsdelivr.net/npm/@watergis/[email protected]/dist/mapbox-gl-export.umd.js"></script> | ||
`` | ||
|
||
See the sample code of [html](./index_cdn.html) and [JS](./index_cdn.js). | ||
|
||
Alternatively, you can use `latest` tag for CDN instead of specific version (But any breaking changes may be in the future). | ||
|
||
## Demo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,24 +14,25 @@ yarn add @watergis/maplibre-gl-export --save | |
|
||
## Use CDN | ||
|
||
import JS and CSS from CDN. | ||
|
||
- from unpkg.com | ||
|
||
```html | ||
<link href="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.css" rel="stylesheet" /> | ||
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> | ||
<script src="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.umd.js"></script> | ||
<script> | ||
map.addControl(new MaplibreExportControl.MaplibreExportControl({ | ||
PageSize: MaplibreExportControl.Size.A4, | ||
PageOrientation: MaplibreExportControl.PageOrientation.Landscape, | ||
Format: MaplibreExportControl.Format.PNG, | ||
DPI: MaplibreExportControl.DPI[300], | ||
Crosshair: true, | ||
PrintableArea: true, | ||
Local: 'fr' | ||
}), 'top-right'); | ||
</script> | ||
<link href="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.css" rel="stylesheet" /> | ||
<script src="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.umd.js"></script> | ||
``` | ||
|
||
Furthermore, you may download specific version's scripts and css locally from [release](https://github.com/watergis/maplibre-gl-export/releases) page. | ||
- from jsdelivr | ||
|
||
```html | ||
<link href="https://cdn.jsdelivr.net/npm/@watergis/[email protected]/dist/maplibre-gl-export.css" rel="stylesheet" /> | ||
<script src="https://cdn.jsdelivr.net/npm/@watergis/[email protected]/dist/maplibre-gl-export.umd.js"></script> | ||
`` | ||
|
||
See the sample code [here](./index_cdn.html). | ||
|
||
Alternatively, you can use `latest` tag for CDN instead of specific version (But any breaking changes may be in the future). | ||
|
||
## Demo: | ||
|
||
|