Chce wyświetlić na mapie dwie linie, czerwoną i niebieską. A wyświetla się tylko czerwona. Jak wyświetlić obie linie na jednej mapie..?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript"> function initialize() { var mapDiv = document.getElementById('map-canvas'); var map = new google.maps.Map(mapDiv, { center: new google.maps.LatLng(52.397672,20.920736), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }); var path = [new google.maps.LatLng(52.387913, 20.928782), new google.maps.LatLng(52.392660, 20.921722), new google.maps.LatLng(52.394487, 20.920113), new google.maps.LatLng(52.394672, 20.920736), new google.maps.LatLng(52.396490, 20.919432), new google.maps.LatLng(52.396352, 20.919061), new google.maps.LatLng(52.402482, 20.914325), new google.maps.LatLng(52.403824, 20.916600), new google.maps.LatLng(52.403965, 20.916364), new google.maps.LatLng(52.406272, 20.919384), new google.maps.LatLng(52.402780, 20.926873), new google.maps.LatLng(52.401243, 20.929211)]; var line = new google.maps.Polyline({ path: path, strokeColor: '#0000FF', strokeOpacity: 1.0, strokeWeight: 3 }); line.setMap(map); var image = 'http://code.google.com/apis/maps/documentation/javascript/examples/images/beachflag.png'; var myLatLng = new google.maps.LatLng(52.387913, 20.928782); var beachMarker = new google.maps.Marker({ position: latLng, map: map, icon: image }); } function initialize() { var mapDiv = document.getElementById('map-canvas'); var map = new google.maps.Map(mapDiv, { center: new google.maps.LatLng(52.397672,20.920736), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }); var path = [new google.maps.LatLng(52.359594, 20.972528), new google.maps.LatLng(52.363473, 21.004286), new google.maps.LatLng(52.356658, 21.011667), new google.maps.LatLng(52.363368, 21.042738), new google.maps.LatLng(52.365045, 21.071577), new google.maps.LatLng(52.354666, 21.077929), new google.maps.LatLng(52.346593, 21.084280), new google.maps.LatLng(52.345754, 21.075354), new google.maps.LatLng(52.333587, 21.083250), new google.maps.LatLng(52.362424, 21.112776), new google.maps.LatLng(52.368504, 21.116381), new google.maps.LatLng(52.372487, 21.106253), new google.maps.LatLng(52.386214, 21.094408), new google.maps.LatLng(52.401089, 21.094236), new google.maps.LatLng(52.412085, 21.117411), new google.maps.LatLng(52.423811, 21.108484), new google.maps.LatLng(52.42224, 21.098700), new google.maps.LatLng(52.435847, 21.0987), new google.maps.LatLng(52.442649, 21.113634), new google.maps.LatLng(52.463885, 21.105909), new google.maps.LatLng(52.471938, 21.092005), new google.maps.LatLng(52.476852, 21.092348), new google.maps.LatLng(52.478839, 21.068316), new google.maps.LatLng(52.5057,21.080675), new google.maps.LatLng(52.519908,21.133375), new google.maps.LatLng(52.524191,21.144018), new google.maps.LatLng(52.52795,21.136637), new google.maps.LatLng(52.531605,21.120329), new google.maps.LatLng(52.538601,21.121359), new google.maps.LatLng(52.539854,21.124792), new google.maps.LatLng(52.549563,21.115694), new google.maps.LatLng(52.569913,21.135435), new google.maps.LatLng(52.562818,21.097841), new google.maps.LatLng(52.549772,21.088743), ]; var line = new google.maps.Polyline({ path: path, strokeColor: '#FF0000', strokeOpacity: 1.0, strokeWeight: 4 }); line.setMap(map); var image = 'http://code.google.com/apis/maps/documentation/javascript/examples/images/beachflag.png'; var myLatLng = new google.maps.LatLng(52.387913, 20.928782); var beachMarker = new google.maps.Marker({ position: latLng, map: map, icon: image }); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body style="font-family: Arial; border: 0 none;"> </body> </html>
Proszę o pomoc