https://github.com/evocount/ember-leaflet-pm
Use leaflet-geoman (was leaflet.pm) in Ember with ember-leaflet to to create and edit geometry layers
https://github.com/evocount/ember-leaflet-pm
drawing ember-addon ember-leaflet geojson geometry leaflet leaflet-geoman
Last synced: 2 months ago
JSON representation
Use leaflet-geoman (was leaflet.pm) in Ember with ember-leaflet to to create and edit geometry layers
- Host: GitHub
- URL: https://github.com/evocount/ember-leaflet-pm
- Owner: evocount
- License: mit
- Created: 2019-02-27T09:21:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T22:52:08.000Z (almost 4 years ago)
- Last Synced: 2025-02-18T19:21:27.924Z (2 months ago)
- Topics: drawing, ember-addon, ember-leaflet, geojson, geometry, leaflet, leaflet-geoman
- Language: JavaScript
- Homepage:
- Size: 3.61 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://badge.fury.io/js/ember-leaflet-pm)
ember-leaflet-pm
==============================================================================Use [leaflet-geoman](https://github.com/geoman-io/leaflet-geoman) ([used to be leaflet.pm](https://github.com/geoman-io/leaflet-geoman/issues/501)) in Ember with [ember-leaflet](https://ember-leaflet.com) to create and edit geometry layers.
Compatibility
------------------------------------------------------------------------------* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v10 or aboveInstallation
------------------------------------------------------------------------------```
ember install ember-leaflet-pm
```Usage
------------------------------------------------------------------------------```hbs
…
```
`LeafletPmControl` exposes all options of the [leaflet-geoman toolbar](https://github.com/geoman-io/leaflet-geoman#leaflet-geoman-toolbar). In addition the pm map events `pm:drawstart`, `pm:drawend` and `pm:create` are available on this component in the ususal ember-leaflet fashion (`@onPm:drawstart={{action "someAction"}}`). Language can be set with the `lang` property (`@lang="de"`).
If you want to be able to edit existing layers and work with the modified geometries (i.e. store them in your backend), use the `PmEnabledLayer` mixin on the required layer type. This brings support for the pm layer events like `pm:edit` or `pm:vertexadded` as well as the `pmIgnore` option.
For example:
```js
import MarkerLayer from 'ember-leaflet/components/marker-layer';
import PmEnabledLayer from 'ember-leaflet-pm/mixins/pm-enabled-layer';export default MarkerLayer.extend(PmEnabledLayer);
``````hbs
```
Directly interacting with leaflet-geoman is not supported, yet.
Contributing
------------------------------------------------------------------------------See the [Contributing](CONTRIBUTING.md) guide for details.
License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).