HOME BLOG

MAPAS API

Galeria de exemplos: Alterar o estilo da linha (polyline)

Este exemplo demonstra como poderĂ¡ alterar o estilo da linha (polyline).

			<html>
				<head>
					<title>Polyline Custom Style</title>
					<script type="text/javascript" src="http://js.sapo.pt/Bundles/SAPOMapsAPI.js"></script>
					<script type='text/javascript'>
						
						function init() { 
							var map = new SAPO.Maps.Map('mapDiv');
							
							var polyline = new SAPO.Maps.Polyline([new OpenLayers.LonLat(-9, 38),
															  new OpenLayers.LonLat(-8, 38),
															  new OpenLayers.LonLat(-9, 39),
															  new OpenLayers.LonLat(-9, 37)
														     ], 
														     {
														   		strokeColor: '#000000',
																strokeOpacity: 1,
																strokeWidth: 6,
																strokeDashstyle: 'dot'
														     });
							map.addOverlay(polyline);
						}
						
					</script>
				</head>
				<body onload='init();'>
					<div id='mapDiv' style='width:980px; height:400px;'></div>
				</body>
			</html>