@2gis/mapgl-directions
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=1)}([function(t,e){t.exports=o,t.exports.parse=o,t.exports.stringify=function t(e){"Feature"===e.type&&(e=e.geometry);function n(t){return t.join(" ")}function r(t){return t.map(n).join(", ")}function o(t){return t.map(r).map(i).join(", ")}function i(t){return"("+t+")"}switch(e.type){case"Point":return"POINT ("+n(e.coordinates)+")";case"LineString":return"LINESTRING ("+r(e.coordinates)+")";case"Polygon":return"POLYGON ("+o(e.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+r(e.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+(e.coordinates.map(o).map(i).join(", ")+")");case"MultiLineString":return"MULTILINESTRING ("+o(e.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+e.geometries.map(t).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}};var n=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,r=new RegExp("^"+n.source+"(\\s"+n.source+"){1,}");function o(t){var e,n=t.split(";"),o=n.pop(),i=(n.shift()||"").split("=").pop(),s=0;function a(t){var e=o.substring(s).match(t);return e?(s+=e[0].length,e[0]):null}function u(){a(/^\s*/)}function l(){u();for(var t,e=0,n=[],o=[n],i=n;t=a(/^(\()/)||a(/^(\))/)||a(/^(,)/)||a(r);){if("("===t)o.push(i),i=[],o[o.length-1].push(i),e++;else if(")"===t){if(0===i.length)return null;if(!(i=o.pop()))return null;if(0===--e)break}else if(","===t)i=[],o[o.length-1].push(i);else{if(t.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,t.split(/\s/g).map(parseFloat))}u()}return 0!==e?null:n}function p(){for(var t,e,n=[];e=a(r)||a(/^(,)/);)","===e?(n.push(t),t=[]):e.split(/\s/g).some(isNaN)||(t||(t=[]),Array.prototype.push.apply(t,e.split(/\s/g).map(parseFloat))),u();return t?(n.push(t),n.length?n:null):null}function c(){return function(){if(!a(/^(point(\sz)?)/i))return null;if(u(),!a(/^(\()/))return null;var t=p();return t?(u(),a(/^(\))/)?{type:"Point",coordinates:t[0]}:null):null}()||function(){if(!a(/^(linestring(\sz)?)/i))return null;if(u(),!a(/^(\()/))return null;var t=p();return t&&a(/^(\))/)?{type:"LineString",coordinates:t}:null}()||function(){if(!a(/^(polygon(\sz)?)/i))return null;u();var t=l();return t?{type:"Polygon",coordinates:t}:null}()||function(){if(!a(/^(multipoint)/i))return null;u();var t=o.substring(o.indexOf("(")+1,o.length-1).replace(/\(/g,"").replace(/\)/g,"");o="MULTIPOINT ("+t+")";var e=l();return e?(u(),{type:"MultiPoint",coordinates:e}):null}()||function(){if(!a(/^(multilinestring)/i))return null;u();var t=l();return t?(u(),{type:"MultiLineString",coordinates:t}):null}()||function(){if(!a(/^(multipolygon)/i))return null;u();var t=l();return t?{type:"MultiPolygon",coordinates:t}:null}()||function(){var t,e=[];if(!a(/^(geometrycollection)/i))return null;if(u(),!a(/^(\()/))return null;for(;t=c();)e.push(t),u(),a(/^(,)/),u();return a(/^(\))/)?{type:"GeometryCollection",geometries:e}:null}()}return(e=c())&&i.match(/\d+/)&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+i}}),e}},function(t,e,n){"use strict";n.r(e),n.d(e,"Directions",(function(){return y})); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=1)}([function(t,e){t.exports=o,t.exports.parse=o,t.exports.stringify=function t(e){"Feature"===e.type&&(e=e.geometry);function n(t){return t.join(" ")}function r(t){return t.map(n).join(", ")}function o(t){return t.map(r).map(i).join(", ")}function i(t){return"("+t+")"}switch(e.type){case"Point":return"POINT ("+n(e.coordinates)+")";case"LineString":return"LINESTRING ("+r(e.coordinates)+")";case"Polygon":return"POLYGON ("+o(e.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+r(e.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+(e.coordinates.map(o).map(i).join(", ")+")");case"MultiLineString":return"MULTILINESTRING ("+o(e.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+e.geometries.map(t).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}};var n=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,r=new RegExp("^"+n.source+"(\\s"+n.source+"){1,}");function o(t){var e,n=t.split(";"),o=n.pop(),i=(n.shift()||"").split("=").pop(),s=0;function a(t){var e=o.substring(s).match(t);return e?(s+=e[0].length,e[0]):null}function u(){a(/^\s*/)}function l(){u();for(var t,e=0,n=[],o=[n],i=n;t=a(/^(\()/)||a(/^(\))/)||a(/^(,)/)||a(r);){if("("===t)o.push(i),i=[],o[o.length-1].push(i),e++;else if(")"===t){if(0===i.length)return null;if(!(i=o.pop()))return null;if(0===--e)break}else if(","===t)i=[],o[o.length-1].push(i);else{if(t.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,t.split(/\s/g).map(parseFloat))}u()}return 0!==e?null:n}function p(){for(var t,e,n=[];e=a(r)||a(/^(,)/);)","===e?(n.push(t),t=[]):e.split(/\s/g).some(isNaN)||(t||(t=[]),Array.prototype.push.apply(t,e.split(/\s/g).map(parseFloat))),u();return t?(n.push(t),n.length?n:null):null}function c(){return function(){if(!a(/^(point(\sz)?)/i))return null;if(u(),!a(/^(\()/))return null;var t=p();return t?(u(),a(/^(\))/)?{type:"Point",coordinates:t[0]}:null):null}()||function(){if(!a(/^(linestring(\sz)?)/i))return null;if(u(),!a(/^(\()/))return null;var t=p();return t&&a(/^(\))/)?{type:"LineString",coordinates:t}:null}()||function(){if(!a(/^(polygon(\sz)?)/i))return null;u();var t=l();return t?{type:"Polygon",coordinates:t}:null}()||function(){if(!a(/^(multipoint)/i))return null;u();var t=o.substring(o.indexOf("(")+1,o.length-1).replace(/\(/g,"").replace(/\)/g,"");o="MULTIPOINT ("+t+")";var e=l();return e?(u(),{type:"MultiPoint",coordinates:e}):null}()||function(){if(!a(/^(multilinestring)/i))return null;u();var t=l();return t?(u(),{type:"MultiLineString",coordinates:t}):null}()||function(){if(!a(/^(multipolygon)/i))return null;u();var t=l();return t?{type:"MultiPolygon",coordinates:t}:null}()||function(){var t,e=[];if(!a(/^(geometrycollection)/i))return null;if(u(),!a(/^(\()/))return null;for(;t=c();)e.push(t),u(),a(/^(,)/),u();return a(/^(\))/)?{type:"GeometryCollection",geometries:e}:null}()}return(e=c())&&i.match(/\d+/)&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+i}}),e}},function(t,e,n){"use strict";n.r(e),n.d(e,"Directions",(function(){return g})); | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
***************************************************************************** */ | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=0,i=1,s={fast:"#22aa01",normal:"#ffc402",slow:"#f72000","slow-jams":"#81020d","no-traffic":"#0f6ec1",ignore:"#0f6ec1",pedestrian:"#626262","pedestrian-underground":"#626262",inactive:"#b4bcd2",border:"#ffffff",border2:"#ff141414",hovered:"#000000"},a={size:[22,22],offset:[11,11],img:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCAyMiAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBmaWxsLW9wYWNpdHk9IjAuMTUiIGQ9Ik0xMSAyMkMxNy4wNzUxIDIyIDIyIDE3LjA3NTEgMjIgMTFDMjIgNC45MjQ4NyAxNy4wNzUxIDAgMTEgMEM0LjkyNDg3IDAgMCA0LjkyNDg3IDAgMTFDMCAxNy4wNzUxIDQuOTI0ODcgMjIgMTEgMjJaIi8+CiAgPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTExIDIxQzE2LjUyMjggMjEgMjEgMTYuNTIyOCAyMSAxMUMyMSA1LjQ3NzE1IDE2LjUyMjggMSAxMSAxQzUuNDc3MTUgMSAxIDUuNDc3MTUgMSAxMUMxIDE2LjUyMjggNS40NzcxNSAyMSAxMSAyMVoiLz4KICA8cGF0aCBmaWxsPSIjMGY2ZWMxIiBkPSJNMTEgMTlDMTUuNDE4MyAxOSAxOSAxNS40MTgzIDE5IDExQzE5IDYuNTgxNzIgMTUuNDE4MyAzIDExIDNDNi41ODE3MiAzIDMgNi41ODE3MiAzIDExQzMgMTUuNDE4MyA2LjU4MTcyIDE5IDExIDE5WiIvPgo8L3N2Zz4K"},u=14,l="#ffffff";function p(t){switch(t){case"fast":case"normal":case"slow":case"slow-jams":case"no-traffic":return t;default:return"ignore"}}function c(t){return t.map((function(e,n){var r=String(n);return 0===n&&(r="A"),n===t.length-1&&(r="B"),{position:e,label:{text:r,fontSize:u,color:l},icon:a}}))}var f=n(0),d=function(){function t(t,e){this.map=t,this.settings=e,this.polylines=[],this.markers=[],this.nextPolylinePhase=o,this.nextPointPhase=i}return t.prototype.draw=function(t){this.drawPoints(t.points),this.drawRoutes(t.routes,t.activeRouteId)},t.prototype.clear=function(){this.draw({routes:[],points:[]})},t.prototype.drawPoints=function(t){for(var e=0,n=this.markers;e<n.length;e++){(l=n[e]).destroy()}this.markers=[],this.nextPointPhase=i;for(var r=0;r<t.length;r++){var o=t[r],s=o.position,a=o.label,u=o.icon,l=new mapgl.Marker(this.map,{coordinates:s,icon:u.img,size:u.size,anchor:u.offset,zIndex:this.getNextPointPhase(),label:{text:a.text,fontSize:a.fontSize,color:a.color,anchor:[0,0],zIndex:this.getNextPointPhase(),haloRadius:0,haloColor:"#ffffff",letterSpacing:0,lineHeight:1.2,minZoom:NaN,maxZoom:NaN}});this.markers.push(l)}},t.prototype.drawRoutes=function(t,e){for(var n=0,r=this.polylines;n<r.length;n++){r[n].polyline.destroy()}var i;this.polylines=[],this.nextPolylinePhase=o;for(var s=0,a=t;s<a.length;s++){var u=a[s];u.id===e?i=u:this.drawRoute(u,!1)}i&&this.drawRoute(i,!0)},t.prototype.drawRoute=function(t,e){for(var n=t.id,r=t.sections,o=this.getNextPolylinePhase(),i=this.getNextPolylinePhase(),s=0,a=r;s<a.length;s++){var u=a[s],l=Object(f.parse)(u.geometry);if(l){var p=l.coordinates,c=this.settings.lineStyles,d=void 0!==c[u.type]?u.type:"inactive",h=e?d:"inactive",y=c[h],g=y.color,m=y.borderColor,M=y.border2Color,v=new mapgl.Polyline(this.map,{coordinates:p,zIndex:this.getNextPolylinePhase(),zIndex2:i,zIndex3:o,color:g,color2:m,color3:M,width:10.5,width2:21.5,width3:23.1,interactive:!0,maxZoom:NaN,minZoom:NaN});this.polylines.push({routeId:n,type:h,polyline:v})}}},t.prototype.getNextPolylinePhase=function(){return this.nextPolylinePhase+=1e-6},t.prototype.getNextPointPhase=function(){return this.nextPointPhase+=1e-6},t}(),h=function(t,e){return{color:e[t],hoveredColor:e.hovered,borderColor:e.border,hoveredBorderColor:e.border,border2Color:e.border2,hoveredBorder2Color:e.border2}},y=function(t){function e(e,n){var r=t.call(this)||this;r.map=e,r.options=n;var o,i={lineStyles:{normal:h("normal",o=s),fast:h("fast",o),ignore:h("ignore",o),"no-traffic":h("no-traffic",o),slow:h("slow",o),"slow-jams":h("slow-jams",o),pedestrian:h("pedestrian",o),"pedestrian-underground":h("pedestrian-underground",o),inactive:h("inactive",o)}};return r.ppnaDrawer=new d(r.map,i),r}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.clear=function(){this.ppnaDrawer.clear(),this.map.setStyleOptions({traffic:!1})},e.prototype.carRoute=function(t){var e=t.points;return this.findAndDrawRoute({type:"jam",points:e})},e.prototype.pedestrianRoute=function(t){var e=t.points;return this.findAndDrawRoute({type:"pedestrian",points:e})},e.prototype.findAndDrawRoute=function(t){var e=this,n=t.points,r=t.type;if(n.length<2)throw new Error("At least two points are required");var o={type:r,point_a_name:"Source",point_b_name:"Target",locale:"en",points:n.map((function(t,e){return{x:t[0],y:t[1],type:0===e||e===n.length-1?"pedo":"pref"}}))};return fetch("https://catalog.api.2gis.ru/carrouting/6.0.0/global?key="+this.options.directionsApiKey,{method:"post",body:JSON.stringify(o)}).then((function(t){if(200!==t.status)throw new Error("HTTP code is "+t.status);return t.json()})).then((function(n){e.emit("directionsLoaded",{routes:n.result||[]}),e.drawRoute(n.result||[],t.points)}))},e.prototype.drawRoute=function(t,e){var n=function(t,e){var n=[];return e.forEach((function(e){var r={id:e.id,sections:[]};e.begin_pedestrian_path&&r.sections.push({type:"pedestrian",geometry:e.begin_pedestrian_path.geometry.selection}),(e.maneuvers||[]).forEach((function(e){var n=e.outcoming_path&&e.outcoming_path.geometry;n&&n.forEach((function(e){r.sections.push({type:"pedestrian"!==t?p(e.color):"pedestrian",geometry:e.selection})}))})),e.end_pedestrian_path&&r.sections.push({type:"pedestrian",geometry:e.end_pedestrian_path.geometry.selection}),n.push(r)})),n}("ppna",t)[0];this.map.setStyleOptions({traffic:!0}),this.ppnaDrawer.draw({routes:[n],points:c(e),activeRouteId:n.id})},e}(function(){function t(){this.events={}}return t.prototype.on=function(t,e){var n=this.events[t];return n||(n=this.events[t]=[]),n.push(e),this},t.prototype.once=function(t,e){var n=this,r=function(o){n.off(t,r),e.call(n,o)};return this.on(t,r),this},t.prototype.off=function(t,e){var n=this.events[t];if(!n)return this;var r=n.indexOf(e);return-1!==r&&n.splice(r,1),this},t.prototype.emit=function(t,e){var n=this.events[t];if(!n)return this;for(var r=n.slice(),o=0;o<r.length;o++)r[o].call(this,e);return this},t}());"mapgl"in window?mapgl.Directions=y:console.error("Looks like you did not load MapGL API correctly")}])})); | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var i=0,s=1,a={fast:"#22aa01",normal:"#ffc402",slow:"#f72000","slow-jams":"#81020d","no-traffic":"#0f6ec1",ignore:"#0f6ec1",pedestrian:"#626262","pedestrian-underground":"#626262",inactive:"#b4bcd2",border:"#ffffff",border2:"#ff141414",hovered:"#000000"},u={size:[22,22],offset:[11,11],img:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCAyMiAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBmaWxsLW9wYWNpdHk9IjAuMTUiIGQ9Ik0xMSAyMkMxNy4wNzUxIDIyIDIyIDE3LjA3NTEgMjIgMTFDMjIgNC45MjQ4NyAxNy4wNzUxIDAgMTEgMEM0LjkyNDg3IDAgMCA0LjkyNDg3IDAgMTFDMCAxNy4wNzUxIDQuOTI0ODcgMjIgMTEgMjJaIi8+CiAgPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTExIDIxQzE2LjUyMjggMjEgMjEgMTYuNTIyOCAyMSAxMUMyMSA1LjQ3NzE1IDE2LjUyMjggMSAxMSAxQzUuNDc3MTUgMSAxIDUuNDc3MTUgMSAxMUMxIDE2LjUyMjggNS40NzcxNSAyMSAxMSAyMVoiLz4KICA8cGF0aCBmaWxsPSIjMGY2ZWMxIiBkPSJNMTEgMTlDMTUuNDE4MyAxOSAxOSAxNS40MTgzIDE5IDExQzE5IDYuNTgxNzIgMTUuNDE4MyAzIDExIDNDNi41ODE3MiAzIDMgNi41ODE3MiAzIDExQzMgMTUuNDE4MyA2LjU4MTcyIDE5IDExIDE5WiIvPgo8L3N2Zz4K"},l=14,p="#ffffff";function c(t){switch(t){case"fast":case"normal":case"slow":case"slow-jams":case"no-traffic":return t;default:return"ignore"}}function f(t){return t.map((function(e,n){var r=String(n);return 0===n&&(r="A"),n===t.length-1&&(r="B"),{position:e,label:{text:r,fontSize:l,color:p},icon:u}}))}var d=n(0),y=function(){function t(t,e){this.defaultStyle={routeLineWidth:10.5,substrateLineWidth:21.5,galoLineWidth:23.1},this.map=t,this.settings=e,this.polylines=[],this.markers=[],this.nextPolylinePhase=i,this.nextPointPhase=s}return t.prototype.draw=function(t){this.drawPoints(t.points),this.drawRoutes(t.routes,t.activeRouteId,t.style)},t.prototype.clear=function(){this.draw({routes:[],points:[]})},t.prototype.drawPoints=function(t){for(var e=0,n=this.markers;e<n.length;e++){(l=n[e]).destroy()}this.markers=[],this.nextPointPhase=s;for(var r=0;r<t.length;r++){var o=t[r],i=o.position,a=o.label,u=o.icon,l=new mapgl.Marker(this.map,{coordinates:i,icon:u.img,size:u.size,anchor:u.offset,zIndex:this.getNextPointPhase(),label:{text:a.text,fontSize:a.fontSize,color:a.color,anchor:[0,0],zIndex:this.getNextPointPhase(),haloRadius:0,haloColor:"#ffffff",letterSpacing:0,lineHeight:1.2,minZoom:NaN,maxZoom:NaN}});this.markers.push(l)}},t.prototype.drawRoutes=function(t,e,n){for(var r=0,s=this.polylines;r<s.length;r++){s[r].polyline.destroy()}this.polylines=[],this.nextPolylinePhase=i;for(var a,u=o(o({},this.defaultStyle),n),l=0,p=t;l<p.length;l++){var c=p[l];c.id===e?a=c:this.drawRoute(c,!1,u)}a&&this.drawRoute(a,!0,u)},t.prototype.drawRoute=function(t,e,n){for(var r=t.id,o=t.sections,i=this.getNextPolylinePhase(),s=this.getNextPolylinePhase(),a=0,u=o;a<u.length;a++){var l=u[a],p=Object(d.parse)(l.geometry);if(p){var c=p.coordinates,f=this.settings.lineStyles,y=void 0!==f[l.type]?l.type:"inactive",h=e?y:"inactive",g=f[h],m=g.color,M=g.borderColor,v=g.border2Color,I=new mapgl.Polyline(this.map,{coordinates:c,zIndex:this.getNextPolylinePhase(),zIndex2:s,zIndex3:i,color:m,color2:M,color3:v,width:n.routeLineWidth,width2:n.substrateLineWidth,width3:n.galoLineWidth,interactive:!0,maxZoom:NaN,minZoom:NaN});this.polylines.push({routeId:r,type:h,polyline:I})}}},t.prototype.getNextPolylinePhase=function(){return this.nextPolylinePhase+=1e-6},t.prototype.getNextPointPhase=function(){return this.nextPointPhase+=1e-6},t}(),h=function(t,e){return{color:e[t],hoveredColor:e.hovered,borderColor:e.border,hoveredBorderColor:e.border,border2Color:e.border2,hoveredBorder2Color:e.border2}},g=function(t){function e(e,n){var r=t.call(this)||this;r.map=e,r.options=n;var o,i={lineStyles:{normal:h("normal",o=a),fast:h("fast",o),ignore:h("ignore",o),"no-traffic":h("no-traffic",o),slow:h("slow",o),"slow-jams":h("slow-jams",o),pedestrian:h("pedestrian",o),"pedestrian-underground":h("pedestrian-underground",o),inactive:h("inactive",o)}};return r.ppnaDrawer=new y(r.map,i),r}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.clear=function(){this.ppnaDrawer.clear(),this.map.setStyleOptions({traffic:!1})},e.prototype.carRoute=function(t){var e=t.points,n=t.style;return this.findAndDrawRoute({type:"jam",points:e,style:n})},e.prototype.pedestrianRoute=function(t){var e=t.points,n=t.style;return this.findAndDrawRoute({type:"pedestrian",points:e,style:n})},e.prototype.findAndDrawRoute=function(t){var e=this,n=t.points,r=t.type,o=t.style;if(n.length<2)throw new Error("At least two points are required");var i={type:r,point_a_name:"Source",point_b_name:"Target",locale:"en",points:n.map((function(t,e){return{x:t[0],y:t[1],type:0===e||e===n.length-1?"pedo":"pref"}}))};return fetch("https://catalog.api.2gis.ru/carrouting/6.0.0/global?key="+this.options.directionsApiKey,{method:"post",body:JSON.stringify(i)}).then((function(t){if(200!==t.status)throw new Error("HTTP code is "+t.status);return t.json()})).then((function(n){e.emit("directionsLoaded",{routes:n.result||[]}),e.drawRoute(n.result||[],t.points,o)}))},e.prototype.drawRoute=function(t,e,n){var r=function(t,e){var n=[];return e.forEach((function(e){var r={id:e.id,sections:[]};e.begin_pedestrian_path&&r.sections.push({type:"pedestrian",geometry:e.begin_pedestrian_path.geometry.selection}),(e.maneuvers||[]).forEach((function(e){var n=e.outcoming_path&&e.outcoming_path.geometry;n&&n.forEach((function(e){r.sections.push({type:"pedestrian"!==t?c(e.color):"pedestrian",geometry:e.selection})}))})),e.end_pedestrian_path&&r.sections.push({type:"pedestrian",geometry:e.end_pedestrian_path.geometry.selection}),n.push(r)})),n}("ppna",t)[0];this.map.setStyleOptions({traffic:!0}),this.ppnaDrawer.draw({routes:[r],points:f(e),activeRouteId:r.id,style:n})},e}(function(){function t(){this.events={}}return t.prototype.on=function(t,e){var n=this.events[t];return n||(n=this.events[t]=[]),n.push(e),this},t.prototype.once=function(t,e){var n=this,r=function(o){n.off(t,r),e.call(n,o)};return this.on(t,r),this},t.prototype.off=function(t,e){var n=this.events[t];if(!n)return this;var r=n.indexOf(e);return-1!==r&&n.splice(r,1),this},t.prototype.emit=function(t,e){var n=this.events[t];if(!n)return this;for(var r=n.slice(),o=0;o<r.length;o++)r[o].call(this,e);return this},t}());"mapgl"in window?mapgl.Directions=g:console.error("Looks like you did not load MapGL API correctly")}])})); |
@@ -1,1 +0,1 @@ | ||
{"typescript":{"Evented":{"documentation":{"contents":["<p>Event emitter</p>\n"],"contentsRaw":"Event emitter","metadata":{}},"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Evented","methods":[{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"M[K]"}],"returnType":"this","type":"(type: K, data?: M[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"fileName":"src/evented.ts","kind":"signature","name":"new Evented","parameters":[],"returnType":"Evented","type":"() => Evented"}]}},"Directions":{"documentation":{"contents":["<p>A class that provides driving direction functionality.</p>\n"],"contentsRaw":"A class that provides driving direction functionality.","metadata":{}},"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Directions","extends":["Evented<DirectionsEventTable>"],"methods":[{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"carRoute","signatures":[{"documentation":{"contents":["<p>Finds and draws an optimal car route.</p>\n"],"contentsRaw":"Finds and draws an optimal car route.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"carRoute","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"CarRouteOptions"}],"returnType":"Promise<void>","type":"(options: CarRouteOptions) => Promise<void>"}]},{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"clear","signatures":[{"documentation":{"contents":["<p>Clears the map from any previously drawn routes.</p>\n"],"contentsRaw":"Clears the map from any previously drawn routes.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"clear","parameters":[],"returnType":"void","type":"() => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","inheritedFrom":"Evented.emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"DirectionsEventTable[K]"}],"returnType":"this","type":"(type: K, data?: DirectionsEventTable[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","inheritedFrom":"Evented.off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","inheritedFrom":"Evented.on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","inheritedFrom":"Evented.once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"pedestrianRoute","signatures":[{"documentation":{"contents":["<p>Finds and draws an optimal pedestrian route.</p>\n"],"contentsRaw":"Finds and draws an optimal pedestrian route.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"pedestrianRoute","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"PedestrianRouteOptions"}],"returnType":"Promise<void>","type":"(options: PedestrianRouteOptions) => Promise<void>"}]}],"properties":[],"accessors":[],"constructorType":{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});\n```","metadata":{}},"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});\n```","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"new Directions","parameters":[{"documentation":{"contents":["<p>The map instance.</p>\n"],"contentsRaw":"The map instance.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"map","type":"mapgl.Map"},{"documentation":{"contents":["<p>Directions initialization options.</p>\n"],"contentsRaw":"Directions initialization options.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"DirectionsOptions"}],"returnType":"Directions","type":"(map: mapgl.Map, options: DirectionsOptions) => Directions"}]}},"DirectionResult":{"documentation":{"contents":["<p>Result of search for car or pedestrian routing direction.</p>\n"],"contentsRaw":"Result of search for car or pedestrian routing direction.","metadata":{}},"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionResult","extends":["DirectionBase"],"methods":[],"properties":[{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"algorithm","type":"undefined | string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"begin_pedestrian_path","type":"PedestrianPath"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"end_pedestrian_path","type":"PedestrianPath"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"filter_road_types","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"id","inheritedFrom":"DirectionBase.id","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"maneuvers","type":"Maneuver[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"requested_filters","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"result_filters","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"route_id","inheritedFrom":"DirectionBase.route_id","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"total_distance","type":"number"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"total_duration","inheritedFrom":"DirectionBase.total_duration","type":"number"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"carrouting\" | \"pedestrianrouting\""},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"ui_total_distance","type":"UITotalDistance"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"ui_total_duration","inheritedFrom":"DirectionBase.ui_total_duration","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"waypoints","type":"WayPoint[]"}]},"UITotalDistance":{"documentation":{"contents":["<p>UI total distance presentation</p>\n"],"contentsRaw":"UI total distance presentation","metadata":{}},"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"UITotalDistance","methods":[],"properties":[{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"unit","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"value","type":"string"}]},"DirectionsOptions":{"documentation":{"contents":["<p>Directions initialization options.</p>\n"],"contentsRaw":"Directions initialization options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Directions API access key.</p>\n"],"contentsRaw":"Directions API access key.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"directionsApiKey","type":"string"}]},"CarRouteOptions":{"documentation":{"contents":["<p>Car route method options.</p>\n"],"contentsRaw":"Car route method options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"CarRouteOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Array of geographical points [longitude, latitude].</p>\n<p>You can set up to 10 points.</p>\n"],"contentsRaw":"Array of geographical points [longitude, latitude].\n\nYou can set up to 10 points.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"points","type":"Point[]"}]},"PedestrianRouteOptions":{"documentation":{"contents":["<p>Pedestrian route method options.</p>\n"],"contentsRaw":"Pedestrian route method options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"PedestrianRouteOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Array of geographical points [longitude, latitude].</p>\n<p>You can set up to 10 points.</p>\n"],"contentsRaw":"Array of geographical points [longitude, latitude].\n\nYou can set up to 10 points.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"points","type":"Point[]"}]},"DirectionsEventTable":{"documentation":{"contents":["<p>The list of events that can be emitted by a Directions instance.</p>\n"],"contentsRaw":"The list of events that can be emitted by a Directions instance.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsEventTable","methods":[],"properties":[{"documentation":{"contents":["<p>Emitted when directions is loaded.</p>\n"],"contentsRaw":"Emitted when directions is loaded.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"directionsLoaded","type":"DirectionsLoadedEvent"}]},"DirectionsLoadedEvent":{"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsLoadedEvent","methods":[],"properties":[{"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"routes","type":"DirectionResult[]"}]},"Point":{"documentation":{"contents":["<p>A geographical point [longitude, latitude].</p>\n"],"contentsRaw":"A geographical point [longitude, latitude].","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"type alias","name":"Point","type":"[number, number] | number[]"}}} | ||
{"typescript":{"Evented":{"documentation":{"contents":["<p>Event emitter</p>\n"],"contentsRaw":"Event emitter","metadata":{}},"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Evented","methods":[{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"M[K]"}],"returnType":"this","type":"(type: K, data?: M[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"fileName":"src/evented.ts","kind":"signature","name":"new Evented","parameters":[],"returnType":"Evented","type":"() => Evented"}]}},"Directions":{"documentation":{"contents":["<p>A class that provides driving direction functionality.</p>\n"],"contentsRaw":"A class that provides driving direction functionality.","metadata":{}},"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Directions","extends":["Evented<DirectionsEventTable>"],"methods":[{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"carRoute","signatures":[{"documentation":{"contents":["<p>Finds and draws an optimal car route.</p>\n"],"contentsRaw":"Finds and draws an optimal car route.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"carRoute","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"CarRouteOptions"}],"returnType":"Promise<void>","type":"(options: CarRouteOptions) => Promise<void>"}]},{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"clear","signatures":[{"documentation":{"contents":["<p>Clears the map from any previously drawn routes.</p>\n"],"contentsRaw":"Clears the map from any previously drawn routes.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"clear","parameters":[],"returnType":"void","type":"() => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","inheritedFrom":"Evented.emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"DirectionsEventTable[K]"}],"returnType":"this","type":"(type: K, data?: DirectionsEventTable[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","inheritedFrom":"Evented.off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","inheritedFrom":"Evented.on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","inheritedFrom":"Evented.once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: DirectionsEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: DirectionsEventTable[K]) => void) => this"}]},{"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"pedestrianRoute","signatures":[{"documentation":{"contents":["<p>Finds and draws an optimal pedestrian route.</p>\n"],"contentsRaw":"Finds and draws an optimal pedestrian route.","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"pedestrianRoute","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"PedestrianRouteOptions"}],"returnType":"Promise<void>","type":"(options: PedestrianRouteOptions) => Promise<void>"}]}],"properties":[],"accessors":[],"constructorType":{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});\n```","metadata":{}},"fileName":"src/directions.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst directions = new mapgl.Directions(map, {\n directionsApiKey: 'Your Directions API access key',\n});\n\ndirections.carRoute({\n points: [\n [55.2772379, 25.2377810],\n [55.2986956, 25.2576546],\n ],\n});\n```","metadata":{}},"fileName":"src/directions.ts","kind":"signature","name":"new Directions","parameters":[{"documentation":{"contents":["<p>The map instance.</p>\n"],"contentsRaw":"The map instance.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"map","type":"mapgl.Map"},{"documentation":{"contents":["<p>Directions initialization options.</p>\n"],"contentsRaw":"Directions initialization options.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"options","type":"DirectionsOptions"}],"returnType":"Directions","type":"(map: mapgl.Map, options: DirectionsOptions) => Directions"}]}},"RouteStyle":{"fileName":"src/types/styles.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"RouteStyle","methods":[],"properties":[{"documentation":{"contents":["<p>Route galo width. Will be rendered under substrate</p>\n"],"contentsRaw":"Route galo width. Will be rendered under substrate","metadata":{}},"fileName":"src/types/styles.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"galoLineWidth","type":"number | InterpolateExpression"},{"documentation":{"contents":["<p>Route line width, represents route</p>\n"],"contentsRaw":"Route line width, represents route","metadata":{}},"fileName":"src/types/styles.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"routeLineWidth","type":"number | InterpolateExpression"},{"documentation":{"contents":["<p>Route substrate width. Will be rendered under route</p>\n"],"contentsRaw":"Route substrate width. Will be rendered under route","metadata":{}},"fileName":"src/types/styles.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"substrateLineWidth","type":"number | InterpolateExpression"}]},"DirectionResult":{"documentation":{"contents":["<p>Result of search for car or pedestrian routing direction.</p>\n"],"contentsRaw":"Result of search for car or pedestrian routing direction.","metadata":{}},"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionResult","extends":["DirectionBase"],"methods":[],"properties":[{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"algorithm","type":"undefined | string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"begin_pedestrian_path","type":"PedestrianPath"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"end_pedestrian_path","type":"PedestrianPath"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"filter_road_types","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"id","inheritedFrom":"DirectionBase.id","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"maneuvers","type":"Maneuver[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"requested_filters","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"result_filters","type":"DirectionRoadType[]"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"route_id","inheritedFrom":"DirectionBase.route_id","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"total_distance","type":"number"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"total_duration","inheritedFrom":"DirectionBase.total_duration","type":"number"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"carrouting\" | \"pedestrianrouting\""},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"ui_total_distance","type":"UITotalDistance"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"ui_total_duration","inheritedFrom":"DirectionBase.ui_total_duration","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"waypoints","type":"WayPoint[]"}]},"UITotalDistance":{"documentation":{"contents":["<p>UI total distance presentation</p>\n"],"contentsRaw":"UI total distance presentation","metadata":{}},"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"UITotalDistance","methods":[],"properties":[{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"unit","type":"string"},{"fileName":"src/types/navi.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"value","type":"string"}]},"DirectionsOptions":{"documentation":{"contents":["<p>Directions initialization options.</p>\n"],"contentsRaw":"Directions initialization options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Directions API access key.</p>\n"],"contentsRaw":"Directions API access key.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"directionsApiKey","type":"string"}]},"CarRouteOptions":{"documentation":{"contents":["<p>Car route method options.</p>\n"],"contentsRaw":"Car route method options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"CarRouteOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Array of geographical points [longitude, latitude].</p>\n<p>You can set up to 10 points.</p>\n"],"contentsRaw":"Array of geographical points [longitude, latitude].\n\nYou can set up to 10 points.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"points","type":"Point[]"},{"documentation":{"contents":["<p>Additional styles for route</p>\n"],"contentsRaw":"Additional styles for route","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"style","type":"RouteStyle"}]},"PedestrianRouteOptions":{"documentation":{"contents":["<p>Pedestrian route method options.</p>\n"],"contentsRaw":"Pedestrian route method options.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"PedestrianRouteOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Array of geographical points [longitude, latitude].</p>\n<p>You can set up to 10 points.</p>\n"],"contentsRaw":"Array of geographical points [longitude, latitude].\n\nYou can set up to 10 points.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"points","type":"Point[]"},{"documentation":{"contents":["<p>Additional styles for route</p>\n"],"contentsRaw":"Additional styles for route","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"style","type":"RouteStyle"}]},"DirectionsEventTable":{"documentation":{"contents":["<p>The list of events that can be emitted by a Directions instance.</p>\n"],"contentsRaw":"The list of events that can be emitted by a Directions instance.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsEventTable","methods":[],"properties":[{"documentation":{"contents":["<p>Emitted when directions is loaded.</p>\n"],"contentsRaw":"Emitted when directions is loaded.","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"directionsLoaded","type":"DirectionsLoadedEvent"}]},"DirectionsLoadedEvent":{"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"DirectionsLoadedEvent","methods":[],"properties":[{"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"routes","type":"DirectionResult[]"}]},"InterpolateExpression":{"documentation":{"contents":[],"contentsRaw":"","metadata":{}},"fileName":"src/types/styles.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"type alias","name":"InterpolateExpression","type":"[\"interpolate\", [\"linear\"] | [\"exponential\", number], [\"zoom\"], number]"},"Point":{"documentation":{"contents":["<p>A geographical point [longitude, latitude].</p>\n"],"contentsRaw":"A geographical point [longitude, latitude].","metadata":{}},"fileName":"src/types/index.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"type alias","name":"Point","type":"[number, number] | number[]"}}} |
import { Directions } from './directions'; | ||
export { Directions }; | ||
export { DirectionsOptions, CarRouteOptions, PedestrianRouteOptions, DirectionsLoadedEvent, } from './types'; | ||
export { RouteStyle, InterpolateExpression } from './types/styles'; | ||
export { DirectionResult } from './types/navi'; |
@@ -14,2 +14,3 @@ import { Ppna } from './types/ppnaDrawer'; | ||
private nextPointPhase; | ||
private defaultStyle; | ||
constructor(map: mapgl.Map, config: PpnaSettings); | ||
@@ -16,0 +17,0 @@ draw(ppna: Ppna): void; |
import { DirectionResult } from './navi'; | ||
import { RouteStyle } from './styles'; | ||
/** | ||
@@ -25,2 +26,6 @@ * A geographical point [longitude, latitude]. | ||
points: Point[]; | ||
/** | ||
* Additional styles for route | ||
*/ | ||
style?: RouteStyle; | ||
} | ||
@@ -37,2 +42,6 @@ /** | ||
points: Point[]; | ||
/** | ||
* Additional styles for route | ||
*/ | ||
style?: RouteStyle; | ||
} | ||
@@ -46,2 +55,3 @@ /** | ||
points: Point[]; | ||
style?: RouteStyle; | ||
} | ||
@@ -48,0 +58,0 @@ /** |
import { PpnaRoute } from './formatters'; | ||
import { RouteStyle } from './styles'; | ||
/** | ||
@@ -43,3 +44,4 @@ * @hidden | ||
hoveredRouteId?: string; | ||
style?: RouteStyle; | ||
} | ||
export {}; |
@@ -44,2 +44,20 @@ import { SectionType } from './formatters'; | ||
}; | ||
export interface RouteStyle { | ||
/** | ||
* Route line width, represents route | ||
*/ | ||
routeLineWidth?: number | InterpolateExpression; | ||
/** | ||
* Route substrate width. Will be rendered under route | ||
*/ | ||
substrateLineWidth?: number | InterpolateExpression; | ||
/** | ||
* Route galo width. Will be rendered under substrate | ||
*/ | ||
galoLineWidth?: number | InterpolateExpression; | ||
} | ||
/** | ||
* | ||
*/ | ||
export declare type InterpolateExpression = ['interpolate', ['linear'] | ['exponential', number], ['zoom'], ...number[]]; | ||
export {}; |
{ | ||
"name": "@2gis/mapgl-directions", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Driving directions plugin for Mapgl", | ||
@@ -25,4 +25,4 @@ "main": "dist/directions.js", | ||
"devDependencies": { | ||
"@2gis/mapgl": "1.10.0", | ||
"@documentalist/compiler": "^2.8.1", | ||
"@webmaps/jakarta": "16.1.0", | ||
"fork-ts-checker-webpack-plugin": "^4.1.4", | ||
@@ -29,0 +29,0 @@ "prettier": "^2.0.5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56388
563