NeshanMap constructor
const
NeshanMap({
- Key? key,
- required String mapKey,
- NeshanMapConfig? config,
- List<
NeshanMarker> markers = const [], - NeshanMapController? controller,
- void onLocationChanged()?,
- void onMarkerTapped(
- String markerId
- NeshanErrorCallback? onError,
- NeshanErrorCallback? onLocationError,
- bool enableDebug = false,
Creates a Neshan map widget.
mapKey — The Neshan API key. Required.
config — Viewport and style settings. Uses sensible defaults
(Tehran centre, zoom 12, vector map) when omitted.
markers — Initial list of NeshanMarkers placed on the map when it
first loads. To mutate markers at runtime use controller.
controller — Optional NeshanMapController for programmatic control
(move, zoom, add/remove markers, etc.).
onLocationChanged — Fired whenever the map centre changes.
onMarkerTapped — Fired when a marker is tapped; receives the marker ID.
onError — Fired on WebView / iframe / parsing errors.
onLocationError — Fired when location permission is denied or the
location service is disabled.
enableDebug — Enables verbose console logging. Defaults to false.
Implementation
const NeshanMap({
super.key,
required this.mapKey,
this.config,
this.markers = const [],
this.controller,
this.onLocationChanged,
this.onMarkerTapped,
this.onError,
this.onLocationError,
this.enableDebug = false,
});