cylon-v / flutter_map_animated_marker

Animated Marker for flutter_map

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter_map_animated_marker

Animated Marker for flutter_map

preview

Features

  • Animated Marker

Getting started

dependencies:
    flutter_map_animated_marker:

Usage

return FlutterMap(
            mapController: mapController,
            options: MapOptions(
              center: LatLng(51.509364, -0.128928),
              zoom: 9.2,
            ),
            children: [
              TileLayer(
                urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
              ),
              if (locationData != null)
                AnimatedMarkerLayer(
                  options: AnimatedMarkerLayerOptions(
                    duration: Duration(
                      milliseconds: duration,
                    ),
                    marker: Marker(
                      width: 30,
                      height: 30,
                      point: LatLng(
                        nextSimulateLocation.latitude,
                        nextSimulateLocation.longitude,
                      ),
                      builder: (context) => Center(
                        child: Transform.rotate(
                          angle: max(0, locationData.heading ?? 0) * pi / 180,
                          child: Image.asset(
                            'lib/assets/puck.png',
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
            ],
          );

About

Animated Marker for flutter_map

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Dart 71.5%Language:HTML 18.8%Language:Ruby 6.9%Language:Swift 2.1%Language:Kotlin 0.6%Language:Objective-C 0.2%