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

패키지 상세v6.0.0

flutter_map_tappable_polyline

onTap 이벤트를 갖는 Polyline 클래스를 추가하는 flutter_map 플러그인

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
346
좋아요
51
Pub 점수
130

패키지 설치

flutter pub add flutter_map_tappable_polyline

패키지 개요

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

flutter_map를 확장하여 탭 가능한 Polyline 클래스를 제공하는 플러터 플러그인으로, onTap 이벤트를 지원하여 상호작용 가능한 지도 경로를 가능하게 합니다. 이는 지도 위의 폴리라인이 탭되었을 때 사용자가 이를 감지할 수 있도록 하여 내비게이션 또는 경로 시각화에서 사용자 참여도를 높입니다. Android, iOS, Web, macOS, Windows, Linux와 호환되며 기존 flutter_map 프로젝트에 원활하게 통합됩니다. 패키지는 가볍고 핵심 기능에 집중되어 있으며, 폴리라인에 대한 터치 상호작용에 필요한 기능만 제공합니다.

사용 사례

  • 인터랙티브 경로 선택
  • 지도 기반 탐색 강조
  • 사용자 트리거된 폴리라인 작업
  • 피드백을 사용한 동적 경로 시각화
  • 터치 상호작용을 통한 지도 사용자 경험 향상

주요 기능

  • 다중선의 OnTap 이벤트 지원
  • flutter_map와의 원활한 통합
  • 크로스 플랫폼 호환성
  • 가볍고 집중적인 디자인
  • 모든 주요 플러터 플랫폼을 지원합니다

적합한 대상

  • 인터랙티브 지도를 개발하는 개발자
  • 지도 라인에서 사용자 입력이 필요한 앱
  • 내비게이션 또는 라우팅 애플리케이션
  • 향상된 상호작용을 갖춘 flutter_map를 사용하는 프로젝트

고려 사항

  • flutter_map 설치가 필요합니다
  • 폴리라인 탭 감지에 제한
  • 내장된 스타일 사용자 정의 없음
  • 복잡한 탭 로직을 처리하기 위해 추가 조작이 필요할 수 있습니다
  • 상류의 flutter_map 업데이트에 의존

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter Map Tappable Polyline

pub package

A Polyline with onTap event listener
This is a plugin for flutter_map package

Usage

Add flutter_map and flutter_map_tappable_polyline to your pubspec:

dependencies:
  flutter_map: ^6.0.1
  flutter_map_tappable_polyline: any # take latest version on Pub

Add it in you FlutterMap and configure it using TappablePolylineLayerOptions.

  Widget build(BuildContext context) {
    return FlutterMap(
      options: new MapOptions(
        plugins: [
          TappablePolylineMapPlugin(),
        ],
      ),
      layers: [
        TileLayerOptions(
          urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
          subdomains: ['a', 'b', 'c'],
        ),
        TappablePolylineLayerOptions(
          // Will only render visible polylines, increasing performance
          polylineCulling: true,
          polylines: [
            TaggedPolyline(
              tag: "My Polyline", // An optional tag to distinguish polylines in `onTap` callback
              // ...all other Polyline options
            ),
          ],
          onTap: (polylines, tapPosition) => print('Tapped: ' +
            polylines.map((polyline) => polyline.tag).join(',') +
            ' at ' +
            tapPosition.globalPosition.toString()),
          onMiss: (tapPosition) {
            print('No polyline was tapped at position ' +
                tapPosition.globalPosition.toString());
          }
        )
      ],
    );
  }

카테고리

의존성

의존성 목록 2 개

소스 저장소

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

아직 데이터가 없습니다.