Menu
Close

Multi Colored Dashed Polyline

Sample Implementation

    
      
      <html>
        <head>
          <title>Multi Colored Dashed Polyline</title>
          <meta name="viewport" content="initial-scale=1.0">
          <meta charset="utf-8">
          <style>
          html,
          body,
          #map {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100vh;
          }
          </style>
             <script src="https://apis.mappls.com/advancedmaps/api/<Token>/map_sdk?layer=vector&v=3.0&callback=initMap1" defer async></script>
            </head>
        <body>
                    <div id="map"></div>
                    	<script>
		var map,Polyline;
		function initMap1() {
			map = new mappls.Map('map', {
				center: [28.544, 77.5454],
				zoomControl: true,
                location: true
			});
			map.addListener('load', function() {
				Polyline = new mappls.Polyline({
					map: map,
					path: {
						"type": "FeatureCollection",
						"features": [{
								"type": "Feature",
								"properties": {
									"color": "green"
								},
								"geometry": {
									"type": "LineString",
									"coordinates": [
										[28.55101, 77.26872],
										[28.55099, 77.26849],
										[28.55097, 77.26831],
										[28.55093, 77.26794],
										[28.55089, 77.2676],
										[28.55123, 77.26756]
									]
								}
							},
							{
								"type": "Feature",
								"properties": {
									"color": "#F7455D"
								},
								"geometry": {
									"type": "LineString",
									"coordinates": [
										[28.55123, 77.26756],
										[28.55145, 77.26758],
										[28.55168, 77.26758],
										[28.55168, 77.26758],
										[28.55168, 77.26758],
										[28.55172, 77.26759]
									]
								}
							}
						]
					},

					strokeOpacity: 1.0,
					strokeWeight: 9,
					fitbounds: true, // or false
					lineGap: 0,
					fitboundOptions: {
						padding: 120,
						duration: 1000
					},
					popupHtml: "Route 1",
					popupOptions: {
						offset: {
							'bottom': [0, -20]
						}
					},
					dasharray: [2, 2]
				});
			});
		}
	</script>
        </body>
      </html>
      
      
      
    
  
Call at Mappls
Product release

Personalisation SDK, by Mappls, is India's first O2O engagement tool that can 3X your customer engagement, retention and conversion.

Boost your businesses with Mappls’ industry-leading optimisation APIs and SDKs to bring the best and most efficient ways to deliver goods, save time and increase profits.

or