0.2.1 • Published 7 years ago

ember-leaflet-contextmenu v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ember-leaflet-contextmenu

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

PropertyTypeDefaultDescription
disabledBooleanfalseIf set to true contextmenu is disabled

{{leaflet-contextmenu-item}}

Options

PropertyTypeDescription
actionActionAction to be called when user clicks on menu item
disabledBooleanIf set to true menu item is disabled
iconString
iconClsString
retinaIconString
retinaIconClsString
textStringLabel 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/.