Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@coex/geosearch
Advanced tools
Simple nodejs library to find places all around the world
Datasource: Mapy.cz Suggest API
https://stackblitz.com/edit/geosearch
via yarn
yarn add @coex/geosearch
via npm
npm install @coex/geosearch
Let's find all Springfields in the World
import { GeoSearch } from '@coex/geosearch';
const geoSearch = new GeoSearch();
geoSearch
.suggest('Springfield', {
scope: 'muni', // Only cities, villages, (municipalities)
})
.then((places) => {
// ... do something cool
console.log('Results', places);
})
.catch((e) => {
// Catch Error
console.error('Error', e);
});
Let's find cities or villages start with Ber in Germany
import { GeoSearch } from '@coex/geosearch';
const geoSearch = new GeoSearch();
geoSearch
.suggest('Ber', {
scope: 'muni', // Only cities, villages, (municipalities)
country: 'de', // Only from Germany
})
.then((places) => {
// ... do something cool
console.log('Results', places);
})
.catch((e) => {
// Catch Error
console.error('Error', e);
});
Let's find position of public transport station in the Czech Republic
import { GeoSearch } from '@coex/geosearch';
const geoSearch = new GeoSearch();
geoSearch
.suggest('kokořín', {
scope: 'pubt', // Only public transport related places
country: 'cz', // Only from the Czech Republic
})
.then((places) => {
// ... do something cool
console.log('Results', places);
})
.catch((e) => {
// Catch Error
console.error('Error', e);
});
Let's try to find rivers, lakes, mountains, streets, national parks, areas, tourist attractions, ..., everything what awesome Mapy.cz Suggest API can do.
[
{
category: 'municipality_cz',
highlight: [],
sentence: '',
userData: {
bbox: [Array],
country: 'Česko',
district: 'Hlavní město Praha',
elasticWeight: 0,
evidenceNumber: '',
hasAddress: true,
highlight: [Array],
highlightSecond: [Array],
houseNumber: '',
iconType: 'geo',
id: 3468,
img: '',
importance: 0.763394835100681,
latitude: 50.0835493857,
longitude: 14.4341412988,
mmid: '',
mmsource: '',
mmtype: '',
muniId: '3468',
municipality: 'Praha',
nuts: 'CZ0100',
poiType: '',
poiTypeId: 0,
popularity: 1,
premiseIds: [],
quarter: '',
region: 'Hlavní město Praha',
source: 'muni',
street: '',
streetNumber: '',
suggestFirstRow: 'Praha',
suggestSecondRow: 'okres Hlavní město Praha, kraj Hlavní město Praha, Česko',
suggestThirdRow: 'Hlavní město',
ward: '',
wikiId: 'Q1085',
zipCode: '',
},
},
];
Option | Type | Default | Description |
---|---|---|---|
scope | 'muni' | 'area' | 'pubt' | 'street' | null | Preferred category of results |
bounds | { sw: LatLng, ne: LatLng} | null | Preffered country boundaries |
country | 'cz' | 'sk' | 'us' | 'de' | 'gb' | 'jp' | null | Preferred country. Same as bounds but with some presets. Feel free to add more via pull request |
debug | boolean | false | Print additional information to console |
yarn start
You can find and modify it in demo/index.ts
file
yarn demo
yarn test
Awesome Mapy.cz Suggest API from Seznam.cz
Please read this license before use.
Code of this library is licensed under the MIT license.
© 2021 COEX
FAQs
Nodejs library for finding places using Mapy.cz Suggest API
The npm package @coex/geosearch receives a total of 26 weekly downloads. As such, @coex/geosearch popularity was classified as not popular.
We found that @coex/geosearch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.