@asymmetrik/angular2-leaflet-filter
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.2 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.3 - 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.2 - Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.*/ | ||
/*! @asymmetrik/angular2-leaflet-filter-0.0.3 - 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,6 +5,5 @@ /// <reference types="leaflet" /> | ||
import '@asymmetrik/leaflet-filter'; | ||
import { LeafletDirective } from '@asymmetrik/angular2-leaflet'; | ||
import { LeafletDirective, LeafletDirectiveWrapper } from '@asymmetrik/angular2-leaflet'; | ||
export declare class LeafletFilterDirective implements OnChanges, OnInit { | ||
leafletDirective: LeafletDirective; | ||
map: L.Map; | ||
leafletDirective: LeafletDirectiveWrapper; | ||
filterControl: L.Control.FilterControl; | ||
@@ -11,0 +10,0 @@ featureGroup: L.FeatureGroup; |
@@ -12,8 +12,7 @@ "use strict"; | ||
this.filterStateChange = new core_1.EventEmitter(); | ||
this.leafletDirective = leafletDirective; | ||
this.leafletDirective = new angular2_leaflet_1.LeafletDirectiveWrapper(leafletDirective); | ||
} | ||
LeafletFilterDirective.prototype.ngOnInit = function () { | ||
var _this = this; | ||
// Get the map from the parent directive | ||
this.map = this.leafletDirective.getMap(); | ||
this.leafletDirective.init(); | ||
// Initialize the draw options (in case they weren't provided) | ||
@@ -26,5 +25,5 @@ this.filterOptions = this.initializeFilterOptions(this.filterOptions); | ||
// Add the control to the map | ||
this.filterControl.addTo(this.map); | ||
this.filterControl.addTo(this.leafletDirective.getMap()); | ||
// Register the main handler for events coming from the draw plugin | ||
this.map.on('filter:filter', function (e) { | ||
this.leafletDirective.getMap().on('filter:filter', function (e) { | ||
setTimeout(function () { _this.filterStateChange.emit(e.geo); }); | ||
@@ -54,3 +53,3 @@ }); | ||
options.featureGroup = L.featureGroup(); | ||
this.map.addLayer(options.featureGroup); | ||
this.leafletDirective.getMap().addLayer(options.featureGroup); | ||
} | ||
@@ -57,0 +56,0 @@ return options; |
@@ -5,3 +5,3 @@ { | ||
"description": "Angular 2 component for the Leaflet Filter plugin", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Asymmetrik, Ltd.", | ||
@@ -26,3 +26,4 @@ "copyright": "Copyright Asymmetrik, Ltd. 2007-2017 - All Rights Reserved.", | ||
"leaflet-draw": "0.4", | ||
"@asymmetrik/angular2-leaflet": "0.0", | ||
"@asymmetrik/angular2-leaflet": "1.0", | ||
"@asymmetrik/leaflet-filter": "1.0", | ||
@@ -44,3 +45,3 @@ | ||
"@asymmetrik/angular2-leaflet": "0.0", | ||
"@asymmetrik/angular2-leaflet": "1.0", | ||
"@asymmetrik/leaflet-filter": "1.0", | ||
@@ -47,0 +48,0 @@ |
@@ -6,3 +6,3 @@ import { Directive, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChange } from '@angular/core'; | ||
import { LeafletDirective } from '@asymmetrik/angular2-leaflet'; | ||
import { LeafletDirective, LeafletDirectiveWrapper } from '@asymmetrik/angular2-leaflet'; | ||
@@ -16,7 +16,4 @@ | ||
leafletDirective: LeafletDirective; | ||
leafletDirective: LeafletDirectiveWrapper; | ||
// Reference to the primary map object | ||
map: L.Map; | ||
// Filter Control | ||
@@ -37,3 +34,3 @@ filterControl: L.Control.FilterControl; | ||
constructor(leafletDirective: LeafletDirective) { | ||
this.leafletDirective = leafletDirective; | ||
this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective); | ||
} | ||
@@ -43,4 +40,3 @@ | ||
// Get the map from the parent directive | ||
this.map = this.leafletDirective.getMap(); | ||
this.leafletDirective.init(); | ||
@@ -57,6 +53,6 @@ // Initialize the draw options (in case they weren't provided) | ||
// Add the control to the map | ||
this.filterControl.addTo(this.map); | ||
this.filterControl.addTo(this.leafletDirective.getMap()); | ||
// Register the main handler for events coming from the draw plugin | ||
this.map.on('filter:filter', (e: any) => { | ||
this.leafletDirective.getMap().on('filter:filter', (e: any) => { | ||
setTimeout(() => { this.filterStateChange.emit(e.geo); }); | ||
@@ -94,3 +90,3 @@ }); | ||
options.featureGroup = L.featureGroup(); | ||
this.map.addLayer(options.featureGroup); | ||
this.leafletDirective.getMap().addLayer(options.featureGroup); | ||
} | ||
@@ -97,0 +93,0 @@ |
Sorry, the diff of this file is not supported yet
41209
778