Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Sources/W3WSwiftComponentsMap/Types/W3WMarkerList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ public class W3WMarkerList: CustomStringConvertible {

return retval.trimmingCharacters(in: .whitespaces).trimmingCharacters(in: CharacterSet(charactersIn: ","))
}

/// Returns an array of all W3WSquare markers in the marker list.
///
/// Since the markers property is internal to the W3WMarkerList class package,
/// this method provides public access to the markers collection.
///
/// - Returns: An array of W3WSquare objects representing all markers in the list.
/// Returns an empty array if no markers are present.
///
/// - Example:
/// ```swift
/// let markerList = W3WMarkerList()
/// let squares = markerList.getMarkers()
///
/// for square in squares {
/// // Work with each W3WSquare marker
/// mapHelper.addMarker(at: square)
/// }
/// ```

public func getmarkers() -> [W3WSquare] {
return markers
}


}
22 changes: 22 additions & 0 deletions Sources/W3WSwiftComponentsMap/Types/W3WMarkersLists.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,27 @@ public class W3WMarkersLists: CustomStringConvertible {

return retval
}

/// Returns a dictionary of all marker lists indexed by their names.
///
/// Use this method to access all marker lists stored in the W3WMarkersLists instance.
/// Each list contains markers and associated settings like color.
///
/// - Returns: A dictionary where the key is the list name (String) and the value is the corresponding W3WMarkerList.
/// The dictionary includes the default list with key "default" if no other lists were added.
///
/// - Example:
/// ```
/// let markerLists = W3WMarkersLists()
/// let allLists = markerLists.getLists()
///
/// // Access the default list
/// if let defaultList = allLists["default"] {
/// // Work with default list markers
/// }
/// ```
public func getLists() -> [String: W3WMarkerList] {
return lists
}

}