Coder Social home page Coder Social logo

fasty_delivery's Introduction

๐ŸŒ Socials:

Instagram LinkedIn Stack Overflow Twitter YouTube

๐Ÿ’ป Tech Stack:

Dart Java Ruby Firebase Flutter

๐Ÿ“Š GitHub Stats:



fasty_delivery's People

Contributors

gazer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fasty_delivery's Issues

Generar polylines correctamente

Hola, gracias por el video.

Estuve viendo porque quedaba la polyline incorrectamente dibujada y para que se dibuje correctamente sobre las calles, se debe obtener la propiedad overviewPolyline de la variable route, y decodificarla, para esto se puede utilizar el package google_polyline_algorithm

Despues de importar el package en el pubspec.yaml se deberia remplazar el findDirections por este codigo

Future<void> findDirections(maps.LatLng from, maps.LatLng to) async {
    final origin = Location(from.latitude, from.longitude);
    final destination = Location(to.latitude, to.longitude);

    final result = await directionsApi.directionsWithLocation(
      origin,
      destination,
      travelMode: TravelMode.driving,
    );

    final Set<maps.Polyline> newRoute = {};

    if (result.isOkay) {
      final route = result.routes[0];
      final enumPoints = decodePolyline(route.overviewPolyline.points);
      final List<maps.LatLng> points = [];

      for (final punto in enumPoints) {
        final coordenadas = maps.LatLng.fromJson(punto);
        points.add(coordenadas);
      }

      final line = maps.Polyline(
        points: points,
        polylineId: maps.PolylineId("mejor ruta"),
        color: Colors.red,
        width: 4,
      );
      newRoute.add(line);
      _route = newRoute;
      notifyListeners();
    } else {
      print("ERRROR !!! ${result.status}");
    }
  }

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.