Download the PHP package devshaded/nvdb-speed-limits without Composer
On this page you can find all versions of the php package devshaded/nvdb-speed-limits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devshaded/nvdb-speed-limits
More information about devshaded/nvdb-speed-limits
Files in devshaded/nvdb-speed-limits
Package nvdb-speed-limits
Short Description Fetch Norwegian speed limits from NVDB API
License MIT
Homepage https://github.com/devshaded/nvdb-speed-limits
Informations about the package nvdb-speed-limits
NVDB Speed Limits for Laravel
A Laravel package for fetching speed limits from the Norwegian NVDB API.
Table of Contents
- Features
- Installation
- Configuration
- Usage
- Get Speed Limit for a Coordinate
- Get Speed Limit with Expanded Search
- Get Speed Limits for Multiple Coordinates
- Error Handling
- Testing
- Contributing
- Changelog
- Credits
- License
Features
- Fetches speed limits from the Norwegian NVDB API for given coordinates
- Supports searching with an expanding radius if no speed limit is found initially
- Batch lookup for multiple coordinates
- Configurable API endpoint, search radius, and coordinate bounds
- Designed for Laravel, but can be used in any PHP project
Installation
Install the package via Composer:
Publish the config file (optional):
Configuration
The configuration file allows you to customize API settings, search parameters, and coordinate bounds. Example:
Usage
Import the facade or use the class directly:
Get Speed Limit for a Coordinate
Optional: Specify a Search Radius
Get Speed Limit with Expanded Search
This method will automatically expand the search radius until a speed limit is found or the maximum radius is reached.
Get Speed Limits for Multiple Coordinates
You can pass an array of coordinates (with lat
/lng
or latitude
/longitude
keys):
Error Handling
- If invalid coordinates are provided, an
InvalidCoordinatesException
will be thrown. - For batch lookups, errors are included in the result array for each coordinate.
- Always check the
found
property on the result object to determine if a speed limit was found.
Testing
Run the tests with:
Contributing
Contributions are welcome! Please open issues or submit pull requests for improvements or bug fixes.
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/my-feature
) - Create a new Pull Request
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of nvdb-speed-limits with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0