@tencent-map/lbs-skills 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/cli.js +10 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -326,10 +326,11 @@ async function cmdNearby(args) {
326
326
  keyword = (args.location || '') + (args.keywords || '');
327
327
  }
328
328
 
329
- const encoded = encodeURIComponent(keyword);
330
- const code = lib.encodeKey(key);
331
- const radius = args.radius || 1000;
332
- const url = `https://mapapi.qq.com/web/claw/nearby-search.html?keyword=${encoded}&radius=${radius}&code=${encodeURIComponent(code)}`;
329
+ const params = new URLSearchParams();
330
+ params.set('keyword', keyword);
331
+ params.set('radius', args.radius || 1000);
332
+ params.set('code', lib.encodeKey(key));
333
+ const url = `https://mapapi.qq.com/web/claw/nearby-search.html?${params.toString()}`;
333
334
 
334
335
  console.log(`\n🔍 已生成周边搜索链接:\n`);
335
336
  console.log(` ${url}\n`);
@@ -491,6 +492,11 @@ async function main() {
491
492
  const argv = process.argv.slice(2);
492
493
  const command = argv[0];
493
494
 
495
+ if (command === '--version' || command === '-v') {
496
+ console.log(version);
497
+ return;
498
+ }
499
+
494
500
  if (!command || command === '--help' || command === '-h') {
495
501
  console.log(HELP);
496
502
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencent-map/lbs-skills",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "腾讯地图位置服务命令行工具,支持 POI 搜索、地理编码、周边搜索、路径规划、旅游规划、轨迹可视化等功能",
5
5
  "bin": {
6
6
  "tmap-lbs": "./bin/cli.js"