JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://maps.google.com/maps/api/js?sensor=false&amp;.js"></script>
<div id="map_canvas" style="height:400px; width:400px"></div>

JavaScript

var map;
var polyline;

var markers = [
    new google.maps.LatLng(17.43495, 78.50898333),
    new google.maps.LatLng(17.43495, 78.50898333),
    new google.maps.LatLng(17.43938333, 78.52168333),
    new google.maps.LatLng(17.43708333, 78.52925),
    new google.maps.LatLng(17.4366, 78.53336667)
    ];

function init() {
    var moptions = {
        center: new google.maps.LatLng(17.43938333, 78.52168333),
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }

    map = new google.maps.Map(document.getElementById("map_canvas"), moptions);

    var iconsetngs = {
        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW
    };
    var polylineoptns = {
        strokeOpacity: 0.8,
        strokeWeight: 3,
        map: map,
        icons: [{
            repeat: '70px', //CHANGE THIS VALUE TO CHANGE THE DISTANCE BETWEEN ARROWS
            icon: iconsetngs,
            offset: '100%'}]
    };
    polyline = new google.maps.Polyline(polylineoptns);
    var z = 0;
    var path = [];
    path[z] = polyline.getPath();
    for (var i = 0; i < markers.length; i++) //LOOP TO DISPLAY THE MARKERS
    {
        var pos = markers[i];
        var marker = new google.maps.Marker({
            position: pos,
            map: map
        });
        path[z].push(marker.getPosition()); //PUSH THE NEWLY CREATED MARKER'S POSITION TO THE PATH ARRAY
    }
}
window.onload = init;