yarrow_map_flutter_sdk 0.1.0
yarrow_map_flutter_sdk: ^0.1.0 copied to clipboard
Flutter SDK for Yarrow Maps with API parity to the web SDK.
0.1.0 #
Feature parity with the Yarrow web SDK 1.2.0.
Breaking #
[lng, lat]coordinate order foraddMarkerand all routing coordinates (buildRoute,buildRouteWithLabels,buildMultiSegmentRouteWithLabels), matching the web SDK and GeoJSON. Previously these took[lat, lng].changeStylesnow takes aYarrowStyleType?enum (default_/satellite/hybrid) instead of aString?.onIconClickcallbacks receive a fourthselectedparameter (bool?) — forpoisit reports whether the tapped POI is currently highlighted.- Event subscriptions (
onMoveEnd,onMapClick,onIconClick,onLayerClick,onCustomLayerClick) now return an unsubscribe function instead ofvoid. addMarkerrenders a proper pin as a symbol annotation (previously a small circle layer);YarrowMarkerHandle.idvalues are now annotation ids.- Requires Flutter >= 3.29 (via
maplibre_gl0.26).
Added #
- POI highlighting:
highlightPOI(id, options),highlightPOIs(ids, options),resetPOIHighlight([idOrIds]),isPOIHighlighted(id),getHighlightedPOIs()withHighlightPOIOptions(location, icon, title, iconSize, panTo, zoom, replace, onClick). Highlighted POIs are hidden from the base layer and re-rendered as markers, matching the web SDK. - Clustering of highlighted POIs:
setClustering(YarrowClusteringConfig)/getClustering(), config inYarrowMapConfig.clustering(radius 60 px, maxZoom 16, minPoints 2,onClusterClick— returnfalseto suppress zoom-to-expand). - Modern routing API:
buildRoute(BuildRouteOptions)with styling options,Accept-Language, cancellation via dioCancelToken,onRouteClick,fitBounds/clearOldRoutes/layerPrefix, and aBuildRouteResultwithmeta(profile, totalRoutes, bestRouteIndex, duration, distance).buildRouteWithLabels/buildMultiSegmentRouteWithLabelsare deprecated delegates. - POI base layer toggles:
excludePoiLayerconfig option,enablePoiLayer(),disablePoiLayer(),setPoiLayerEnabled(bool). - Read accessors:
isReady(),getTheme(),getStyleType(),getCenter()([lng, lat]),getZoom(). - Expanded
onLayerClicktargets:mahalla,district,region,countryadmin label layers in addition tobuildings/pois. - Camera option objects:
zoomTo(..., ZoomToOptions(speed, durationMs))andfitBounds(..., FitBoundsOptions(padding, durationMs, maxZoom)). - Search:
page/pageSizeoptions;onIconClickis now wired; in-flight requests are cancelled when superseded; re-fetch on move only after the center shifts >= 500 m (was: every move);iconImagedefaults to'geo-icon'as a fallback for results without icons. setFeatureState(...)passthrough (web-only in maplibre_gl 0.26 — Android/iOS throwUnimplementedError).destroy()alias fordispose();init()is idempotent and retryable; map-dependent calls made before the map is ready are queued and flushed on ready.- Anonymous DAU tracking ping (
sdk_type: 'flutter') matching the web SDK. addMarkeroptions:anchor,iconImage,iconSize,rotation; default pin is drawn natively and tinted bycolor.
Fixed #
- Custom sources/layers added via
addSource/addLayernow survivechangeStyles/changeTheme(they are replayed after every style load). changeThemeno longer resets satellite/hybrid back to the default style.- Feature taps no longer double-dispatch click callbacks (via maplibre_gl 0.26's
featureTapsTriggersMapClickdefault). onLayerClick(buildings)matches only building layers instead of everypolygon_tilelayer.
Changed #
- Dependencies:
maplibre_gl^0.26.2,dio^5.10.0,flutter_cache_manager^3.4.2,flutter_svg^2.3.0; addedpath_provider^2.1.5.
Platform limitations (vs. web SDK) #
- Hover effects are not applicable on touch devices and are not implemented.
onRouteHoveris omitted fromBuildRouteOptionsfor the same reason.setFeatureStateonly works on web until maplibre_gl implements it natively.- Highlight markers have no enter/exit scale animation (GL symbols, not DOM).
- Clusters update on camera events (idle + throttled move), not per frame.
0.0.5 #
- Breaking:
apiKeyis now a required parameter inYarrowMapConfig. - API key is automatically attached to all requests via Dio interceptor.
- Migrate routing endpoints to new API (
/api/routing/route) with updated coordinate and response formats. - Migrate search endpoint to new API (
/api/search/) with flat results structure and additional query parameters. - Add
changeBrandBadgePosition()method for dynamic badge repositioning at runtime. - Update brand badge and map controls with glassmorphism design (backdrop blur, updated colors and shadows).
- Improve search result rendering: conditional icon vs circle+label layers when results lack icons.
- Fix icon loading: clear registered images on style reload, fix trailing slash on icons endpoint.
0.0.4 #
- Add web-SDK parity APIs:
addSource,updateSourceData,queryRenderedFeatures, andaddLayer(options: ...)withsourceId/filter. - Expand controls positions to 6-way placement (
left,leftTop,leftBottom,right,rightTop,rightBottom). - Add automatic controls/badge collision inset for shared corners.
0.0.3 #
- Migrate from
maplibreto officialmaplibre_gl. - Expose GeoJSON clustering options in
YarrowMap.addLayer(...):cluster,clusterRadius,clusterMaxZoom,clusterProperties.
0.0.2 #
- Add
YarrowMap.onCustomLayerClick(layerId, callback)for click handling on SDK-added custom layers.
0.0.1 #
- TODO: Describe initial release.