Files
Immich/mobile/lib/extensions/maplibrecontroller_extensions.dart
T
8d90cbeafc chore(mobile): remove unused code (#31280)
* chore: remove unused methods

* Remove dead test group

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Adam Gastineau <adam@agg.im>
2026-09-08 13:56:46 +00:00

20 lines
611 B
Dart

import 'dart:async';
import 'package:flutter/services.dart';
import 'package:maplibre_gl/maplibre_gl.dart';
extension MapMarkers on MapLibreMapController {
Future<Symbol?> addMarkerAtLatLng(LatLng centre) async {
// no marker is displayed if asset-path is incorrect
try {
final ByteData bytes = await rootBundle.load("assets/location-pin.png");
await addImage("mapMarker", bytes.buffer.asUint8List());
return await addSymbol(
SymbolOptions(geometry: centre, iconImage: "mapMarker", iconSize: 0.15, iconAnchor: "bottom"),
);
} finally {
// no-op
}
}
}