
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@tomtom-international/web-sdk-plugin-searchbox
Advanced tools
Plugin that provides SearchBox functionality to your map
This plugin provides a search box functionality to your map. Underneath it uses the TomTom Fuzzy Search service. For more information about Fuzzy Search please refer to the documentation: https://developer.tomtom.com/search-api/search-api-documentation-search/fuzzy-search
Just do:
npm i @tomtom-international/web-sdk-plugin-searchbox
You must also include the search box stylesheet in your project. It's located here:
node_modules/@tomtom-international/web-sdk-plugin-searchbox/dist/SearchBox.css
There are two ways to include search box into your page.
The first way to use search box:
import { map } from '@tomtom-international/web-sdk-maps';
import { services } from '@tomtom-international/web-sdk-services';
import SearchBox from '@tomtom-international/web-sdk-plugin-searchbox';
const ttSearchBox = new SearchBox(services.fuzzySearch, options);
map.addControl(ttSearchBox, 'top-left');
Note, that you need to pass the Tomtom services instance to the search box constructor. The second parameter are the options. They allow you to customize how search box behaves. Options (except searchOptions.key
) are not mandatory, we provide default ones.
Example options:
{
idleTimePress: 200,
minNumberOfCharacters: 3,
searchOptions: {
key: '<your-tomtom-search-key>'
language: 'en-GB'
},
units: 'metric',
filter: function(result[, resultIndex[, results]]) {
return true;
},
noResultsMessage: 'No results found.'
}
The second way to use search box:
import { services } from '@tomtom-international/web-sdk-services';
import SearchBox from '@tomtom-international/web-sdk-plugin-searchbox';
const ttSearchBox = SearchBox(services.fuzzySearch, options);
const searchBoxHTML = ttSearchBox.getSearchBoxHTML();
//Attach searchboxHTML to your page
Search box emits 3 events:
If you want to subscribe for the event:
ttSearchBox.on('tomtom.searchbox.resultsfound', function(data) {
console.log(data);
});
If you have initialized the search box and you want to change options later, you can do the following:
ttSearchBox.getOptions() //if you need old options, you can also retrieve them
ttSearchBox.updateOptions(newOptions)
ttSearchBox.query()
This query method triggers the search with updated options. This is necessary if you want to update results for the user with new options.
FAQs
Plugin that provides SearchBox functionality to your map
The npm package @tomtom-international/web-sdk-plugin-searchbox receives a total of 105 weekly downloads. As such, @tomtom-international/web-sdk-plugin-searchbox popularity was classified as not popular.
We found that @tomtom-international/web-sdk-plugin-searchbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.