Skip to content

Commit

Permalink
Initial commit - v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
symbioquine committed Apr 24, 2021
1 parent b5789f9 commit a17ec35
Show file tree
Hide file tree
Showing 22 changed files with 27,771 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "airbnb",
"env": {
"browser": true
},
"rules": {
"brace-style": off,
"padded-blocks": off,
"no-param-reassign": [2, { "props": false }],
"no-use-before-define": ["error", { "functions": false, "classes": false }]
}
}
81 changes: 81 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0.0

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set RELEASE_VERSION environment variable
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: actions/setup-node@v1
with:
node-version: '13.x'
- run: npm ci
- run: npm run build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
See [CHANGELOG.md](https://github.com/symbioquine/ol-touch-draw/blob/${{ env.RELEASE_VERSION }}/CHANGELOG.md) for release notes.
draft: false
prerelease: false
- name: Upload 'ol-touch-draw.cjs.js' Release Asset
id: upload-cjs-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/ol-touch-draw.cjs.js
asset_name: ol-touch-draw.cjs.js
asset_content_type: application/javascript
- name: Upload 'ol-touch-draw.esm.js' Release Asset
id: upload-esm-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.esm.js
asset_name: ol-touch-draw.esm.js
asset_content_type: application/javascript
- name: Upload 'ol-touch-draw.umd.js' Release Asset
id: upload-umd-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.umd.js
asset_name: ol-touch-draw.umd.js
asset_content_type: application/javascript

publish-npm:
name: Publish to NPM
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '13.x'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Eclipse project files
.project
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

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

### Changed

- Initial check-in

[unreleased]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.1...HEAD
[v0.0.1]: https://github.com/symbioquine/ol-touch-draw/releases/tag/v0.0.1
102 changes: 101 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,102 @@
# ol-touch-draw
Provides a simplified touch-friendly drawing interaction for OpenLayers 6

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)

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

- [TouchDrawOptions](#touchdrawoptions)
- [Properties](#properties)
- [DefaultTouchDrawUnitConversions](#defaulttouchdrawunitconversions)
- [TouchDraw](#touchdraw)
- [Parameters](#parameters)
- [setMap](#setmap)
- [Parameters](#parameters-1)
- [changed](#changed)
- [constructor](#constructor)
- [Parameters](#parameters-2)
- [TouchDrawEventType](#touchdraweventtype)
- [TouchDrawEvent#drawstart](#touchdraweventdrawstart)
- [TouchDrawEvent#drawend](#touchdraweventdrawend)
- [TouchDrawEvent#drawabort](#touchdraweventdrawabort)
- [TouchDrawEvent](#touchdrawevent)
- [Parameters](#parameters-3)
- [feature](#feature)

### TouchDrawOptions

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

- `source` **VectorSource?** Source used as both a reference and destination. If
this options is provided, the referenceSource and destinationSource options should not be.
- `referenceSource` **VectorSource?** Reference source used to calculate proposed
drawing handles.
- `destinationSource` **VectorSource?** Destination source for the drawn features.

### DefaultTouchDrawUnitConversions

Default units and their meter conversions for touch draw dimensions.

### TouchDraw

**Extends PointerInteraction**

#### Parameters

- `opt_options` **[TouchDrawOptions](#touchdrawoptions)?** TouchDrawOptions.

#### setMap

##### Parameters

- `map` **ol.PluggableMap** Map.

#### changed

###

Type: PointerInteraction.Options

### constructor

#### Parameters

- `opt_options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Control options.

### TouchDrawEventType

Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)

### TouchDrawEvent#drawstart

Triggered upon feature draw start

### TouchDrawEvent#drawend

Triggered upon feature draw end

### TouchDrawEvent#drawabort

Triggered upon feature draw abortion

### TouchDrawEvent

**Extends Event**

#### Parameters

- `type` **[TouchDrawEventType](#touchdraweventtype)** Type.
- `feature` **Feature** The feature drawn.

#### feature

The feature being drawn.

Type: Feature
Loading

0 comments on commit a17ec35

Please sign in to comment.