|
Revision 1424, 1.0 kB
(checked in by Torben Brodt, 2 years ago)
|
|
updates for gmap v3
|
| Line | |
|---|
| 1 | {include file='gmapConstants'} |
|---|
| 2 | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={@$this->language->getLanguageCode()}"></script> |
|---|
| 3 | <script src="{@RELATIVE_WCF_DIR}js/gmap/Map3.class.js" type="text/javascript"></script> |
|---|
| 4 | <script src="{@RELATIVE_WCF_DIR}js/gmap/BBCodeMap.class.js" type="text/javascript"></script> |
|---|
| 5 | <script type="text/javascript"> |
|---|
| 6 | //<![CDATA[ |
|---|
| 7 | onloadEvents.push(function() { |
|---|
| 8 | var sv, gmap = new BBCodeMap(); |
|---|
| 9 | gmap.registerEvent(function(map) { |
|---|
| 10 | return function() { |
|---|
| 11 | gmap.gmap.setZoom({$bbcodemap_zoom}); |
|---|
| 12 | }; |
|---|
| 13 | }(gmap)); |
|---|
| 14 | |
|---|
| 15 | // write div layer with unique id |
|---|
| 16 | gmap.write(); |
|---|
| 17 | |
|---|
| 18 | return function() { |
|---|
| 19 | var marker, coordinates; |
|---|
| 20 | var data = {@$bbcodemap_data|json_encode}; |
|---|
| 21 | |
|---|
| 22 | var coordinates = []; |
|---|
| 23 | for(var i=0; i<data.length; i++) { |
|---|
| 24 | coordinates.push({ |
|---|
| 25 | latitude: data[i].lat, |
|---|
| 26 | longitude: data[i].lon |
|---|
| 27 | }); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | if(coordinates.length) { |
|---|
| 31 | gmap.loadMarkers(coordinates); |
|---|
| 32 | gmap.showMap(); |
|---|
| 33 | gmap.runEvents(); |
|---|
| 34 | } |
|---|
| 35 | }; |
|---|
| 36 | }()); |
|---|
| 37 | //]]> |
|---|
| 38 | </script> |
|---|