NeshanMapConfig class
Viewport and style configuration for initializing a NeshanMap.
This class holds static initial-state values that describe how the map is rendered at startup: the viewport position, zoom bounds, map style, and overlay toggles. It is intentionally scoped to these concerns.
Markers are not part of this config. Pass them directly to the NeshanMap.markers parameter so they live alongside the controller and other widget-level data, keeping this class focused solely on viewport configuration.
All parameters are optional and fall back to sensible defaults.
Usage Example
import 'package:neshan_maps_flutter/map.dart';
import 'package:latlong2/latlong.dart';
NeshanMap(
mapKey: 'your-api-key',
config: NeshanMapConfig(
initialCenter: LatLng(35.6892, 51.3890), // Tehran, Iran
initialZoom: 15.0,
mapType: NeshanMapType.neshanVector,
showTraffic: true,
),
markers: [
NeshanMarker(
id: 'hq',
position: LatLng(35.6892, 51.3890),
title: 'HQ',
),
],
)
Default Values
| Parameter | Default |
|---|---|
| initialCenter | LatLng(35.6892, 51.3890) (Tehran) |
| initialZoom | 12.0 |
| mapType | NeshanMapType.neshanVector |
| minZoom | 2.0 |
| maxZoom | 21.0 |
| showPoi | true |
| showTraffic | false |
| showCurrentLocationButton | true |
Map Types
Available map types via NeshanMapType:
- NeshanMapType.neshanVector — default vector map
- NeshanMapType.neshanVectorNight — vector map, night mode
- NeshanMapType.neshanRaster — raster map
- NeshanMapType.neshanRasterNight — raster map, night mode
Constructors
- NeshanMapConfig({LatLng initialCenter = const LatLng(35.6892, 51.3890), double initialZoom = 12.0, NeshanMapType mapType = NeshanMapType.neshanVector, double minZoom = 2.0, double maxZoom = 21.0, bool showPoi = true, bool showTraffic = false, bool showCurrentLocationButton = true})
-
Creates a viewport/style configuration for a NeshanMap.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCenter → LatLng
-
The initial center coordinate of the map.
final
- initialZoom → double
-
The initial zoom level.
final
- mapType → NeshanMapType
-
The map style to display.
final
- maxZoom → double
-
The maximum zoom level the user can zoom in to.
final
- minZoom → double
-
The minimum zoom level the user can zoom out to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCurrentLocationButton → bool
-
Whether to show the current-location floating action button.
final
- showPoi → bool
-
Whether to render points of interest on the map.
final
- showTraffic → bool
-
Whether to render the traffic layer on the map.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited