map_utils_core library

Platform-agnostic geometry algorithms, shape models, drawing state, snapping, undo/redo, and GeoJSON utilities.

This package has zero dependency on any map SDK (flutter_map, google_maps_flutter, etc.). Use it directly for pure algorithm access, or through a binding package like flutter_map_utils or google_map_utils.

Geo typesLatLng, Distance, Vincenty, Haversine, LengthUnit, Path, Circle are all available directly from this package. No additional geo library required.

Enhanced geo classesGeoDistance, GeoPath, GeoCircle, GeoBounds extend the base types with additional algorithms.

Classes

AddShapeCommand<T>
Command that adds a shape to a shape list.
CatmullRomSpline
CatmullRomSpline2D<T extends num>
Circle
Circle-base GEO algorithms.
Distance
Calculates the distance between points.
DistanceCalculator
DistanceHaversine
Shortcut for final Distance distance = const Distance(calculator: const Haversine());
DistanceVincenty
Shortcut for final Distance distance = const Distance(calculator: const Vincenty());
DrawableCircle
DrawablePolygon
DrawablePolyline
DrawableRectangle
DrawableShape
Base class for all drawable shapes managed by DrawingState.
DrawingState
Central state manager for the drawing/editing system.
DrawingToolbar
A toolbar for selecting drawing modes.
GeoBounds
An axis-aligned geographic bounding box defined by southWest and northEast corners.
GeoCircle
A geographic circle defined by a center and radius in meters.
GeoDistance
Extended drop-in replacement for Distance with advanced geodetic methods.
GeoJsonUtils
GeoJSON import/export utilities.
GeometryUtils
Geometry utility functions.
GeoPath
An enhanced path of LatLng coordinates.
Haversine
LatLng
Coordinates in Degrees
LengthUnit
Path<T extends LatLng>
Path of LatLng values
Point2D
RemoveShapeCommand<T>
Command that removes a shape from a shape list.
SelectionUtils
Pure hit-testing algorithms for shape selection.
ShapeInfoPanel
Displays information about the currently selected shape.
ShapeStyle
Visual style configuration for a drawable shape.
ShapeStylePresets
Pre-configured style presets for common use cases.
SnapConfig
Configuration for the snapping engine.
SnapIndicatorData
Visual indicator data for snap feedback.
SnappingEngine
The snapping engine. Evaluates snap candidates in priority order.
SnapResult
Result of a snap operation.
UndoableCommand
A reversible command for the undo/redo system.
UndoRedoManager
Manages an undo/redo stack using the command pattern.
UpdateShapeCommand<T>
Command that replaces one shape with another (e.g. vertex edit).
Vincenty

Enums

DrawingMode
The mode the drawing/editing system is currently in.
ShapeType
The type of a drawable shape.
SnapType
Types of snap targets.
StrokeType
Platform-agnostic stroke pattern type.

Constants

earthRadius → const double
Earth radius in meter
equatorRadius → const double
Equator radius in meter (WGS84 ellipsoid)
flattening → const double
WGS84
pi → const double
The PI constant.
polarRadius → const double
Polar radius in meter (WGS84 ellipsoid)

Functions

decimal2sexagesimal(double dec) String
Converts a decimal coordinate value to sexagesimal format
degToRadian(double deg) double
Converts degree to radian
normalizeBearing(double bearing) double
Convert a bearing to be within the 0 to +360 degrees range. Compass bearing is in the rangen 0° ... 360°
radianToDeg(double rad) double
Radian to degree
round(double value, {int decimals = 6}) double
Rounds value to given number of decimals
sexagesimal2decimal(String str) double
Converts a string coordinate value in sexagesimal format to decimal
zeroPad(num number) String
Pads a number with a single zero, if it is less than 10

Typedefs

LatLngFactory = LatLng Function(double latitude, double longitude)
Necessary for creating new instances T extends LatLng (Path