Contextmenu plugin for ember-leaflet
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
addon
app
blueprints
config
tests
vendor
.editorconfig
.ember-cli
.eslintrc.js
.gitignore
.npmignore
.travis.yml
.watchmanconfig
LICENSE.md
README.md
ember-cli-build.js
index.js
package.json
testem.js
yarn.lock

README.md

ember-leaflet-contextmenu

Build Status

Provides a contextmenu for Ember-Leaflet, an Ember Addon for Leaflet interactive maps.

This addon is based on a JS library Leaflet.contextmenu and basically wraps it into ember component for usage in HTMLbars templates.

Installation

  • ember install ember-leaflet-contextmenu

Usage example

{{#leaflet-map lat=lat lng=lng zoom=zoom}}
  {{tile-layer url="http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"}}
  {{#leaflet-contextmenu}}
    {{leaflet-contextmenu-item
      text='show position'
      action=(action 'showPosition')
    }}
  {{/leaflet-contextmenu}}
{{/leaflet-map}}

Only a limited set of options provided by Leaflet.contextmenu are supported yet. Binding a contextmenu to layers isn't supported at all. I would appreciate pull requests.

{{leaflet-contextmenu}}

Wrapper for {{leaflet-contextmenu-item}}.

Options

Property Type Default Description
disabled Boolean false If set to true contextmenu is disabled

{{leaflet-contextmenu-item}}

Options

Property Type Description
action Action Action to be called when user clicks on menu item
disabled Boolean If set to true menu item is disabled
icon String
iconCls String
retinaIcon String
retinaIconCls String
text String Label to use for the menu item (required)

Running

Running Tests

  • yarn test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.