XiaoBai1221 commited on
Commit
047e32c
·
1 Parent(s): 69f3746

Update tools.js

Browse files
Files changed (1) hide show
  1. static/frontend/js/tools.js +4 -1
static/frontend/js/tools.js CHANGED
@@ -309,7 +309,10 @@ function renderCardContent(toolName, toolData) {
309
  }
310
 
311
  // 模式 5:地理定位數據(forward_geocode / reverse_geocode)
312
- if (toolData.best_match && toolData.best_match.lat && toolData.best_match.lon) {
 
 
 
313
  console.log('✅ 匹配到模式 5: 地理定位數據');
314
  return renderLocationData(toolData);
315
  }
 
309
  }
310
 
311
  // 模式 5:地理定位數據(forward_geocode / reverse_geocode)
312
+ // forward_geocode: best_match.lat/lon
313
+ // reverse_geocode: 直接有 lat/lon + display_name
314
+ if ((toolData.best_match && toolData.best_match.lat && toolData.best_match.lon) ||
315
+ (toolData.lat !== undefined && toolData.lon !== undefined && toolData.display_name)) {
316
  console.log('✅ 匹配到模式 5: 地理定位數據');
317
  return renderLocationData(toolData);
318
  }