MCPcopy Create free account
hub / github.com/debbide/GeoFill / fetchRealAddressSmart

Function fetchRealAddressSmart

scripts/generators.js:202–220  ·  view source on GitHub ↗

* 智能获取真实地址:优先 Geoapify,备用 OSM

(lat, lon)

Source from the content-addressed store, hash-verified

200 * 智能获取真实地址:优先 Geoapify,备用 OSM
201 */
202async function fetchRealAddressSmart(lat, lon) {
203 // 优先使用 Geoapify(如果有 API Key)
204 if (geoapifyApiKey) {
205 const result = await fetchRealAddressFromApi(lat, lon);
206 if (result) {
207 console.log('[GeoFill] 使用 Geoapify 地址');
208 return result;
209 }
210 }
211
212 // 降级到 OpenStreetMap
213 const osmResult = await fetchAddressFromOSM(lat, lon);
214 if (osmResult) {
215 console.log('[GeoFill] 使用 OpenStreetMap 地址');
216 return osmResult;
217 }
218
219 return null;
220}
221
222// 各国常见名字库
223const NAME_DATABASE = {

Callers 1

generators.jsFile · 0.85

Calls 2

fetchRealAddressFromApiFunction · 0.85
fetchAddressFromOSMFunction · 0.85

Tested by

no test coverage detected