ubhub_maps 0.8.1
ubhub_maps: ^0.8.1 copied to clipboard
Official UBHUB Flutter SDK with native vector maps, 3D buildings, place-search widgets, typed geocoding, reverse geocoding, and routing.
Changelog #
0.8.1 #
- Fix (Android): closing the app with the back button crashed it with
NetworkOnMainThreadExceptionwhen the map had open connections. Map sessions now close their connections off the main thread.
0.8.0 #
- Detailed 3D on Android and iOS:
UbHubBuildings.detaileddraws the detailed 3D buildings as parts, each raised to its own height, andUbHubTrees.extrudeddraws trees as a trunk and a crown. Both use MapLibre's native extrusions and fall back toextrudedbuildings and treepointswhere the API has none yet. The resource policies allow the new/v1/buildings/<release>/parts/and/v1/trees/<release>/shapes/tiles. - Fix: changing
buildingStyleortreeStyleon a mounted map failed with a type error and replaced the map with "Unable to load the UBHUB map". Restyles now apply, and a look that cannot be applied leaves the map as it was. - Fix: a restyle kept the filter of extruded buildings (maplibre_gl drops it when a fill-extrusion layer is added), and restyles every building layer.
0.7.0 #
- Fix: the standard basemap loads again. The API now serves the default
basemap from versioned tile releases (
/v1/basemap/<release>/tiles/...), which 0.6.0 rejected, so its maps failed with "Unable to load the UBHUB map". The style check and the Android and iOS resource policies accept the release paths, the building and tree tile sets, and the style'slight. - 3D buildings and trees:
UbHubMapOptions.buildings(UbHubBuildings.none,flat(default) orextruded) andtrees(UbHubTrees.none(default) orpoints).UbHubMapOptions.initialTilt(0–60 degrees) opens the map tilted.UbHubMap.buildingStyle(UbHubBuildingStyle: color, outline color, opacity, height scale) andtreeStyle(UbHubTreeStyle: color, outline color, opacity) restyle the layers in place.UbHubMap.showBuildingsandshowTreeshide or show them without a new map load.
0.6.0 #
- Camera control on
UbHubMapController:fitBounds(bounds, padding:, animate:, duration:)frames a route or a set of markers.UbHubBounds.fromPointsbuilds the bounds.animateCameraandmoveCameratake aUbHubCameraPosition, including bearing and tilt.flyTogainsduration.toScreenLocationandfromScreenLocationconvert between map positions and logical-pixel screen offsets.queryCamera()reads the camera from the native map, whether or not camera callbacks are set.
UbHubBoundsgainsvalidate()and value equality.UbHubMapnow rejectscameraBoundswith swapped corners.- Android: info windows are positioned in logical pixels. The native projection reports physical pixels, so windows were offset on high-density screens.
- Place search localization and customization:
UbHubPlaceSearchStringswithenglishandmongolianpresets. The widget picks Mongolian when the app locale ismn.resultBuilderfor custom result rows.suggestionsshows app-provided places, such as recent selections, while the field is focused and empty.decorationis now optional; the default label followsstrings.
0.5.1 #
- Docs: a step-by-step Quickstart in the README; no code changes.
0.5.0 #
- More Google-Maps-style options on
UbHubMap:- Circles —
UbHubCircle(center, radiusMeters: ...), drawn as a meter-accurate polygon that scales with the map;onCircleTap. - Zoom limits —
minZoom/maxZoom(0–16). - Camera bounds —
cameraBounds(UbHubBounds) restricts panning. - Gesture and compass toggles —
rotateGesturesEnabled,scrollGesturesEnabled,zoomGesturesEnabled,tiltGesturesEnabled(still 2D by default),doubleClickZoomEnabled,compassEnabled,gestureRecognizers. - Long press —
onLongPress. - Camera callbacks —
onCameraMoveandonCameraIdlereport aUbHubCameraPosition;UbHubMapController.camerareads the current one.
- Circles —
0.4.0 #
- Google-Maps-style map features on
UbHubMap:- Markers are now
UbHubMarker(wasList<GeoPoint>). A bareUbHubMarker(point)draws the same dot. Migration:markers: points.map(UbHubMarker.new).toList(). - Custom marker icons via
UbHubMarkerIcon.asset/.bytes, plus per-markerlabel,sizeand opaquedata. - Marker clustering with
clusterMarkers,clusterRadius,clusterMaxZoom; tapping a cluster zooms to its expansion zoom (capped at the basemap maximum of 16). - Tap callbacks:
onMarkerTap,onPolylineTap,onPolygonTap.onTapnow fires only for basemap taps. - Polylines and polygons via
UbHubPolylineandUbHubPolygon(per-shape color, width, fill and stroke). - Info windows:
infoWindowBuildershows your widget above a tapped marker and tracks it as the camera moves;UbHubMapControllergainsshowInfoWindow,hideInfoWindow,zoomInandzoomOut. - App-provided icons are registered with
addImageand never pass through the basemap resource isolation; the overlay sources stay separate from the locked basemap.
- Markers are now
0.3.3 #
- Add
widthandheighttoUbHubMapso the map can be sized directly, without an outerSizedBoxorExpanded. The native map has no intrinsic size; set a height here or give it an external constraint, otherwise it collapses in an unbounded parent such as aColumnorListView. Both default to null (fill the available space, as before).
0.3.2 #
- Android: initialize MapLibre with the application context before the map transport configures its HTTP client, fixing a crash when the transport opens before any map view exists.
- Android: report native initializer failures (
LinkageError) as atransporterror instead of crashing the app.
0.3.1 #
- Add
UbHubBasemap.novaandUbHubMapOptions.basemapto show the Nova basemap (/v1/basemap/nova/*);UbHubBasemap.standardremains the default. - Android: allow up to 20 concurrent resource requests per map instead of OkHttp's default 5, so tiles, glyphs and sprites no longer queue behind each other.
- Android and iOS: pass a basemap
404to MapLibre as a real404, so missing tiles or glyph ranges are skipped instead of retried indefinitely.
0.3.0 #
- BREAKING: requires Flutter; plain Dart CLI/backend consumers must stay on 0.2.1.
- Consolidate native maps, place search, and REST services into
ubhub_maps. - Add Android/iOS map widgets with markers, route overlays, and camera control.
- Isolate native map credentials per session and reject redirected resources.
- Add debounced place search, a runnable Flutter example, and native CI checks.
- Replace
ubhub_maps_flutterimports withpackage:ubhub_maps/ubhub_maps.dart.
0.2.1 #
- Expose the complete CLI example at
example/main.dartfor pub.flutter-io.cn discovery. - Use the SDK default API origin in the example unless explicitly overridden.
- Preserve the original
example/basic_usage/main.dartentry point.
0.2.0 #
-
Use the verified deployed public API origin
https://developers.ubhub.mn. -
Share identical in-flight requests per client, avoiding duplicate HTTP calls, parsing, and API quota usage. Disable with
coalesceRequests: false. -
Never retain completed responses or failures; subsequent calls fetch fresh data.
-
Use typed byte buffers and fused UTF-8/JSON decoding for larger responses.
-
Avoid timing allocations when logging is disabled and reuse compiled patterns.
-
Add concurrency/stream regression tests and a reproducible Dart benchmark.
0.1.0 #
- Initial UBHUB Dart SDK using the package name
ubhub_maps. - Forward and reverse geocoding using the public
/v1/geocodecontract. - Driving and walking routes with typed GeoJSON geometry and snapped waypoints.
- Instance-scoped Bearer authentication and reusable HTTP connections.
- Typed failures, request IDs, rate-limit metadata, bounded timeouts, and safe logging.
- Deterministic unit tests, example, and opt-in staging integration tests.