Changeset 1424
- Timestamp:
- 05/17/11 22:48:03 (2 years ago)
- Location:
- g-map
- Files:
-
- 5 modified
-
files/js/gmap/AjaxMap.class.js (modified) (4 diffs)
-
optionals/de.gmap.wcf.data.message.bbcode.map/files/js/gmap/BBCodeMap.class.js (modified) (1 diff)
-
optionals/de.gmap.wcf.data.message.bbcode.map/package.xml (modified) (2 diffs)
-
optionals/de.gmap.wcf.data.message.bbcode.map/templates/mapBBCode.tpl (modified) (1 diff)
-
templates/mapOverview.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
g-map/files/js/gmap/AjaxMap.class.js
r1422 r1424 26 26 this.zoomUsed = null; 27 27 this.zoomDisplayed = null; 28 this.infoWindow = null; 28 29 }, 29 30 … … 35 36 var id = ++this.requestCounter; 36 37 37 var infoWindow = new google.maps.InfoWindow({ content: '<div style="overflow:auto;width:217px;height:70px;" id="info-' + id + '">' + 38 '<img src="' + RELATIVE_WCF_DIR + 'icon/gmap/ajax-loader.gif" alt="" />' + '</div>' }); 39 infoWindow.setPosition(marker.getLatLng()); 40 infoWindow.open(this.gmap); 38 if(this.infoWindow === null) { 39 this.infoWindow = new google.maps.InfoWindow({ 40 content: '<div style="overflow:auto;width:217px;height:70px;" id="' + this.divID + 'infoWindow">' + 41 '<img src="' + RELATIVE_WCF_DIR + 'icon/gmap/ajax-loader.gif" alt="" />' + 42 '</div>' 43 }); 44 } 45 46 var c = this.coordinates[marker.getLatLng()]; 47 this.infoWindow.setPosition(new google.maps.LatLng(c[0], c[1])); 48 this.infoWindow.open(this.gmap); 41 49 42 50 var url = this.url; … … 49 57 return function () { 50 58 if (ajaxRequest.xmlHttpRequest.readyState == 4 && ajaxRequest.xmlHttpRequest.status == 200) { 51 var avatar, dom = document.getElementById( 'info-' + id);59 var avatar, dom = document.getElementById(map.divID + 'infoWindow'); 52 60 if (!dom) { 53 61 return; … … 156 164 } 157 165 marker.getLatLng = function() { 158 return coordinates;166 return this.idx; 159 167 }; 160 168 marker.idx = i; 161 169 162 170 // increase marker count 171 map.markerCount = i; 163 172 map.coordinates[map.markerCount] = [data[i].lat, data[i].lon]; 164 map.markers.push(marker); 165 map.markerCount++; 173 map.markers[map.markerCount] = marker; 166 174 } 167 175 } -
g-map/optionals/de.gmap.wcf.data.message.bbcode.map/files/js/gmap/BBCodeMap.class.js
r1389 r1424 7 7 */ 8 8 if ( typeof BBCodeMap === 'undefined' ) { 9 var BBCodeMap = function(switchable){10 11 // instance counter12 if ( typeof BBCodeMap.counter === 'undefined' ) {13 // It has not... perform the initilization14 BBCodeMap.counter = 0;15 }16 ++BBCodeMap.counter;9 var BBCodeMap = Class.create(Map3, { 10 initialize: function($super, switchable) { 11 // instance counter 12 if ( typeof BBCodeMap.counter === 'undefined' ) { 13 // It has not... perform the initilization 14 BBCodeMap.counter = 0; 15 } 16 ++BBCodeMap.counter; 17 17 18 this.constructor('bbcodemap-' + BBCodeMap.counter, switchable);18 $super('bbcodemap-' + BBCodeMap.counter, switchable); 19 19 20 this.events = []; 20 this.events = []; 21 }, 21 22 22 this.registerEvent =function(callback) {23 registerEvent: function(callback) { 23 24 this.events.push(callback); 24 } ;25 }, 25 26 26 27 /** 27 28 * document write div containers 28 29 */ 29 this.write =function() {30 write: function() { 30 31 document.write('<div id="' + this.divID + '"><div id="' + this.divID + 'Canvas" style="height: 330px"></div></div>'); 31 } 32 33 this.runEvents =function() {32 }, 33 34 runEvents: function() { 34 35 for(var i=0; i<this.events.length; i++) { 35 36 this.events[i](); 36 37 } 37 }; 38 }; 39 BBCodeMap.prototype = new Map(); 38 } 39 }); 40 40 } -
g-map/optionals/de.gmap.wcf.data.message.bbcode.map/package.xml
r1393 r1424 6 6 <packagedescription><![CDATA[This BBCode allows you to add a map with infinite markers to your posting.]]></packagedescription> 7 7 <isunique>1</isunique> 8 <version> 2.0.3</version>8 <version>3.0.0 Beta 1</version> 9 9 <date>DATE</date> 10 10 <plugin>com.woltlab.wcf.data.message.bbcode</plugin> … … 30 30 <languages languagecode="fr">fr.xml</languages> 31 31 </instructions> 32 33 <instructions type="update" fromversion="2.0.3"> 34 <templates>templates.tar</templates> 35 <files>files.tar</files> 36 </instructions> 32 37 33 38 <instructions type="update" fromversion="2.0.2"> -
g-map/optionals/de.gmap.wcf.data.message.bbcode.map/templates/mapBBCode.tpl
r1251 r1424 1 1 {include file='gmapConstants'} 2 <script type="text/javascript"> 3 //<![CDATA[ 4 GMAP_ENABLE_STREETVIEW = 1; 5 GMAP_MAP_CONTROL = 'off'; 6 //]]> 7 </script> 8 <script src="{@RELATIVE_WCF_DIR}js/gmap/Map.class.js" type="text/javascript"></script> 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> 9 4 <script src="{@RELATIVE_WCF_DIR}js/gmap/BBCodeMap.class.js" type="text/javascript"></script> 10 5 <script type="text/javascript"> 11 6 //<![CDATA[ 12 if (GMAP_API_KEY != '') { 13 document.write('<script src="http://maps.google.com/maps?file=api&v=2.118&hl={@$this->language->getLanguageCode()}&key=' + GMAP_API_KEY + '&oe={CHARSET}" type="text/javascript"><\/script>'); 14 } 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 }()); 15 37 //]]> 16 38 </script> 17 <script type="text/javascript">18 //<![CDATA[19 if (GMAP_API_KEY != '') {20 document.write('<script src="{@RELATIVE_WCF_DIR}js/gmap/StreetViewControl.class.js" type="text/javascript"><\/script>');21 onloadEvents.push(function() {22 var sv, gmap = new BBCodeMap();23 gmap.registerEvent(function(map) {24 return function() {25 gmap.gmap.setZoom({$bbcodemap_zoom});26 if(GMAP_ENABLE_STREETVIEW) {27 sv = new StreetViewControl();28 gmap.gmap.addControl(sv);29 }30 };31 }(gmap));32 33 // write div layer with unique id34 gmap.write();35 36 return function() {37 if (GBrowserIsCompatible()) {38 var marker, coordinates;39 var data = {@$bbcodemap_data|json_encode};40 for(var i=0; i<data.length; i++) {41 coordinates = new GLatLng(data[i].lat, data[i].lon);42 if(i == 0) {43 gmap.setCoordinates(coordinates);44 gmap.gmap.clearOverlays();45 gmap.runEvents();46 }47 48 marker = new GMarker(coordinates);49 gmap.gmap.addOverlay(marker);50 }51 // enable street view from beginning?52 if(false && sv && data.length > 0) {53 coordinates = new GLatLng(data[0].lat, data[0].lon);54 sv.container2.showstreetview(coordinates);55 }56 }57 };58 }());59 }60 //]]>61 </script> -
g-map/templates/mapOverview.tpl
r1423 r1424 11 11 //]]> 12 12 </script> 13 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={@$this->language->getLanguageCode()}"></script> 13 14 <script src="{@RELATIVE_WCF_DIR}js/gmap/Map3.class.js" type="text/javascript"></script> 14 15 <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/AjaxRequest.class.js"></script> 15 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=de"></script>16 16 <script type="text/javascript"> 17 17 //<![CDATA[ … … 24 24 //]]> 25 25 </script> 26 <style type="text/css"> 27 #gmapCanvas { 28 color:#333 !important; 29 } 30 </style> 26 31 </head> 27 32 <body{if $templateName|isset} id="tpl{$templateName|ucfirst}"{/if}>
