一個擴展 Google 地圖的 Flutter 套件,讓開發者能在地圖上放置基於自訂 widget 的標記。與標準標記不同,此套件支援使用任何 Flutter widget(例如圖示、頭像或互動元件)作為地圖標記。它能順暢整合至 Google 地圖外掛,並支援 Android、iOS 與 Web 平台。適合需要豐富、動態或互動式標記內容之應用程式,遠超簡單的影像或文字。
You need to insert the list of WidgetMarker to use widget markers.
Make sure that you still need to use onTap method when you use gestures.
class WidgetMarker {
WidgetMarker({
required this.position,
required this.markerId,
required this.widget,
this.onTap,
}) : assert(markerId.isNotEmpty);
final LatLng position;
/// Keep this unique, otherwise it will not appear.
final String markerId;
/// Gestures of widget is disabled.
/// Use this callback instead.
final VoidCallback? onTap;
final Widget widget;
}
If you have any requests or questions, feel free to ask on github.
Contributors ✨
Thanks goes to these wonderful people (emoji key):