You are here

function gmap_polyutil_polyline in GMap Module 7.2

Same name and namespace in other branches
  1. 5 gmap_polyutil.inc \gmap_polyutil_polyline()
  2. 6.2 gmap_polyutil.inc \gmap_polyutil_polyline()
  3. 6 gmap_polyutil.inc \gmap_polyutil_polyline()
  4. 7 gmap_polyutil.inc \gmap_polyutil_polyline()

Simplify a set of points and generate an "Encoded Polyline" for Google Maps.

Parameters

array $points: An array of coordinate pairs as latitude, longitude.

Return value

array An array containing the point and zoom information necessary to display encoded polylines on Google Maps: 'points', 'levels', 'numLevels', and 'zoomFactor'.

Deprecated

use GmapPolylineToolbox::getInstance()->setPoints($points)->getPolyline();

File

./gmap_polyutil.inc, line 142
Encoded polyline utilities.

Code

function gmap_polyutil_polyline($points) {
  include_once drupal_get_path('module', 'gmap') . '/lib/Drupal/gmap/GmapPolylineToolbox.php';
  return GmapPolylineToolbox::getInstance()
    ->setPoints($points)
    ->getPolyline();
}