mmarcon / jhere

jHERE - Maps made easy
MIT License
255 stars 51 forks source link

adding via to route #23

Closed axeff closed 10 years ago

axeff commented 10 years ago

Hi,

since passing via's to route is not implemented yet, I'd like to do so.

What do you think is better implemented?

A: $map.jHERE('route', from, to, viaArray, {...}); //best in case of context B: $map.jHERE('route', from, to, {...}, viaArray); //best for existing apps using jhere C: $map.jHERE('route', from, to, {via: [], ...}); //or just extend the options obj

that's how it is now: $map.jHERE('route', from, to, {});

mmarcon commented 10 years ago

A is the one I like the most. viaArray should be an optional parameter. The extension should check the type of the third parameter. If it is an array then it uses it as via, if it is an object it uses it as the options object.

This will guarantee that old code still works and also that I don't have to specify the viaArray parameter if I don't need it.

Thanks for working on this :)

axeff commented 10 years ago

Sounds good to me. I will see what I can do.