All Projects → maydemirx → leaflet-tag-filter-button

maydemirx / leaflet-tag-filter-button

Licence: MIT license
Adds tag filter control for layers (marker, geojson features etc.) to LeafLet.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to leaflet-tag-filter-button

Itiriri Async
A library for asynchronous iteration.
Stars: ✭ 78 (+62.5%)
Mutual labels:  map, filter
Vue2leaflet
Vue 2 components for Leaflet maps
Stars: ✭ 1,809 (+3668.75%)
Mutual labels:  map, leaflet
Quizzity
A fast-paced geography quiz
Stars: ✭ 80 (+66.67%)
Mutual labels:  map, leaflet
Pgo
Go library for PHP community with convenient functions
Stars: ✭ 51 (+6.25%)
Mutual labels:  map, filter
Itiriri
A library built for ES6 iteration protocol.
Stars: ✭ 155 (+222.92%)
Mutual labels:  map, filter
Leaflet Ng2
Angular.io integration of Leaflet
Stars: ✭ 66 (+37.5%)
Mutual labels:  map, leaflet
Fungen
Replace boilerplate code with functional patterns using 'go generate'
Stars: ✭ 122 (+154.17%)
Mutual labels:  map, filter
Leaflet.easybutton
leaflet control buttons with icons and callbacks
Stars: ✭ 408 (+750%)
Mutual labels:  map, leaflet
Tangram
WebGL map rendering engine for creative cartography
Stars: ✭ 1,964 (+3991.67%)
Mutual labels:  map, leaflet
Mapbox.js
Mapbox JavaScript API, a Leaflet Plugin
Stars: ✭ 1,819 (+3689.58%)
Mutual labels:  map, leaflet
Iclient Javascript
Modern GIS Web Client for JavaScript, based on Leaflet\OpenLayers\MapboxGL-JS\Classic(iClient8C), enhanced with ECharts\D3\MapV etc. Contributed by SuperMap & community.
Stars: ✭ 593 (+1135.42%)
Mutual labels:  map, leaflet
Torchdata
PyTorch dataset extended with map, cache etc. (tensorflow.data like)
Stars: ✭ 226 (+370.83%)
Mutual labels:  map, filter
Performance Analysis Js
Map/Reduce/Filter/Find Vs For loop Vs For each Vs Lodash vs Ramda
Stars: ✭ 532 (+1008.33%)
Mutual labels:  map, filter
Leaflet.labeltextcollision
Leaflet.LabelTextCollision is a LeafletJS plug-in to display labels on vector data while avoiding label collisions.
Stars: ✭ 65 (+35.42%)
Mutual labels:  map, leaflet
React Native Map Clustering
React Native map clustering both for Android and iOS.
Stars: ✭ 450 (+837.5%)
Mutual labels:  map, markers
Flutter map marker cluster
Provides beautiful animated marker clustering functionality for flutter_map. Inspired by Leaflet.markercluster
Stars: ✭ 101 (+110.42%)
Mutual labels:  map, leaflet
Offlinemap
基于MySQL + Node.js + Leaflet的离线地图展示,支持百度、谷歌、高德、腾讯地图
Stars: ✭ 343 (+614.58%)
Mutual labels:  map, leaflet
React Leaflet
React components for Leaflet maps
Stars: ✭ 3,939 (+8106.25%)
Mutual labels:  map, leaflet
Papyruscs
PapyrusCS renders maps of Minecraft: Bedrock Edition worlds using C#, LevelDB and leaflet.
Stars: ✭ 146 (+204.17%)
Mutual labels:  map, leaflet
Mapsapi
Карты 2ГИС — это точные данные обо всех объектах города, включая новостройки, с детализацией до заборов и внутриквартальных проездов.
Stars: ✭ 193 (+302.08%)
Mutual labels:  map, leaflet

Leaflet Tag Filter Button

Adds tag filter control for layers (marker, geojson features etc.) to LeafLet. Check out the demo

Usage

Required Leaflet.EasyButton

Simple usage :

If your markers contains tags option the plugin filters them by selected tags when popup is closed For example:


var map = L.map('map');

var fastMarker = L.marker([50.5, 30.5], { tags: ['fast'] }).addTo(map); 
var slowMarker = L.marker([50.5, 30.5], { tags: ['slow'] }).addTo(map);
var bothMarker = L.marker([50.5, 30.5], { tags: ['fast', 'slow'] }).addTo(map);

L.control.tagFilterButton({
	data: ['fast', 'slow']
}).addTo( map );

Set data from external url or ajax

note: this option not implemented yet!


var map = L.map('map');
L.tagFilterButton({
	ajaxData: function(callback) {
		$.get('https://leaflet-tag-filter-button.herokuapp.com/data', function(data)) {
			callback(data);
		}
	}
}).addTo( map );


Selection complete callback


var map = L.map('map');
L.tagFilterButton({
	data: function(callback) {
		$.get('https://leaflet-tag-filter-button.herokuapp.com/data', function(data)) {
			callback(data);
		}
	},
	onSelectionComplete: function(tags) {
		console.log('selected tags are', tags);
	}
}).addTo( map );


API Docs

Options

Option Type Default Description
icon String or HTML fa-filter The button icon. Default is fa-filter. You can use html syntax for the icon for example <img src="https://github.com/filter.png">
onSelectionComplete Function null The callback function for selected tags. It fires when popup is closed and sends selected tags to the callback function as a parameter.
data Array or Function null The data to be used for tags popup, it can be array or function. If it's a function, the function must return tags array.
clearText String clear The text of the clear button
filterOnEveryClick Boolean false if set as true the plugin do filtering operation on every click event on the checkboxes.
openPopupOnHover Boolean false if set as true, the popup that contains tags will be open at mouse over time.

Methods

Method Returns Description
update() void Updates markers with last selected tags.
hasFiltered() Boolean returns true if any tag(s) selected otherwise false.
registerCustomSource(<Object> source) throws an exception if sourcehas no name orsource.hide function is not implemented Registers source object for filtering markers by tags. If you want to to use this function you must implement hide function
enablePruneCluster(<PruneCluster> pruneClusterInstance) void Searches markers for filtering on given pruneClusterInstance object
resetCaches(<Boolean> update?) void Resets internal caches. if the update parameter sent as true, the update() function will be call after cleaning the cache.
addToReleated(<TagFilterButton> tagFilterButton) Boolean If it required to use multiple TagFilterButtons in the same map you must link two instance of TagFilterButtons by using this method. If linking is successful returns true otherwise returns false.

Change Log

Please check the Releases page

Authors

Thanks to Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].