Code Monkey home page Code Monkey logo

Comments (5)

LaurentiuUngur avatar LaurentiuUngur commented on June 3, 2024

Those are the options that I'm using when a route is calculated:

            var carOptions = CarOptions()
            carOptions.routeOptions.enableTolls = true
            carOptions.routeOptions.departureTime = Date()
            carOptions.routeOptions.optimizationMode = .fastest
            carOptions.avoidanceOptions.roadFeatures = [.ferry]

from here-sdk-examples.

HERE-SDK-Support-Team avatar HERE-SDK-Support-Team commented on June 3, 2024

Hi @LaurentiuUngur, can you provide more details how you calculate the same route twice? Do you hard-code the coordinates in the code? Or do you use the app to tap the same places? Do you clear the map beforehand?

It would be great if you can add the exact steps to reproduce the error. Ideally, with the coordinates of the routes. Thank you.

from here-sdk-examples.

LaurentiuUngur avatar LaurentiuUngur commented on June 3, 2024

Hi @HERE-SDK-Support-Team. I'm not hardcoding the coordinates in the code.

The flow is the following:

  1. On screen A I'm choosing origin and destination addresses
  2. I'm pushing screen B which has the map where I'm calculating the route from origin to destination (chosen from screen A) and I want to show the calculated route as preview to the user
  3. If I go back to screen A and select same origin and destination as before, the route won't be calculated anymore.

I'll attach the code used in the app that calculates the route (with hardcoded coordinates for testing purpose):
Screenshot 2023-10-13 at 16 17 56

Thank you !

from here-sdk-examples.

LaurentiuUngur avatar LaurentiuUngur commented on June 3, 2024

@HERE-SDK-Support-Team same happens in newly released SDK v4.16.1.0

from here-sdk-examples.

HERE-SDK-Support-Team avatar HERE-SDK-Support-Team commented on June 3, 2024

Hi @LaurentiuUngur, in your createRoute() method you also initialize the RoutingEngine. Calculating a route is done asynchronously, that means, you need to keep a reference of the engine outside of the scope of the method. Furthermore, when you call the method multiple times, you probably want to reuse an existing instance of the RoutingEngine. Hopefully, this solves your issues. If not, please leave a reply. Thank you!

from here-sdk-examples.

Related Issues (20)

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.