Commit e47b6d52 by liimin

0.1.5

1 parent 14bee6f5
{
"name": "glsx-map-sdk",
"version": "0.1.4",
"version": "0.1.5",
"description": "glsx-map-sdk",
"main": "src/index.js",
"scripts": {
......
......@@ -20,7 +20,7 @@ class GlMapApi {
* @param {*} type 0:直线距离 , 1:驾车导航距离(仅支持国内坐标) , 3:步行规划距离(仅支持5km之间的距离)
* @returns {Promise<{elements: Array}>}
*/
async calculateDistance (from, to, type = 1) {
async calculateDistance(from, to, type = 1) {
try {
const destination = JSON.parse(JSON.stringify(from)).reverse().join(','),
origins = JSON.parse(JSON.stringify(to)).reverse().join(','),
......@@ -43,7 +43,7 @@ class GlMapApi {
* @param {*} type 直线距离 , 1:驾车导航距离(仅支持国内坐标) , 3:步行规划距离(仅支持5km之间的距离)
* @returns {Promise<{rows: Array}>}
*/
async calculateDistanceMatrix (from, toList, type = 1) {
async calculateDistanceMatrix(from, toList, type = 1) {
try {
const destination = JSON.parse(JSON.stringify(from)).reverse().join(','),
origins = JSON.parse(JSON.stringify(toList))
......@@ -72,7 +72,7 @@ class GlMapApi {
* @param {*} address (String)
* @returns
*/
geocoder (address) {
geocoder(address) {
return this.request.get('/v3/geocode/geo', {
address
})
......@@ -82,7 +82,7 @@ class GlMapApi {
* @param {*} location [lat<纬度>,lng<经度>]
* @returns
*/
async detailedAdrress (location) {
async detailedAdrress(location) {
try {
const [lat, lng] = location
const { regeocode } = await this.request.get('/v3/geocode/regeo', {
......@@ -134,7 +134,7 @@ class GlMapApi {
* IP定位
* @returns
*/
getLocationByIp () {
getLocationByIp() {
return this.request.get('/v3/ip')
}
/**
......@@ -147,7 +147,7 @@ class GlMapApi {
autonavi(不进行转换))
* @returns
*/
translate (locationsList, coordsys = 'autonavi') {
translate(locationsList, coordsys = 'autonavi') {
// 使用数组解构和map方法,将locationsList参数转换为字符串,并反转数组顺序,然后用竖线连接,得到locations字符串
const locations = JSON.parse(JSON.stringify(locationsList))
.map(e => (e = e.reverse()))
......@@ -166,7 +166,7 @@ class GlMapApi {
* @param {*} type 出行类型 1步行 2骑车 3驾车
*/
async routePlanning (from, to, type = 3) {
async routePlanning(from, to, type = 3) {
const funName = {
1: '/v3/direction/walking',
2: '/v4/direction/bicycling',
......@@ -189,7 +189,7 @@ class GlMapApi {
* @param {*} keywords 查询关键词
* @param {*} location 定位坐标 [lat,lng] 纬度前,经度后
*/
async keywordSearch (keywords, location) {
async keywordSearch(keywords, location) {
try {
const { route } = await this.request.get('/v3/assistant/inputtips', {
keywords,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!