NeshanMarker class

A model representing a marker on a Neshan map.

This class encapsulates all the properties needed to display a marker using the Neshan SDK's nmp_mapboxgl.Marker API.

Usage Example

import 'package:flutter/material.dart';
import 'package:latlong2/latlong.dart';
import 'package:neshan_maps_flutter/map.dart';

final marker = NeshanMarker(
  id: 'marker1',
  position: LatLng(35.6892, 51.3890),
  color: Colors.red,
  title: 'Tehran',
  draggable: false,
);

Constructors

NeshanMarker({required String id, required LatLng position, Color? color, bool draggable = false, String? title})
Creates a new marker.
const

Properties

color Color?
Optional color for the marker.
final
draggable bool
Whether the marker can be dragged by the user.
final
hashCode int
The hash code for this object.
no setteroverride
id String
Unique identifier for the marker.
final
position → LatLng
The location where the marker should be displayed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Optional title text to display in a popup.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toColorString() String?
Converts the Color to a string format compatible with the Neshan SDK.
toJson() Map<String, dynamic>
Converts this marker to a JSON object for serialization.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override