Download the PHP package emcconville/google-map-polyline-encoding-tool without Composer
On this page you can find all versions of the php package emcconville/google-map-polyline-encoding-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emcconville/google-map-polyline-encoding-tool
More information about emcconville/google-map-polyline-encoding-tool
Files in emcconville/google-map-polyline-encoding-tool
Package google-map-polyline-encoding-tool
Short Description A simple class to handle polyline-encoding for Google Maps
License GNU
Informations about the package google-map-polyline-encoding-tool
Google Maps Polyline Encoding Tool
A simple PHP class for translating polyline into an encoded strings for Google Maps.
Install
Use composer.
Old fashion way.
Usage
Encoding
Decoding
Examples
See examples directory for creative ideas, and please contribute new use-cases / hacks.
- Well-Known Binary converter.
- Preview encoded strings with a SVG transcoder.
Specify precision
Precision defaults to 1e-5 (0.00001) which is expected by Google Map API. Other
API's like OSRM expect a precision of 1e-6.
You can adjust the precision you want by sub-classing Polyline, and overwrite
the $precision
static property.
Caution
- Adjusting the precision level will not guarantee improved accuracy. Existing issues with PHP's internal float point arithmetic can contribute accuracy issues.
- Third party libraries will not automatically know what level of precision was used during encoding.
Family
This library exists as a PHP reference point for Google's Encoded Polyline Algorithm Format. There is also a C implementation, and a namespace/trait library under active development.
Requires | google-map-polyline-encoding-tool | polyline-encoder | php_polyline |
---|---|---|---|
PHP | 5.3 | 5.4 | C-API |
Supports | google-map-polyline-encoding-tool | polyline-encoder | php_polyline |
---|---|---|---|
✔ | ✔ | ✔ | |
Bing | ✔ | ||
Precision | ✔ | ✔ | ✔ |
Tuple | ✔ | ✔ | |
Traits | ✔ | ||
Abstraction | ✔ |