leafletプラグイン > leaflet-fusesearch
あいまい検索Fuse.jsをLeafletで使えるようにするプラグイン
install fuse.js
$ npm install fuse.js
<link rel="stylesheet" href="./node_modules/leaflet/dist/leaflet.css" />
<script src="./node_modules/leaflet/dist/leaflet.js"></script>
<script src="./node_modules/fuse.js/dist/fuse.min.js"></script>
<link rel="stylesheet" href="./leaflet-fusesearch/src/leaflet.fusesearch.css" />
<script src="./leaflet-fusesearch/src/leaflet.fusesearch.js"></script>
<script src="./js/data.js"></script>
<link rel="stylesheet" href="./css/leaflet.infopane.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
JS
var map = L.map('map');
map.setView([51.505, -0.09], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var searchCtrl = L.control.fuseSearch()
searchCtrl.addTo(map);
map.addControl(searchCtrl);
var props = ['nom_comple', 'libcategor', 'commune'];
searchCtrl.indexFeatures(jsonData.features, props);
Author And Source
この問題について(leafletプラグイン > leaflet-fusesearch), 我々は、より多くの情報をここで見つけました https://qiita.com/sugasaki/items/23dd26b822b7411fa8a4著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .