패키지, 저장소 및 앱 카테고리 검색

패키지 상세v8.0.3

flutter_map_dragmarker

flutter_map용 Dragmarker 클래스

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.9만
좋아요
33
Pub 점수
130

패키지 설치

flutter pub add flutter_map_dragmarker

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_map용 드래그 마커 위젯으로 지도 위에서 마커의 상호작용 가능한 배치 및 이동을 가능하게 합니다. flutter_map의 기능을 확장하여 사용자가 원하는 위치로 마커를 끌어다 놓을 수 있게 하여 정밀한 지리 정보 입력이 필요한 애플리케이션에 적합합니다. 패키지는 flutter_map의 기존 API와 원활하게 통합되며 모바일, 웹, 데스크톱 등 모든 주요 플랫폼을 지원합니다. 경량이며 핵심 기능을 희생하지 않고 단순성에 초점을 맞춘 설계입니다.

사용 사례

  • 인터랙티브 지도 마커 배치
  • 지역 정보 입력
  • 지도 기반 폼 입력
  • 실시간 위치 조정
  • 사용자 정의 가능한 마커 드래그 동작

주요 기능

  • 드래그 가능한 마커 지원
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트