|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Google Maps - Encoded Polyline Algorithm |
| 5 | + * |
| 6 | + * This library is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU Lesser General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * This library is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU Lesser General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License |
| 17 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + * |
| 19 | + * @package PolylineEncoderInterface |
| 20 | + * @author E. McConville <[email protected]> |
| 21 | + * @version 1.1 |
| 22 | + * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html> |
| 23 | + * @link https://github.com/emcconville/polyline-encoder |
| 24 | + */ |
| 25 | +namespace emcconville\Polyline |
| 26 | +{ |
| 27 | + /** |
| 28 | + * Inform a delegate that a given class uses polyline encoding |
| 29 | + */ |
| 30 | + interface PolylineEncoderInterface |
| 31 | + { |
| 32 | + /** |
| 33 | + * Convert array of points into compressed ANSI string |
| 34 | + * |
| 35 | + * Points should be given to this method in lists of two. |
| 36 | + * array( |
| 37 | + * array({latitude1},{longitude1}), |
| 38 | + * array({latitude2},{longitude2}), |
| 39 | + * ... |
| 40 | + * array({latitudeN},{longitudeN}), |
| 41 | + * ) |
| 42 | + * |
| 43 | + * @param array $points |
| 44 | + * @return string |
| 45 | + */ |
| 46 | + public function encodePoints($points); |
| 47 | + |
| 48 | + /** |
| 49 | + * Convert ANSI string into array of points |
| 50 | + * |
| 51 | + * @param string $string |
| 52 | + * @return array or FALSE on error |
| 53 | + */ |
| 54 | + public function decodeString($string); |
| 55 | + } |
| 56 | +} |
0 commit comments