| 7 | | <script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo Config::item('gmaps.api_key') ?>"type="text/javascript"></script> |
| 8 | | <script type="text/javascript"> |
| 9 | | function showmap(){ |
| 10 | | //<![CDATA[ |
| 11 | | |
| 12 | | if (GBrowserIsCompatible()) { |
| 13 | | var map = new GMap(document.getElementById("map")); |
| 14 | | map.centerAndZoom(new GPoint(0,35), 16); |
| 15 | | map.enableScrollWheelZoom(); |
| 16 | | |
| 17 | | // Prevents the page from scrolling |
| 18 | | GEvent.addDomListener(map.getContainer(), "DOMMouseScroll", wheelevent); |
| 19 | | // map.getContainer().onmousewheel = wheelevent; |
| 20 | | } |
| 21 | | |
| 22 | | var icon = new GIcon(); |
| 23 | | icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; |
| 24 | | icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; |
| 25 | | icon.iconSize = new GSize(12, 20); |
| 26 | | icon.shadowSize = new GSize(22, 20); |
| 27 | | icon.iconAnchor = new GPoint(6, 20); |
| 28 | | icon.infoWindowAnchor = new GPoint(5, 1); |
| 29 | | |
| 30 | | map.addControl(new GSmallMapControl()); |
| 31 | | map.addControl(new GMapTypeControl()); |
| 32 | | |
| 33 | | var marker0 = new GMarker(new GPoint(-93.328379, 45.109871)); |
| 34 | | map.addOverlay(marker0); |
| 35 | | GEvent.addListener(marker0, "click", function() { |
| 36 | | marker0.openInfoWindowHtml("Minneapolis, Minnesota"); |
| 37 | | }); |
| 38 | | |
| 39 | | var marker1 = new GMarker(new GPoint(139.682282, 35.678451)); |
| 40 | | map.addOverlay(marker1); |
| 41 | | GEvent.addListener(marker1, "click", function() { |
| 42 | | marker1.openInfoWindowHtml("Tokyo, Japan"); |
| 43 | | }); |
| 44 | | |
| 45 | | //]]> |
| 46 | | } |
| 47 | | function wheelevent(e) { |
| 48 | | e.preventDefault(); |
| 49 | | e.returnValue = false; |
| 50 | | } |
| 51 | | window.onload = showmap; |
| 52 | | </script> |
| | 6 | <script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo Config::item('gmaps.api_key') ?>" type="text/javascript"></script> |