Skip to content

Latest commit

 

History

History
161 lines (113 loc) · 6.75 KB

API.md

File metadata and controls

161 lines (113 loc) · 6.75 KB

API Reference

map2map

map2map

Kind: global class

new map2map()

map2map.identifyMap(url)

Specifies the type of geolocation link(google/yandex/2gis/apple).

Kind: instance method of map2map
Returns: String | Number - If the geolocation link falls under one of the 4 types, returns the type, otherwise it will return -1.

Param Type Description
url String The geolocation link.

map2map.yandexMapsToCoord(url) ⇒ Promise

Translates a link to a Yandex Maps geolocation into coordinates.

Kind: instance method of map2map
Returns: Promise - Returns a Object. This object has lat and long (latitude and longitude) properties. On error, properties are equal to err. Note: Use no more than 1 time per second, otherwise captcha may work.

Param Type Description
url String The link to a Yandex Maps.

map2map.googleMapsToCoord(url) ⇒ Promise

Translates a link to a Google Maps geolocation into coordinates.

Kind: instance method of map2map
Returns: Promise - Returns a Object. This object has lat and long (latitude and longitude) properties. On error, properties are equal to err. Note: Use no more than 1 time per second, otherwise captcha may work.

Param Type Description
url String The link to a Google Maps.

map2map.twoGisMapsToCoord(url) ⇒ Promise

Translates a link to a 2Gis Maps geolocation into coordinates.

Kind: instance method of map2map
Returns: Promise - Returns a Object. This object has lat and long (latitude and longitude) properties. On error, properties are equal to err.

Param Type Description
url String The link to a 2Gis Maps.

map2map.coordToAppleMaps(url) ⇒ Object

Translates a link to a Apple Maps geolocation into coordinates.

Kind: instance method of map2map
Returns: Object. This object has lat and long (latitude and longitude) properties. On error, properties are equal to err.

Param Type Description
url String The link to a Apple Maps.

map2map.telegramLocationToCoord(msg) ⇒ Object

Translates a Telegram location into coordinates.

Kind: instance method of map2map
Returns: Object. This object has lat and long (latitude and longitude) properties. On error, properties are equal to err.

Param Type Description
msg Object https://core.telegram.org/bots/api#message

map2map.coordToYandexMaps(coord) ⇒ String

Translates coordinates into a link to a Yandex Maps.

Kind: instance method of map2map
Returns: String. The link to a Yandex Maps.

Param Type Description
coord Object lat and long (latitude and longitude) properties

map2map.coordToTwoGisMaps(coord) ⇒ String

Translates coordinates into a link to a 2Gis Maps.

Kind: instance method of map2map
Returns: String. The link to a 2Gis Maps.

Param Type Description
coord Object lat and long (latitude and longitude) properties

map2map.coordToGoogleMaps(coord) ⇒ String

Translates coordinates into a link to a Google Maps.

Kind: instance method of map2map
Returns: String. The link to a Google Maps.

Param Type Description
coord Object lat and long (latitude and longitude) properties

map2map.coordToAppleMaps(coord) ⇒ String

Translates coordinates into a link to a Apple Maps.

Kind: instance method of map2map
Returns: String. The link to a Apple Maps.

Param Type Description
coord Object lat and long (latitude and longitude) properties

map2map.coordToTelegramLocation(coord, chat_id, bot, bot_type) ⇒ String

Translates coordinates into a Telegram location.

Kind: instance method of map2map
Returns: String. The link to a Apple Maps.

Param Type Description
coord Object lat and long (latitude and longitude) properties
chat_id String Unique identifier for this Telegram chat
bot TelegramBot TelegramBot class instance (Telegraf/Telebot/node-telegram-bot-api)
bot_type String Telegram bot library.