mapgl_2gis_web 0.0.4
mapgl_2gis_web: ^0.0.4 copied to clipboard
A high-performance Flutter Web wrapper for 2GIS MapGL JS API. Fully supports Dart 3 JS Interop and WASM.
0.0.4 - 2026-09-23 #
Breaking changes #
LayerController.removeLayerandclearnow returnFuture<void>. Mutating operations are serialized through an internal queue, so the relative order ofadd/removecalls is preserved regardless of how long each one waits for the map to be ready.SourceController.removeandclearnow returnFuture<void>for the same reason.GeoFeatureController.removeandclearnow returnFuture<void>.Polygon.onEvent/offEventandPolyline.onEvent/offEventnow take a typedvoid Function(DynamicObjectPointerEvent<T>)callback instead of a rawJSFunction.StyleIconConfignow matches the JS contract instyles.d.ts— a union of{url}(simple) and{url, width, height, stretchX, stretchY}(stretchable). The previous shape incorrectly exposedsize,pixelRatio, andpadding, which belong toLabelImage.- Removed
src/sources/geojson_source_bindings.dart. Its raw binding now lives inmapgl_map_bindings.dart, and the Dart-friendly helpers moved tosrc/sources/geojson_source_extensions.dartasGeoJsonSourceDartApi. - Renamed
src/types/style_Icon_config.darttosrc/types/style_icon_config.dart.
Added #
Marker— wrapper aroundmapgl.Markerwith full lifecycle (icons, hover icon, rotation, label, coordinates, visibility) and typed pointer events.HtmlMarker— wrapper aroundmapgl.HtmlMarker(coordinates, anchor, content, z-index). No events:HtmlMarkerdoes not extendEventedin the JS contract.LabelOptionsinsrc/common/— shared label configuration forMarkerand the clusterer'sInputMarker, includingfont, mirroringfont?: stringfrom the JS contract. Replaces the previousInputMarkerLabelOptions.MapEventType,MapEvent, andMapPointerEvent, plusonPointerEvent/offPointerEvent/onMapEvent/offMapEventonMapControllerandMapglMapNew.DynamicObjectPointerEvent<T>— typed pointer events forPolygon,Polyline, andMarker.DynamicObjectEventTypegainedtouchmove.ScriptLoaderBaseinsrc/core/— shared implementation behindDefaultMapglScriptLoaderandDefaultClustererScriptLoader.- New style layer types:
DashedLineStyleLayer,PointStyleLayer(withLabelingMargin),RasterStyleLayer,HeatmapStyleLayer. LngLatBoundsClassmethods:extend,getCenter,containsPoint,containsBounds,intersects.GeoJsonSourceDartApiextension withfromOptions,setDataFromMap,getAttributesMap,setAttributesFromMap.
Fixed #
MapglClustererNew.offEvent(and thereforeClustererController) silently failed to detach listeners — the JS handler wrapper is now cached per Dart callback viaExpando.- Removed the duplicated
GeoJsonSourcebinding (mapgl_map_bindings.dartvsgeojson_source_bindings.dart) that had diverged insetDatasignature. - Removed the circular import of
mapgl_2gis_web.dartfrommapgl_map_bindings.dart.
Changed #
- All source and API comments translated to English and rewritten in a more formal style.
TierOptiondocumented as an empty marker interface and intentionally not modelled.
Deprecated #
InputMarkerLabelOptions— useLabelOptionsinstead. Kept as atypedefalias for source compatibility.