Giter Site home page Giter Site logo

Comments (7)

TheMarex avatar TheMarex commented on July 18, 2024 1

@chaupow I would suggest not allowing string values but only boolean and array of strings to keep the API surface small.

from node-osrm.

chaupow avatar chaupow commented on July 18, 2024 1

So shall we accept bool or an array of string?

Then, I will accept

var options = {
    annotations: true
};
var options = {
    annotations: ['distance', 'weight', 'node']
};
var options = {
    annotations: ['distance']
};

I will not accept

var options = {
    annotations: 'distance'
};
var options = {
    annotations: [true]
};

?

@karenzshea @TheMarex

from node-osrm.

karenzshea avatar karenzshea commented on July 18, 2024

I'll hit this after the speed param has also been added as an annotations option.

from node-osrm.

daniel-j-h avatar daniel-j-h commented on July 18, 2024

In order to not break the ABI here's what we have to do:

  • support the old boolean parameter
  • allow new string parameters

This is Javascript-land, we can do this by means of checking v8::Value::IsBoolean (old behavior) and v8::Value::IsString() (new behavior).

from node-osrm.

chaupow avatar chaupow commented on July 18, 2024

How should the API look like?
currently I was thinking of supporting following params:

var options = {
    annotations: 'true'
};

var options = {
    annotations: true
};

var options = {
    annotations: ['distance', 'weight', 'node']
};

does this make sense?

@karenzshea @TheMarex @daniel-j-h @freenerd

from node-osrm.

TheMarex avatar TheMarex commented on July 18, 2024

@chaupow exactly.

from node-osrm.

chaupow avatar chaupow commented on July 18, 2024

merged #299

from node-osrm.

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.