Socket
Socket
Sign inDemoInstall

ember-leaflet-pm

Package Overview
Dependencies
467
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-leaflet-pm

Use leaflet-geoman in Ember with ember-leaflet.


Version published
Weekly downloads
13
increased by160%
Maintainers
1
Install size
36.4 MB
Created
Weekly downloads
 

Changelog

Source

[2.0.3] - 2020-08-03

Changed

  • Dependency updates

Readme

Source

npm version

ember-leaflet-pm

Use leaflet-geoman (used to be leaflet.pm) in Ember with ember-leaflet to create and edit geometry layers.

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-leaflet-pm

Usage

<LeafletMap … as |layers|>
  …
  <layers.pm-control />
</LeafletMap>

LeafletPmControl exposes all options of the 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:

import MarkerLayer from 'ember-leaflet/components/marker-layer';
import PmEnabledLayer from 'ember-leaflet-pm/mixins/pm-enabled-layer';

export default MarkerLayer.extend(PmEnabledLayer);
<LeafletMap … as |layers|>
  <layers.marker-layer-pm @location={{coordinates}} @onPm:edit={{action "featuredEdited"}} />
  <layers.pm-control />
</LeafletMap>

Directly interacting with leaflet-geoman is not supported, yet.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 03 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc