パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v8.0.3

flutter_map_dragmarker

flutter_map の Dragmarker クラス

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2.7万
いいね数
33
Pub ポイント
130

パッケージをインストール

flutter pub add flutter_map_dragmarker

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

flutter_map向けのドラッグマーカーウィジェットで、マップ上のマーカーのインタラクティブな配置と移動を可能にします。flutter_mapの機能を拡張し、ユーザーが希望の場所にマーカーをドラッグできるようにすることで、正確な地理情報入力が必要なアプリケーションに最適です。このパッケージはflutter_mapの既存APIとシームレスに統合され、モバイル、Web、デスクトップを含むすべての主要プラットフォームをサポートしています。軽量でありながら、コア機能を損なわずシンプルに設計されています。

用途

  • インタラクティブなマップマーカー配置
  • 位置情報の入力
  • 地図ベースのフォーム入力
  • リアルタイム位置調整
  • カスタマイズ可能なマーカーのドラッグ動作

主な機能

  • ドラッグ可能なマーカーのサポート
  • flutter_map とのシームレスな統合
  • クロスプラットフォーム互換性
  • カスタマイズ可能なドラッグ動作
  • 軽量で実装が簡単

適している対象

  • インタラクティブなマップを開発する開発者
  • ユーザー定義の座標が必要なアプリケーション
  • 場所を認識するフォーム
  • マップ編集ツール
  • 地理空間機能のプロトタイピング

注意事項

  • flutter_map のインストールが必要です
  • マーカー固有の操作に限定
  • 位置に組み込み検証なし
  • カスタムビジュアルを実現するには追加のスタイル設定が必要になる場合があります
  • 複雑なマルチマーカー操作には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

flutter_map_dragmarker

A drag marker for flutter_map.

See the example/lib/main.dart for usage, but the included example below in this file should show pretty much everything.

ko-fi

Usage

  • This layer should probably be the last layer so IF it needs to be dragged (otherwise why would you use this :)). If not, other layers may intercept the gestures.
  • offset and dragOffset are there for tweaking icon/images if they should not get displayed centered.
  • height is mainly for Images, use Icon(..., size: ...), but be aware internal calculations are based on size.
  • rotateMarker toggles the markers' rotation on and off. True keeping markers upright.
  • Use scrollMapNearEdge if the map should scroll when a marker is dragged near the edge.
  • Enable useLongPress if you want to enable dragging after a long press
  FlutterMap(
    options: MapOptions(center: LatLng(45.5231, -122.6765), zoom: 9),
    children: [
      TileLayer(
        urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
      ),
      DragMarkers(
        markers: [
          DragMarker(
            point: LatLng(45.535, -122.675),
            offset: const Offset(0.0, -8.0),
            builder: (ctx) => const Icon(Icons.location_on, size: 50),
            onDragUpdate: (details, latLng) => print(latLng),
          ),
        ],
      ),
    ],
  ),

Further notes

It may be interesting to move the map alternately to marker, too. So the marker stays in place, but then technically you aren't dragging anymore, so thoughts welcome.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト