powermap_sdk 0.10.0
powermap_sdk: ^0.10.0 copied to clipboard
A comprehensive Flutter SDK for PowerMap, offering location plotting, geometry measurements, layer management, routing, search, and tracking.
0.10.0 #
Navigation Rerouting & Compass Stability #
- Fix: Suppressed compass/magnetometer updates during rerouting and for an 8-second stabilization window to prevent vehicle arrow spinning in vehicles.
- Fix: Implemented road-bearing lookahead (>= 5 meters along new route) to establish an accurate and stable initial heading after reroute.
- Fix: Reset stale GPS anchors (
_lastGpsPosand_smoothedGps) to the new route geometry, eliminating cross-median angle calculation bugs. - Fix: Added guard for Android devices reporting invalid heading
0.0when compass is unavailable. - Fix: Immediately wiped old
traveled-route-sourceGeoJSON on reroute to prevent ghost polyline remnants. - New: Added
onReroutedcallback toPowerMapNavigatorto notify host applications of route replacement.
Search & Geocoding #
- New: Added support for nationwide search when
proximityis omitted. - Update: Implemented automatic two-phase fallback in
PowerMapGeocodingService— expands to nationwide search when proximity search returns fewer than 3 results.
0.9.0 #
Navigation Camera & 2D/3D Mode Persistence #
- Update: Added
_userPreferredTiltto maintain user-selected camera mode (2D / 3D) across turn approaches, pause/resume, and rerouting cycles. - Update:
is2DModegetter now accurately reflects user-preferred camera mode rather than transient camera tilt states. - Fix: Smooth restoration of user-preferred zoom and tilt levels after completing turn maneuver approaches.
Rerouting Improvements & Traveled Route Layering #
- New: Added
_reorderTraveledRouteLayersto ensure traveled route and off-route connector layers are properly re-layered above new route polylines after dynamic rerouting. - Update: Synchronized initial camera bearing immediately upon reroute completion for seamless heading alignment with the new route geometry.
0.8.0 #
Speed Limit API #
- New: Integrated PowerMap Speed Limit API (
/api/v2/map/speed-limit). - New: Added
SpeedLimitServicewith a 4-layer throttling engine (Road Segment IDogc_fidcache, 30m distance filter, 4s time cooldown, in-flight request lock) to prevent excessive backend API calls. - New: Extended
NavigationStatewithspeedLimitandspeedLimitResultfields.
Turn-by-Turn Dynamic Step Arrows #
- New: Introduced dynamic turn maneuver guidance arrows rendered directly on the navigation polyline (
drawStepTurnArrows). - New: 3-layer arrow rendering system (Casing line, White core line, Arrowhead symbol layer) featuring Google Maps style zoom level interpolation for realistic scaling.
- New: Added
clearStepTurnArrowsanddisposeStepTurnArrowslifecycle methods.
Search & Auto-Language Script Detection #
- New:
langparameter default updated to'auto'across search and autocomplete methods. - New: Automatic script detection (Thai / English / Mixed) with multi-endpoint fallback querying and GID deduplication.
- New: Extended
PowerMapSearchResultwithnameTh,nameEn,addressTh, andaddressEnfields for localized property formatting.
Navigation Camera & Polyline Refinements #
- Update: Smart Camera Offset (
_offsetCameraTarget) in 3D perspective navigation to position the vehicle arrow down-screen and extend forward road visibility. - Update: Route polyline line caps updated to
roundfor smooth segment join rendering. - Update: Added transportation
profileparameter preservation toPowerMapRouteResult.
0.7.0 #
- Fix: Replaced the iOS layer Z-Index workaround with a robust dynamic Route Trimming algorithm. The active blue route is now physically trimmed as the vehicle progresses, completely preventing overlap with the traveled path.
- Fix: Changed route
lineCaptobuttto prevent visual bleeding and overlap artifacts at segment joints. - Fix: Resolved an iOS MapLibre crash caused by passing a 1-point
LineStringfor the traveled route by duplicating the point to form a valid zero-length line.
0.6.0 #
- Fix: Resolved an iOS-specific Z-Index bug where the blue planned route would incorrectly draw over the gray traveled route path.
0.5.0 #
Navigation 2.0.1 #
- Update: Smoothed map polyline rendering with rounded line joints and caps.
- Update: Improved Navigation Camera UX with smooth, interpolated "slide" transitions and adaptive 2D/3D toggles.
- Update: Optimized GPS responsiveness and accuracy with adjusted update throttling and accuracy thresholds.
- Fix: Fixed visual and behavioral issues in Navigation Simulation UX, including vehicle marker animation and traveled route path overlapping.
0.4.0 #
Navigation 2.0 #
- New: Introduced Navigation 2.0 engine with completely revamped internal math algorithms for smoother vehicle tracking.
- New: Added Smart Arrival Detection that accurately determines trip completion in both Simulation and GPS modes.
- New: Added 3-Stage Voice Guidance pre-announcements for upcoming maneuvers.
- New: Added Audio Ducking support on iOS to improve navigation voice clarity over background audio.
- New: Added Estimated Time of Arrival (ETA) and Current Speed to the public navigation state.
- New: Integrated Background Navigation capabilities (Android Foreground Services & iOS Background Modes).
- New: Added Screen Wakelock support to keep the display active during navigation.
- Update: Improved the Camera Bearing system to be adaptive based on vehicle speed, resulting in smoother map rotations.
- Update: Enhanced the Snap-to-Road algorithm to prevent incorrect snapping on complex routes (like U-turns and parallel roads).
- Update: Upgraded the GPS filtering mechanism with adaptive accuracy thresholds to handle poor signal areas better.
- Update: Optimized Simulation Mode with a dynamic speed curve that intelligently slows down before sharp turns.
- Fix: Fixed an issue where the vehicle marker would incorrectly jump to the starting point of a route before getting the first GPS lock.
- Fix: Fixed a problem where the camera movement appeared jerky on certain low-speed or high-noise segments.
0.3.1 #
3D Map Tiles (fill-extrusion) #
- New:
enable3DBuildingsparameter added toPowerMapconstructor. Default istrue. - New: 3D buildings (fill-extrusion layers) will now be rendered automatically when the map is tilted, provided
enable3DBuildingsis true. - Update: Style caching now uses separate cache files (
_2dand_3d) to prevent style interference when toggling 3D capabilities. - Update:
initialCameraPositionno longer forces a 60-degree tilt by default; it strictly follows theinitialTiltparameter (defaults to 0.0) regardless of the 3D setting.
0.3.0 #
Navigation Camera Mode (2D/3D) #
- New:
setCameraMode2D()— switches camera to 0° tilt (top-down view) with smoothanimateCameratransition. - New:
setCameraMode3D()— switches camera to 70° tilt (perspective view) with smooth transition. - New:
is2DModegetter — returns whether the navigator is currently in 2D mode. - All internal hardcoded
tilt: 70.0values replaced with the_cameraTiltstate variable, ensuring consistent behavior acrossstartNavigation(),setTracking(),_animateGpsInterpolation(), and_updateSimulationFrame().
Navigation Localization (Dynamic Language) #
- New:
setNavigationLanguage(String lang)— dynamically sets the navigation language ('th'or'en') for both API calls and TTS voice guidance. - Fix:
_performReroute()now uses the active navigation language instead of a hardcoded'en', preventing language mixing during rerouting. - Fix:
_initTts()now initializes the TTS locale based on the active navigation language, ensuring consistent pronunciation.
Route Rendering (GeoJSON Z-Index) #
- Breaking: Route line rendering refactored from
addLine()annotations toaddGeoJsonSource()+addLineLayer()withbelowLayerIdsupport. - Route lines are now drawn underneath road number labels and text labels at all zoom levels.
- Added
_findLabelLayerId()helper that auto-discovers the map style's first label/symbol layer. clearRoutes()now properly removes GeoJSON layers and source, with legacyclearLines()fallback.
Indoor Mapping (IMDF) #
- Fix:
IMDFConverter— correctedvenueandbuildingkind classification. Previously both were incorrectly mapped to'floor', now correctly return'venue'and'building'respectively. - New: IMDF conversion re-enabled in
GeometryManager.getGeoJSON()andexport(). ThetoIMDF()path was previously commented out; it is now active for both single-feature and bulk retrieval. - New:
IndoorManageris now integrated intoPowerMapControllerascontroller.indoor, providing a unified facade access point.
Geometry Manager Improvements #
- Refactored:
importGeoJson()now creates shared geometry-type layers (polygon, line, symbol) withgeometry-typefilters, instead of creating individual per-feature layers. This significantly reduces layer count for complex IMDF datasets. - New:
setLayerFilter(sourceId, filter)— applies a composited filter (merged with base geometry-type filter via['all', ...]) to all layers of a source. Enables dynamic floor switching without re-importing data. - New: Internal
_layerBaseFiltersmap tracks base filters per layer for correct filter compositing.
Widget Marker Coordinate Fix #
- Fix:
PowerMapwidget now correctly appliesdevicePixelRatiowhen converting geographic coordinates to screen positions for widget markers. Fixes misaligned widget markers on high-DPI devices.
0.2.0 #
- New:
opacityparameter added toaddMarker()— set initial marker visibility (0.0 = invisible, 1.0 = fully visible). - New:
setMarkersOpacity(double opacity)method onPowerMapController— bulk-sets opacity of all native GL markers (Circles and Symbols) in a single call. - Fix:
circleStrokeOpacityandiconOpacitynow correctly reflect theopacityparameter when creating markers. - These two additions enable smooth fade-in animation when refreshing markers, eliminating the visual "flash" from
clearMarkers()+ re-add cycles.
0.1.0 #
- Initial pre-release of PowerMap SDK.
- Core managers implemented: Geometry, Map, Routing, Search, Tracking, Layer, Cluster.
- Facade API accessible via
PowerMapController.