function addManueversToMap(route) {
		var svgMarkup =
				'<svg width="18" height="18" ' +
				'xmlns="http://www.w3.org/2000/svg">' +
				'<circle cx="8" cy="8" r="8" ' +
				'fill="#1b468d" stroke="white" stroke-width="1" />' +
				'</svg>',
			dotIcon = new H.map.Icon(svgMarkup, { anchor: { x: 8, y: 8 } }),
			group = new H.map.Group(),
			i,
			j;
		group.id = 'route';
		route.sections.forEach((section) => {
			let poly = H.geo.LineString.fromFlexiblePolyline(
				section.polyline
			).getLatLngAltArray();

			let actions = section.actions;
			// Add a marker for each maneuver
			for (i = 0; i < actions.length; i += 1) {
				let action = actions[i];
				var marker = new H.map.Marker(
					{
						lat: poly[action.offset * 3],
						lng: poly[action.offset * 3 + 1],
					},
					{ icon: dotIcon }
				);
				marker.instruction = action.instruction;
				group.addObject(marker);
			}

			group.addEventListener(
				'tap',
				function (evt) {
					map.setCenter(evt.target.getGeometry());
				},
				false
			);

			// Add the maneuvers group to the map
			map.addObject(group);
		});
	}
// Function to add manuevers to the map
Function to add manuevers to the map
Function to add manuevers to the map
function addManueversToMap(route) {
		var svgMarkup =
				'<svg width="18" height="18" ' +
				'xmlns="http://www.w3.org/2000/svg">' +
				'<circle cx="8" cy="8" r="8" ' +
				'fill="#1b468d" stroke="white" stroke-width="1" />' +
				'</svg>',
			dotIcon = new H.map.Icon(svgMarkup, { anchor: { x: 8, y: 8 } }),
			group = new H.map.Group(),
			i,
			j;
		group.id = 'route';
		route.sections.forEach((section) => {
			let poly = H.geo.LineString.fromFlexiblePolyline(
				section.polyline
			).getLatLngAltArray();
			let actions = section.actions;
			for (i = 0; i < actions.length; i += 1) {
				let action = actions[i];
				var marker = new H.map.Marker(
					{
						lat: poly[action.offset * 3],
						lng: poly[action.offset * 3 + 1],
					},
					{ icon: dotIcon }
				);
				marker.instruction = action.instruction;
				group.addObject(marker);
			}
			group.addEventListener(
				'tap',
				function (evt) {
					map.setCenter(evt.target.getGeometry());
				},
				false
			);
			map.addObject(group);
		});
	}
function addManueversToMap ( route ) { var svgMarkup = '<svg width="18" height="18" ' + 'xmlns="http://www.w3.org/2000/svg">' + '<circle cx="8" cy="8" r="8" ' + 'fill="#1b468d" stroke="white" stroke-width="1" />' + '</svg>' , dotIcon = new H . map . Icon ( svgMarkup , { anchor : { x : 8 , y : 8 } } ) , group = new H . map . Group ( ) , i , j ; group . id = 'route' ; route . sections . forEach ( ( section ) => { let poly = H . geo . LineString . fromFlexiblePolyline ( section . polyline ) . getLatLngAltArray ( ) ; let actions = section . actions ; for ( i = 0 ; i < actions . length ; i += 1 ) { let action = actions [ i ] ; var marker = new H . map . Marker ( { lat : poly [ action . offset * 3 ] , lng : poly [ action . offset * 3 + 1 ] , } , { icon : dotIcon } ) ; marker . instruction = action . instruction ; group . addObject ( marker ) ; } group . addEventListener ( 'tap' , function ( evt ) { map . setCenter ( evt . target . getGeometry ( ) ) ; } , false ) ; map . addObject ( group ) ; } ) ; }
Function to add manuevers to the map
Function to add manuevers to the map
// Add a marker for each maneuver // Add the maneuvers group to the map