mail[Wesnoth-commits] r37092 - /website/stats.wesnoth.org/wesstats/templates/killview.html


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by cornmander on July 20, 2009 - 08:38:
Author: cornmander
Date: Mon Jul 20 08:38:47 2009
New Revision: 37092

URL: http://svn.gna.org/viewcvs/wesnoth?rev=37092&view=rev
Log:
More work on GMap for wesnoth maps


Modified:
    website/stats.wesnoth.org/wesstats/templates/killview.html

Modified: website/stats.wesnoth.org/wesstats/templates/killview.html
URL: 
http://svn.gna.org/viewcvs/wesnoth/website/stats.wesnoth.org/wesstats/templates/killview.html?rev=37092&r1=37091&r2=37092&view=diff
==============================================================================
--- website/stats.wesnoth.org/wesstats/templates/killview.html (original)
+++ website/stats.wesnoth.org/wesstats/templates/killview.html Mon Jul 20 
08:38:47 2009
@@ -22,28 +22,21 @@
        <script type="text/javascript">
                function initialize() {
                        if (GBrowserIsCompatible()) {
-                               var map = new 
GMap2(document.getElementById("map_canvas"));
-                               map.setCenter(new GLatLng(37.4419, 
-122.1419), 13);
-                               map.setUIToDefault();
-                               
                                var copyright = new 
GCopyrightCollection("Wesnoth Project");
                                copyright.addCopyright(new 
GCopyright('test',new GLatLngBounds(new GLatLng(-90,-180), new 
GLatLng(90,180)) ,0,'Wesnoth Project'));
                                
-                               var tilelayer = new GTileLayer(copyright);
+                               var minscale = 3;
+                               var maxscale = 4;
+                               var tilelayer = new 
GTileLayer(copyright,minscale,maxscale);
                                tilelayer.getTileUrl = function(tile,zoom) { 
return "/wesstats/images/test_map."+tile.x+"_"+tile.y+"_"+zoom+".png"; };
                                tilelayer.isPng = function() { return true; };
                                tilelayer.getOpacity = function() { return 
1.0; };
+               
+                               var wmap_type = new GMapType( [tilelayer], 
new GMercatorProjection(18), "KillMap", {errorMessage:"No data"});
                                
-                               var mytiles = new 
GTileLayerOverlay(tilelayer);
-                               map.addOverlay(mytiles);
-                       
-                               var minMapScale = 3;
-                               var maxMapScale = 4;
-                               var mapTypes = map.getMapTypes();
-                               for (var i=0; mapTypes.length - i != 0; i++) 
{ <!-- genshi doesnt like the less than sign... -->
-                                       mapTypes[i].getMinimumResolution = 
function() { return minMapScale; }
-                                       mapTypes[i].getMaximumResolution = 
function() { return maxMapScale; }
-                               }
+                               var map = new 
GMap2(document.getElementById("map_canvas"),{mapTypes:[wmap_type]});
+                               map.setCenter(new GLatLng(80, -135), 3, 
wmap_type);
+                               map.addControl(new GLargeMapControl());
                        }
                }
        </script>




Related Messages


Powered by MHonArc, Updated Mon Jul 20 09:01:00 2009