@@ -30,8 +30,8 @@ export default class Map {
3030
3131 /**
3232 * Use this to initialize map
33- * @param {InlogMaps.MapType } mapType
34- * @param {any } options
33+ * @param {InlogMaps.MapType } mapType
34+ * @param {any } options
3535 * @param {string } elementId default: 'inlog-map' [nullable]
3636 * @returns {Promisse<any> }
3737 */
@@ -199,7 +199,7 @@ export default class Map {
199199
200200 /**
201201 * This functions returns if marker exists
202- * @param type
202+ * @param type
203203 * @param condition [nullable]
204204 * @returns {boolean }
205205 */
@@ -210,9 +210,9 @@ export default class Map {
210210
211211 /**
212212 * Use this function to count markers by type
213- * @param {string } type
213+ * @param {string } type
214214 * @param {boolean } onlyOnMap exclude hidden markers, default true
215- * @param {any } condition
215+ * @param {any } condition
216216 * @returns {number }
217217 */
218218 public countMarkers ( type : string , onlyOnMap : boolean = true , condition ?: any ) : number {
@@ -230,9 +230,9 @@ export default class Map {
230230
231231 /**
232232 * This function add new events on marker
233- * @param {string } type
234- * @param {InlogMaps.MarkerEventType } event
235- * @param {any } eventFunction
233+ * @param {string } type
234+ * @param {InlogMaps.MarkerEventType } event
235+ * @param {any } eventFunction
236236 * @param {any } condition [nullable]
237237 */
238238 public addMarkerEvent ( type : string , event : MarkerEventType , eventFunction : any , condition ?: any ) : void {
@@ -243,8 +243,8 @@ export default class Map {
243243
244244 /**
245245 * This function remove events of marker
246- * @param {string } type
247- * @param {InlogMaps.MarkerEventType } event
246+ * @param {string } type
247+ * @param {InlogMaps.MarkerEventType } event
248248 * @param {any } condition [nullable]
249249 */
250250 public removeMarkerEvent ( type : string , event : MarkerEventType , condition ?: any ) : void {
@@ -257,7 +257,7 @@ export default class Map {
257257 /**
258258 * Use this function to add MarkerClusterer on the map
259259 * @param {string } type same type of markers
260- * @param {InlogMaps.MarkerClusterConfig } config
260+ * @param {InlogMaps.MarkerClusterConfig } config
261261 */
262262 public addMarkerClusterer ( type : string , config : MarkerClustererConfig ) : void {
263263 this . markerClusterer [ type ] = this . map . addMarkerClusterer ( config ) ;
@@ -266,7 +266,7 @@ export default class Map {
266266 /**
267267 * Use this function to alter clusterer options
268268 * @param type same type of markers
269- * @param {InlogMaps.MarkerClusterConfig } config
269+ * @param {InlogMaps.MarkerClusterConfig } config
270270 */
271271 public alterMarkerClustererConfig ( type : string , config : MarkerClustererConfig ) : void {
272272 if ( this . markerClusterer [ type ] ) {
@@ -394,7 +394,7 @@ export default class Map {
394394
395395 /**
396396 * This functions returns if polygon exists
397- * @param type
397+ * @param type
398398 * @param condition [nullable]
399399 * @returns {boolean }
400400 */
@@ -405,9 +405,9 @@ export default class Map {
405405
406406 /**
407407 * This function add new events on polygon
408- * @param {string } type
409- * @param {InlogMaps.PolygonEventType } event
410- * @param {any } eventFunction
408+ * @param {string } type
409+ * @param {InlogMaps.PolygonEventType } event
410+ * @param {any } eventFunction
411411 * @param {any } condition [nullable]
412412 */
413413 public addPolygonEvent ( type : string , event : PolygonEventType , eventFunction : any , condition ?: any ) : void {
@@ -418,8 +418,8 @@ export default class Map {
418418
419419 /**
420420 * This function remove events of polygon
421- * @param {string } type
422- * @param {InlogMaps.PolygonEventType } event
421+ * @param {string } type
422+ * @param {InlogMaps.PolygonEventType } event
423423 * @param {any } condition [nullable]
424424 */
425425 public removePolygonEvent ( type : string , event : PolygonEventType , condition ?: any ) : void {
@@ -514,7 +514,7 @@ export default class Map {
514514
515515 /**
516516 * This functions returns if circle exists
517- * @param {string } type
517+ * @param {string } type
518518 * @param {any } condition [nullable]
519519 * @returns {boolean }
520520 */
@@ -525,7 +525,7 @@ export default class Map {
525525
526526 /**
527527 * This function return circle center
528- * @param {string } type
528+ * @param {string } type
529529 * @param {any } condition [nullable]
530530 * @returns {number[] }
531531 */
@@ -541,9 +541,9 @@ export default class Map {
541541
542542 /**
543543 * This function add new events on circle
544- * @param {string } type
545- * @param {InlogMaps.CircleEventType } event
546- * @param {any } eventFunction
544+ * @param {string } type
545+ * @param {InlogMaps.CircleEventType } event
546+ * @param {any } eventFunction
547547 * @param {any } condition [nullable]
548548 */
549549 public addCircleEvent ( type : string , event : CircleEventType , eventFunction : any , condition ?: any ) : void {
@@ -554,8 +554,8 @@ export default class Map {
554554
555555 /**
556556 * This function remove events of circle
557- * @param {string } type
558- * @param {InlogMaps.CircleEventType } event
557+ * @param {string } type
558+ * @param {InlogMaps.CircleEventType } event
559559 * @param {any } condition [nullable]
560560 */
561561 public removeCircleEvent ( type : string , event : CircleEventType , condition ?: any ) : void {
@@ -610,7 +610,7 @@ export default class Map {
610610
611611 /**
612612 * Use this function to remove polylines
613- * @param {string } type
613+ * @param {string } type
614614 * @param {any } condition remove polyline with the condition [nullable]
615615 */
616616 public removePolylines ( type : string , condition ?: any ) : void {
@@ -637,7 +637,7 @@ export default class Map {
637637 /**
638638 * Use this function to alter polyline options
639639 * @param {string } type
640- * @param {InlogMaps.PolylineOptions } options
640+ * @param {InlogMaps.PolylineOptions } options
641641 * @param {any } condition alter polyline with the condition [nullable]
642642 */
643643 public alterPolylineOptions ( type : string , options : PolylineOptions , condition ?: any ) : void {
@@ -692,6 +692,20 @@ export default class Map {
692692 }
693693 }
694694
695+ /**
696+ * Use this function to get the path of some polyline
697+ * @param {string } type
698+ * @param {any } condition
699+ * @returns {number[] }
700+ */
701+ public getPolylinePath ( type : string , condition ?: any ) : number [ ] {
702+ const polyline = this . getPolylines ( type , condition ) ;
703+
704+ if ( polyline && polyline . length ) {
705+ return this . map . getPolylinePath ( polyline [ 0 ] ) ;
706+ }
707+ }
708+
695709 /**
696710 * Use this function to clear polyline selected from the currentMap
697711 */
@@ -701,9 +715,9 @@ export default class Map {
701715
702716 /**
703717 * Use this function to add listeners on polyline
704- * @param {string } type
705- * @param {InlogMaps.PolylineEventType } event
706- * @param {any } eventFunction
718+ * @param {string } type
719+ * @param {InlogMaps.PolylineEventType } event
720+ * @param {any } eventFunction
707721 * @param {any } condition [nullable]
708722 */
709723 public addPolylineEvent ( type : string , event : PolylineEventType , eventFunction : any , condition ?: any ) : void {
@@ -714,8 +728,8 @@ export default class Map {
714728
715729 /**
716730 * Use this function to remove listeners of polyline
717- * @param {string } type
718- * @param {InlogMaps.PolylineEventType } event
731+ * @param {string } type
732+ * @param {InlogMaps.PolylineEventType } event
719733 * @param {any } condition [nullable]
720734 */
721735 public removePolylineEvent ( type : string , event : PolylineEventType , condition ?: any ) : void {
@@ -726,8 +740,8 @@ export default class Map {
726740
727741 /**
728742 * Use this function to set position of polyline highlight
729- * @param {string } type
730- * @param {number } initialIndex
743+ * @param {string } type
744+ * @param {number } initialIndex
731745 * @param {any } condition [nullable]
732746 */
733747 public setIndexPolylineHighlight ( type : string , initialIndex : number , condition ?: any ) {
@@ -738,6 +752,31 @@ export default class Map {
738752 }
739753 }
740754
755+ /**
756+ *
757+ * @param {string } type
758+ * @param {any } condition
759+ * @returns {object }
760+ */
761+ public getObjectPolyline ( type : string , condition ?: any ) : object {
762+ const polylines = this . getPolylines ( type , condition ) ;
763+
764+ if ( polylines && polylines . length ) {
765+ return this . map . getObjectPolyline ( polylines [ 0 ] ) ;
766+ } else {
767+ return null ;
768+ }
769+ }
770+
771+ /**
772+ * Use this function to add events on polyline highligth / selected polyline
773+ * @param {InlogMaps.PolylineEventType } event
774+ * @param {any } eventFunction
775+ */
776+ public addPolylineHighlightEvent ( event : PolylineEventType , eventFunction : any ) {
777+ this . map . addPolylineHighlightEvent ( event , eventFunction ) ;
778+ }
779+
741780 /* Info Windows */
742781 /**
743782 * Use this function to draw popups on the currentMap
@@ -780,8 +819,8 @@ export default class Map {
780819 }
781820
782821 /**
783- *
784- * @param {string } type
822+ *
823+ * @param {string } type
785824 * @returns {object }
786825 */
787826 public getObjectOpenPopup ( type : string ) : object {
@@ -867,8 +906,8 @@ export default class Map {
867906
868907 /**
869908 * Returns the coordinates from pixels
870- * @param {number } offsetx
871- * @param {number } offsety
909+ * @param {number } offsetx
910+ * @param {number } offsety
872911 * @returns {number[] }
873912 */
874913 public pixelsToLatLng ( offsetx : number , offsety : number ) : number [ ] {
0 commit comments