Skip to content

Commit

Permalink
Misc packaging and documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
symbioquine committed Apr 25, 2021
1 parent a17ec35 commit a205421
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ jobs:
asset_path: ./dist/ol-touch-draw.umd.js
asset_name: ol-touch-draw.umd.js
asset_content_type: application/javascript
- name: Upload 'ol-touch-draw.css' Release Asset
id: upload-css-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/ol-touch-draw.css
asset_name: ol-touch-draw.css
asset_content_type: text/css

publish-npm:
name: Publish to NPM
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.0.2] - 2021-04-24

### Changed

- Improved readme
- Updated Github release to also upload css artifact
- Added keywords to package.json

## [v0.0.1] - 2021-04-24

### Changed
Expand Down
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,74 @@ A simplified touch-friendly drawing interaction for OpenLayers 6

![ol_touch_draw_demo](https://user-images.githubusercontent.com/30754460/115975050-6490b200-a516-11eb-8cae-f7fe2e200fa1.gif)

## Getting started

### All-in-one example

```html
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.5.0/css/ol.css" type="text/css">
<style>
.map {
height: 400px;
width: 100%;
}
</style>
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.5.0/build/ol.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ol-touch-draw/dist/ol-touch-draw.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol-touch-draw/dist/ol-touch-draw.css" type="text/css">
<title>OpenLayers ol-touch-draw example</title>
</head>
<body>
<h2>My Map</h2>
<div id="map" class="map"></div>
<script type="text/javascript">
var vectorSource = new ol.source.Vector();
vectorSource.addFeature(new ol.Feature(
new ol.geom.LineString([
[-20, 0],
[20, 0],
])
));
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Vector({
source: vectorSource
}),
],
view: new ol.View({
center: [0, 0],
zoom: 20
})
});
map.addInteraction(new olTouchDraw.default({ source: vectorSource }));
</script>
</body>
</html>
```

### Via NPM

```sh
npm i ol-touch-draw
```

```Javascript
import TouchDraw from 'ol-touch-draw';

...

map.addInteraction(new TouchDraw({ source: vectorSource }));
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{
"name": "ol-touch-draw",
"version": "0.0.1",
"version": "0.0.2",
"description": "A simplified touch-friendly drawing interaction for OpenLayers 6",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/symbioquine/ol-touch-draw.git"
},
"keywords": [
"openlayers",
"drawing",
"touch",
"ol"
],
"main": "dist/ol-touch-draw.cjs.js",
"module": "dist/ol-touch-draw.esm.js",
"browser": "dist/ol-touch-draw.umd.js",
Expand Down

0 comments on commit a205421

Please sign in to comment.