GithubHelp home page GithubHelp logo

ankiimation / flutter_map_animated_marker Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 10.0 327 KB

Animated Marker for flutter_map

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

Dart 19.19% Kotlin 0.19% Swift 2.82% Objective-C 0.06% HTML 5.71% Ruby 4.24% CMake 29.99% C++ 35.60% C 2.20%

flutter_map_animated_marker's Introduction

Hi there ๐Ÿ‘‹

flutter_map_animated_marker's People

Contributors

ankiimation avatar ramonremo avatar

Stargazers

 avatar  avatar

Watchers

 avatar

flutter_map_animated_marker's Issues

Update package with new version of flutter map

hi sir.
I need your package but this is not supported by flutter map version 3.0.0.
can you solve it?
thanks.

Because flutter_map_animated_marker >=0.0.4 depends on flutter_map ^2.2.0 and wefinder depends on flutter_map ^3.0.0, flutter_map_animated_marker >=0.0.4 is
  forbidden.
So, because wefinder depends on flutter_map_animated_marker ^0.0.4, version solving failed.

How can i update the marker using Geofire plugin

Hey hi!
beautiful library, absolutely what i have been looking for, I have done something similar where i animate the markers, and then came across this,

What I do is get the begining and end of the start and end point of coordinates and then get intermediate points using maths and then update them with certain time interval such that it appears it is moving seamlessly and it isn't like a blip or sth.

but you have done it better, I want to follow your lead and implement it in my app.
However i am having some difficulty following your example.

This is what i want to do , get the location updates from firebase using geofire and them update them on my flutter app

void initializeGeoFireListener() async {
    final driverLocation =
        FirebaseDatabase.instance.ref().child("availableDrivers").path;

    try {
  
      });
      Geofire.queryAtLocation(position.latitude, position.longitude, 50)!
          .listen((map) {

          var callBack = map['callBack'];

          switch (callBack) {
            case Geofire.onKeyEntered:
            
            
                updateDrivers.updateAvailableDriversOnMap();
                //  update_drivers();
              }
              break;

            case Geofire.onKeyExited:
             
              updateDrivers.updateAvailableDriversOnMap();

              break;

            case Geofire.onKeyMoved:
        
              updateDrivers.updateAvailableDriversOnMap();
              break;

            case Geofire.onGeoQueryReady:
              print("Geofire onQueryReady");
              GeoFireAssistant.printDriversList();

              break;
          }
        } else {
          print("Drivers Null");
        }
      }).onError((error) {
        print("Drivers error $error");
      });
    } on PlatformException {
      print("Drivers : No platformException response");
    }
  }
}

After i get them from the server i update them like this

class UpdateDrivers {
  BuildContext context;
  MapController osmController;
  bool removeDriverIcon;
  String? removeDriverKey;

  double? driverLon;
  String? driverKey;
  double? driverLat;

  static const double twoPi = 2 * pi;
  UpdateDrivers({
    required this.context,
    required this.osmController,
    required this.removeDriverIcon,
    this.driverKey,
    this.driverLat,
    this.driverLon,
    this.removeDriverKey,
    // required this.z,
  });

  void updateAvailableDriversOnMap() async {
    if (removeDriverIcon) {
      //removes the car when the driver goes offline
      await osmController.setStaticPosition([], removeDriverKey!);
      removeDriverIcon = false;
      removeDriverKey = null;
    } else {
      List<List<double>> intermediatePoints = await addIntermediatePoints(
          bearingLat!, bearingLon!, driverLat!, driverLon!, 50);

    await osmController.setMarkerOfStaticPoint(
          id: driverKey!,
          markerIcon: MarkerIcon(
              assetMarker: AssetMarker(
            image: AssetImage("images/images/car-ios.png"), // 51x 77
            // scaleAssetImage: (Platform.isIOS) ? 1.5 : null),
          )));

      for (int i = 1; i < intermediatePoints.length - 1; i++) {
        await Future.delayed(Duration(milliseconds: 50));

        List<double> point = intermediatePoints[i];
        double y = await AssistantMethods.getHeading(
          point[0],
          point[1],
          driverLat!,
          driverLon!,
        );

        await osmController.setStaticPosition([
          GeoPointWithOrientation(
              latitude: point[0], longitude: point[1], angle: y)
        ], driverKey!);
      }
      intermediatePoints = [];
      bearingLat = driverLat; //driver.latitude!;
      bearingLon = driverLon;
    }
  }

In the above class
i call this
await osmController.setMarkerOfStaticPoint(id.. markerIcon) to add markers on my map with their specific id as I have multiple markers, Vehicles as markers in my case. The question is how do i do something like this with your package.

Sorry for the long post, i did try but you could help out. that would be great.

Support flutter_map version 5.0.0

Because flutter_map_animated_marker 1.0.1 depends on flutter_map ^3.0.0 and no versions of flutter_map_animated_marker match >1.0.1 <2.0.0, flutter_map_animated_marker ^1.0.1 requires flutter_map ^3.0.0.
So, because egsa_map depends on both flutter_map ^5.0.0 and flutter_map_animated_marker ^1.0.1, version solving failed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.