@asymmetrik/angular2-leaflet-filter
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,2 +0,2 @@ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.0 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.1 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory() : |
@@ -1,2 +0,2 @@ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.0 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.1 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";var e=require("./leaflet-filter/leaflet-filter.module");exports.LeafletFilterModule=e.LeafletFilterModule}); |
@@ -5,3 +5,3 @@ { | ||
"description": "Angular 2 component for the Leaflet Filter plugin", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"author": "Asymmetrik, Ltd.", | ||
@@ -8,0 +8,0 @@ "copyright": "Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.", |
@@ -24,10 +24,83 @@ # @asymmetrik/angular2-leaflet-filter | ||
## Usage | ||
TODO: Add basic usage examples using demo as a basis | ||
Include note about markers issue and workaround for Webpack | ||
Use the ```leaflet-filter``` attribute directive in conjunction with the ```leaflet``` attribute directive to activate a map and enable the filter control. | ||
```html | ||
<div leaflet style="height: 400px;" | ||
leaflet-filter | ||
[leafletOptions]="options" | ||
[leafletFilterOptions]="filterOptions" | ||
[(leafletFilterState)]="filterState" | ||
(leafletFilterStateChange)="eventHandler('filterChanged', $event)"> | ||
``` | ||
## API | ||
TODO: Add full details of each directive | ||
### leaflet-filter | ||
Attribute directive that activates the Leaflet filter plugin. | ||
### leafletFilterOptions | ||
Input binding for Filter control options. | ||
The Filter Control options extend the standard control options. | ||
Example: | ||
```js | ||
var options = { | ||
position: 'topright', | ||
filter: { | ||
rectangle: {}, | ||
polygon: {}, | ||
circle: {}, | ||
}, | ||
featureGroup: featureGroup | ||
}; | ||
``` | ||
#### featureGroup | ||
You may choose to provide your own featureGroup layer to the plugin. This is the layer in which the plugin will place all drawn filter shapes. If you specify the featureGroup, it's your job to make sure it's added to the map. | ||
If you don't specify a featureGroup, the component will create one for you. | ||
```js | ||
var featureGroup = L.featureGroup(); | ||
featureGroup.addTo(map); | ||
var options = { | ||
featureGroup: featureGroup | ||
}; | ||
``` | ||
#### position | ||
Determines the position on the map where the control will be placed. | ||
Possible values: 'topright' | **'topleft'** | 'bottomleft' | 'bottomright' | ||
#### filter | ||
Used to configure the various filter types. | ||
Possible properties: **circle** | **rectangle** | **polygon** | ||
If you omit the filter object entirely, all filter types will be enabled by default. | ||
```js | ||
// All filter types enabled | ||
var options = { | ||
position: 'topright' | ||
}; | ||
``` | ||
Alternatively, if you only specify a subset of the filter types, only those specified will be enabled. | ||
```js | ||
// Only circle and rectangle are enabled | ||
var options = { | ||
position: 'topright', | ||
filter: { | ||
circle: {}, | ||
rectangle: {} | ||
} | ||
}; | ||
``` | ||
## Contribute | ||
@@ -34,0 +107,0 @@ PRs accepted. If you are part of Asymmetrik, please make contributions on feature branches off of the ```develop``` branch. If you are outside of Asymmetrik, please fork our repo to make contributions. |
40119
114