Route
Klik op de groene pointer op kaart om een route van of naar de winkel te plannen.
- js:<div id="map"> <script type="text/javascript"> //<![CDATA[ if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(51.063964,5.85754), 15); //kaart bedieningselementen map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GOverviewMapControl()); var gmarkers = []; var htmls = []; var to_htmls = []; var from_htmls = []; var i=0; // A function to create the marker and set up the event window function createMarkerOK(point,name,html) { //var marker = new GMarker(point); var marker = new GMarker(point, new GIcon(G_DEFAULT_ICON, "http://www.google.com/intl/en_us/mapfiles/ms/micons/green-dot.png")); // The info window version with the "to here" form open html = "Google Maps, routeplanner"; to_htmls[i] = html + '<br>Route: <b>hier naartoe</b> - <a href="javascript:fromhere(' + i + ')">hier vandaan</a>' + '<br>Geef <u>Postcode</u> of <u>Adres</u> van beginpunt:<br><form action="http://maps.google.nl/maps" method="get" target="_blank">' + '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' + '<INPUT value="Laat route zien" TYPE="SUBMIT"><br><br><br>' + '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + "(" + "Woninginrichting Ed de Grave" + ")" + '"/>'; // The info window version with the "to here" form open html = "Google Maps, routeplanner"; from_htmls[i] = html + '<br>Route: <a href="javascript:tohere(' + i + ')">hier naartoe</a> - <b>hier vandaan</b>' + '<br>Geef <u>Postcode</u> of <u>Adres</u> van eindpunt:<br><form action="http://maps.google.nl/maps" method="get"" target="_blank">' + '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' + '<INPUT value="Laat route zien" TYPE="SUBMIT"><br><br><br>' + '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() + "(" + "Woninginrichting Ed de Grave" + ")" + '"/>'; // The inactive version of the direction info html = "<img src=\'http://www.eddegrave.nl/wp-content/themes/Starkers/images/jaap.jpg\' alt='Ed de Grave' width='200' height='165' style='float:left; margin-right:10px;' />"; html = html + 'Woninginrichting Ed de Grave <br />Stationsstraat 12<br />6114 GC – Susteren (Limburg)<br /><br /> <a href="javascript:tohere('+i+')">Route hier naartoe</a> <br> <a href="javascript:fromhere('+i+')">Route hier vandaan</a><br>'; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); gmarkers[i] = marker; htmls[i] = html; i++; return marker; } // functions that open the directions forms function tohere(i) { gmarkers[i].openInfoWindowHtml(to_htmls[i]); } function fromhere(i) { gmarkers[i].openInfoWindowHtml(from_htmls[i]); } var point = new GLatLng(51.063964,5.85754); var marker = createMarkerOK(point); map.addOverlay(marker); //Einde MarkerOK met routeplanner // Einde functie om de marker en tabteksten te creeeren //totaal 590 puntjes gezet //aanmaken wijkgegevens polylines en markers //encode polylines om te maken zie: http://www.google.com/apis/maps/documentation/polylineutility.html //maar let op, als er een / tussen staat moet je er 2 van maken en een Levelletter erbij //en terug decoden de extra tekens weer weghalen } //]]> </script> </div>