开发Web应用自动补全组件:H.PlacesService相关技术疑问
Great questions—let’s break this down clearly since HERE’s Places API changes can be a bit confusing at first.
Why was PlacesService.suggest deprecated?
HERE deprecated the suggest endpoint (and its corresponding PlacesService.suggest method) mainly to streamline their Places API ecosystem. The old suggest endpoint was limited in functionality compared to newer tools: it lacked support for advanced filtering like category-based suggestions, location-aware result biasing, and unified results for addresses, POIs, and search terms. By sunsetting this endpoint, HERE focused on maintaining a single, robust solution that covers all autocomplete use cases—the Autosuggest API. This consolidation ensures consistent feature updates, better performance, and a more intuitive experience for developers.
Is Autosuggest the official replacement?
Absolutely. The Autosuggest API is the direct, supported replacement for the deprecated suggest endpoint. It’s built to handle every place autocomplete scenario you might need, with key improvements like:
- Unified suggestions for addresses, points of interest, and general search queries
- Support for location biasing to prioritize results near a user’s current position
- Flexible filtering by category, country, or other custom parameters
- More relevant and accurate results compared to the old suggest endpoint
Should you still use the PlacesService wrapper?
Since the official PlacesService doesn’t currently implement the Autosuggest endpoint, sticking strictly to the existing wrapper isn’t the most efficient path. Here are two solid alternatives:
- Direct REST API calls: You can call the Autosuggest REST endpoint directly from your frontend code. This gives you full control over parameters and response handling without relying on a wrapper that doesn’t support the feature you need.
- Custom wrapper extension: If you want to keep a consistent wrapper pattern across your app (to align with other HERE service integrations), create a custom extension of
PlacesService(or a separate service class) that wraps the Autosuggest API calls. This way, you maintain organized code while using the supported endpoint.
Either way, moving away from the deprecated suggest method is critical to keep your app functional as HERE phases out that endpoint entirely.
内容的提问来源于stack exchange,提问作者Luca Rasconi

