Michael Andrews

Contributors Forks Stargazers Issues MIT License


Logo

Nav-URLs

Generate navigation URLs for various map platforms such as Google Maps.

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Installation
  3. Function Reference
  4. Usage
  5. License
  6. Contact
  7. Acknowledgements
  8. Open Source Licenses

About The Project

Nav-URLs generates navigation URLs for various map platforms. Currently, supported platforms include Google Maps, Apple Maps, and Bing Maps. Navigation routes can be generated by raw ordering or distance optimization. Generation of optimized navigation route URLs requires a MapQuest Developer API key. You can register and obtain a free MapQuest API key here.

Built With

Installation

Install via NPM:

npm install @mandrews6975/nav-urls

Function Reference

There are two preferred functions for generating navigation URLs (raw-ordered and optimized) and two deprecated functions that provide essentially the same functionality.

getRouteURL(locations, options)

Returns a raw-ordered navigation URL for the specified platform and locations.

getOptimizedRouteURL(locations, key, options, callback)

Retrieves an optimized navigation URL for the specified platform and locations and passes said URL into its callback function.

[DEPRECATED] routeNav(locations, options)

Returns a raw-ordered navigation URL for the specified platform and locations.

[DEPRECATED] routeNavOpt(locations, key, options)

Returns an optimized navigation URL (string) for the specified platform and locations.

Usage

Example 1

Print raw-ordered Google Maps navigation URL to console:

Result:

Example 2

Print optimized Google Maps navigation URL to console:

Result:

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Michael Andrews - GitHub: mandrews6975 - Email: me@michaelandrews.dev

Project Link: https://github.com/mandrews6975/Nav-URLs

Acknowledgements

Open Source Licenses