uzmaps_api
The typed HTTP client for the UzMap server: search, places, categories, routing, matrices, isochrones, photos and server status, over one model layer with no JSON ever leaking upward.
- Typed models —
SearchResult,PlaceDetails,MapRoute,RouteStep,ServerStatusand friends, decoded once at the boundary. - Hardened transport — automatic retries with backoff, a TTL response cache, request cancellation, and a typed
ApiFailurehierarchy with user-presentable messages. - Server health —
ServerMonitorpolls/api/status, tracks subsystem state and rebinds when the client is replaced. - Style URLs —
styleUrl(dark:)for the server's MapLibre styles.
Install
dependencies:
uzmaps_api: ^1.0.0
Use
final api = UzMapClient(
config: ApiConfig(
serverUrl: 'https://uzmaps.uz',
apiKey: 'your-key',
languageKey: 'uz', // labels come back in this language
),
);
final results = await api.search('Registan', lat: 41.31, lon: 69.24);
final details = await api.place(results.first);
final routes = await api.route(from: here, to: results.first, mode: 'car');
Errors are typed, never raw:
try {
await api.search('…');
} on ApiFailure catch (f) {
show(failureMessage(f)); // localized, user-presentable
}
The UzMaps family
| Package | Role |
|---|---|
uzmaps_core |
tokens, motion, strings, state |
uzmaps_api |
the typed UzMap server client — you are here |
uzmaps_ui |
the design system on top of core |
uzmaps_kit |
the complete map experience |
License
BSD-3-Clause. See LICENSE.
Libraries
- uzmaps_api
uzmaps_api— typed access to the UzMap HTTP API.