/* * Utility functions to decode/encode numbers and array's of numbers * to/from strings (Google maps polyline encoding) * * Extends the L.Polyline and L.Polygon object with methods to convert * to and create from these strings. * * Jan Pieter Waagmeester * * Original code from: * http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ * (which is down as of december 2014) */ (function () { 'use strict'; var defaultOptions = function (options) { if (typeof options === 'number') { // Legacy options = { precision: options }; } else { options = options || {}; } options.precision = options.precision || 5; options.factor = options.factor || Math.pow(10, options.precision); options.dimension = options.dimension || 2; return options; }; var PolylineUtil = { encode: function (points, options) { options = defaultOptions(options); var flatPoints = []; for (var i = 0, len = points.length; i > 1) : (num >> 1); } return numbers; }, encodeUnsignedIntegers: function(numbers) { var encoded = ''; for (var i = 0, len = numbers.length; i = 0x20) { value = (0x20 | (num & 0x1f)) + 63; encoded += (String.fromCharCode(value)); num >>= 5; } value = num + 63; encoded += (String.fromCharCode(value)); return encoded; } /* jshint bitwise:true */ }; // Export Node module if (typeof module === 'object' && typeof module.exports === 'object') { module.exports = PolylineUtil; } // Inject functionality into Leaflet if (typeof L === 'object') { if (!(L.Polyline.prototype.fromEncoded)) { L.Polyline.fromEncoded = function (encoded, options) { return new L.Polyline(PolylineUtil.decode(encoded), options); }; } if (!(L.Polygon.prototype.fromEncoded)) { L.Polygon.fromEncoded = function (encoded, options) { return new L.Polygon(PolylineUtil.decode(encoded), options); }; } var encodeMixin = { encodePath: function () { return PolylineUtil.encode(this.getLatLngs()); } }; if (!L.Polyline.prototype.encodePath) { L.Polyline.include(encodeMixin); } if (!L.Polygon.prototype.encodePath) { L.Polygon.include(encodeMixin); } L.PolylineUtil = PolylineUtil; } })();

Где находится Корого на карте Кот-д'Ивуара показать Автомобильный маршрут от Северской до Новороссийска на карте необузданный Kamskiy-pereulok Расстояние Ильский Новороссийск на машине составляет – 102 км