Index: trunk/extensions/WikiMiniAtlas/wikiminiatlas.js |
— | — | @@ -38,177 +38,173 @@ |
39 | 39 | // |
40 | 40 | function WikiMiniAtlas( obj ) |
41 | 41 | { |
42 | | - // defaults |
43 | | - this.coordinate_region = ''; |
44 | | - this.width = 500; |
45 | | - this.height = 300; |
| 42 | + if( obj == null ) { alert( 'Please pass a valid DOM object to the WikiMiniAtlas constructor!' ); return; } |
46 | 43 | |
47 | | - // globals |
48 | | - this.widget = null; |
| 44 | + // |
| 45 | + // global bookkeeping |
| 46 | + // |
49 | 47 | this.id = WMA_Global.max_id; |
50 | 48 | WMA_Global.max_id++; |
51 | 49 | WMA_Global.WMA[this.id] = this; |
52 | 50 | |
53 | | - this.map = null; |
54 | | - this.nx = 0; |
55 | | - this.ny = 0; |
56 | | - this.tile = 0; |
57 | | - |
| 51 | + // mouse wheel related stuff |
58 | 52 | this.date = new Date(); |
59 | 53 | this.lastwheel = 0; |
60 | 54 | this.wheeldelay = 1; |
61 | 55 | |
| 56 | + // map display related stuff |
62 | 57 | this.dragging = null; |
| 58 | + this.nx = 0; |
| 59 | + this.ny = 0; |
63 | 60 | this.gx = 0; |
64 | 61 | this.gy = 0; |
| 62 | + this.refreshmap = null; |
65 | 63 | this.zoom = 1; |
66 | 64 | this.marker = { lat: 0.0, lon: 0.0, obj: null, locked: true }; |
67 | | - this.taget_button = null; |
68 | | - this.settings = null; |
69 | | - this.lang = ''; |
70 | | - this.site = ''; |
71 | 65 | |
| 66 | + // scalebar related stuff |
72 | 67 | this.circ_eq = 40075.0; // equatorial circumfence in km |
73 | 68 | this.scalelabel = null; |
74 | 69 | this.scalebar = null; |
75 | 70 | |
76 | | - this.tileset = 0; |
| 71 | + this.width = obj.clientWidth; |
| 72 | + this.height = obj.clientHeight; |
77 | 73 | |
78 | 74 | // |
79 | | - // Insert the map Widget into the page. |
| 75 | + // gut the container widget of all its children |
80 | 76 | // |
81 | | - // do this when constructing the object |
82 | | - // the obj parameter should be a div |
83 | | - // which will be filled with a WMA |
84 | | - // function wikiminiatlasInstall() { |
85 | | - // jetzt obj |
86 | | - //var coordinates = document.getElementById('wikiminiatlas_widget'); |
| 77 | + for( var i = 0; i < obj.childNodes.length; i++ ) |
| 78 | + obj.removeChild( obj.childNodes[i] ); |
87 | 79 | |
88 | | - if( obj != null && this.widget == null) { |
89 | | - // vorher noch obj anpassen (padding weg) |
90 | | - obj.style.padding = '0'; |
| 80 | + // |
| 81 | + // add a new plain div which will contain all the subobjects of the map |
| 82 | + // |
| 83 | + this.widget = this.newElement( 'div', { style: { width: this.width, height: this.height, padding: '0px' } }, {} ); |
| 84 | + obj.appendChild( this.widget ); |
91 | 85 | |
92 | | - this.marker.lat = parseFloat( obj.getAttribute( 'wma_lat' ) || '0' ); |
93 | | - this.marker.lon = parseFloat( obj.getAttribute( 'wma_lon' ) || '0' ); |
94 | | - this.zoom = parseInt( obj.getAttribute( 'wma_zoom' ) || '1' ); |
95 | | - this.width = obj.clientWidth; |
96 | | - this.height = obj.clientHeight; |
97 | | - this.site = obj.getAttribute( 'wma_site' ) || 'en'; |
98 | | - this.lang = obj.getAttribute( 'wma_lang' ) || this.site; |
| 86 | + this.marker.lat = parseFloat( obj.getAttribute( 'wma_lat' ) || '0' ); |
| 87 | + this.marker.lon = parseFloat( obj.getAttribute( 'wma_lon' ) || '0' ); |
| 88 | + this.zoom = parseInt( obj.getAttribute( 'wma_zoom' ) || '1' ); |
| 89 | + this.tileset = parseInt( obj.getAttribute( 'wma_tileset' ) || '0' ); |
| 90 | + this.site = obj.getAttribute( 'wma_site' ) || 'en'; |
| 91 | + this.lang = obj.getAttribute( 'wma_lang' ) || this.site; |
| 92 | + this.coordinate_region = ''; |
99 | 93 | |
100 | | - this.widget = obj; |
| 94 | + var WikiMiniAtlasHTML; |
| 95 | + if( this.lang == 'co' || this.lang == 'commons' ) this.lang = 'en'; |
101 | 96 | |
102 | | - var WikiMiniAtlasHTML; |
103 | | - if( this.lang == 'co' || this.lang == 'commons' ) this.lang = 'en'; |
| 97 | + // |
| 98 | + // Fill missing i18n items |
| 99 | + // |
| 100 | + for( var item in this.strings ) |
| 101 | + if( !this.strings[item][this.lang] ) this.strings[item][this.lang] = this.strings[item]['en']; |
104 | 102 | |
105 | | - // Fill missing i18n items |
106 | | - for( var item in this.strings ) |
107 | | - if( !this.strings[item][this.lang] ) this.strings[item][this.lang] = this.strings[item]['en']; |
| 103 | + // |
| 104 | + // create UI elements |
| 105 | + // |
| 106 | + var button_plus = this.newElement( 'img', |
| 107 | + { |
| 108 | + src: this.imgbase + 'button_plus.png', |
| 109 | + title: this.strings.zoomIn[this.lang], |
| 110 | + style: { left: '10px', top: '10px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
| 111 | + }, { mousedown: this.zoomIn } ); |
| 112 | + var button_minus = this.newElement( 'img', |
| 113 | + { |
| 114 | + src: this.imgbase + 'button_minus.png', |
| 115 | + title: this.strings.zoomOut[this.lang], |
| 116 | + style: { left: '10px', top: '32px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
| 117 | + }, { mousedown: this.zoomOut } ); |
| 118 | + this.taget_button = this.newElement( 'img', |
| 119 | + { |
| 120 | + src: this.imgbase + 'button_target_locked.png', |
| 121 | + title: this.strings.center[this.lang], |
| 122 | + style: { left: '10px', top: '54px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
| 123 | + }, { mousedown: this.moveToTarget } ); |
| 124 | + var button_menu = this.newElement( 'img', |
| 125 | + { |
| 126 | + src: this.imgbase + 'button_menu.png', |
| 127 | + title: this.strings.settings[this.lang], |
| 128 | + style: { right: '40px', top: '8px', width: '18px', zIndex: '50', position: 'absolute', cursor: 'pointer' } |
| 129 | + }, { click: this.toggleSettings } ); |
| 130 | + var homepage_link = this.newElement( 'a', |
| 131 | + { |
| 132 | + href: 'http://meta.wikimedia.org/wiki/WikiMiniAtlas/' + this.lang, |
| 133 | + target: '_top', |
| 134 | + style: { zIndex: '11', position: 'absolute', right: '10px', bottom: '3px', color: 'black', fontSize: '5pt' } |
| 135 | + }, {} ); |
| 136 | + homepage_link.appendChild( document.createTextNode( "WikiMiniAtlas" ) ); |
108 | 137 | |
109 | | - var button_plus = this.newElement( 'img', |
110 | | - { |
111 | | - src: this.imgbase + 'button_plus.png', |
112 | | - title: this.strings.zoomIn[this.lang], |
113 | | - style: { left: '10px', top: '10px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
114 | | - }, { mousedown: this.zoomIn } ); |
| 138 | + // |
| 139 | + // build scalebar |
| 140 | + // |
| 141 | + var scalebox = document.createElement( 'div' ); |
| 142 | + this.scalebar = document.createElement( 'div' ); |
| 143 | + this.scalelabel = document.createElement( 'div' ); |
| 144 | + this.scalelabel.appendChild( document.createTextNode( "null" ) ); |
| 145 | + scalebox.appendChild( this.scalebar ); |
| 146 | + scalebox.appendChild( this.scalelabel ); |
115 | 147 | |
116 | | - var button_minus = this.newElement( 'img', |
117 | | - { |
118 | | - src: this.imgbase + 'button_minus.png', |
119 | | - title: this.strings.zoomOut[this.lang], |
120 | | - style: { left: '10px', top: '32px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
121 | | - }, { mousedown: this.zoomOut } ); |
| 148 | + WikiMiniAtlasHTML = ''; |
122 | 149 | |
123 | | - this.taget_button = this.newElement( 'img', |
124 | | - { |
125 | | - src: this.imgbase + 'button_target_locked.png', |
126 | | - title: this.strings.center[this.lang], |
127 | | - style: { left: '10px', top: '54px', zIndex: '30', position: 'absolute', cursor: 'pointer' } |
128 | | - }, { mousedown: this.moveToTarget } ); |
| 150 | + // Settings page |
| 151 | + WikiMiniAtlasHTML += |
| 152 | + '<div id="wikiminiatlas_settings">' + |
| 153 | + '<h4>' + this.strings.settings[this.lang] + '</h4>' + |
| 154 | + '<p class="option">' + this.strings.mode[this.lang] + ' <select onchange="WMA_Global.WMA['+this.id+'].selectTileset(this.value)">'; |
129 | 155 | |
130 | | - var button_menu = this.newElement( 'img', |
131 | | - { |
132 | | - src: this.imgbase + 'button_menu.png', |
133 | | - title: this.strings.settings[this.lang], |
134 | | - style: { right: '40px', top: '8px', width: '18px', zIndex: '50', position: 'absolute', cursor: 'pointer' } |
135 | | - }, { click: this.toggleSettings } ); |
136 | | - |
137 | | - |
138 | | - |
139 | | - var homepage_link = this.newElement( 'a', |
140 | | - { |
141 | | - href: 'http://meta.wikimedia.org/wiki/WikiMiniAtlas/' + this.lang, |
142 | | - target: '_top', |
143 | | - style: { zIndex: '11', position: 'absolute', right: '10px', bottom: '3px', color: 'black', fontSize: '5pt' } |
144 | | - }, {} ); |
145 | | - homepage_link.appendChild( document.createTextNode( "WikiMiniAtlas" ) ); |
146 | | - |
147 | | - var scalebox = document.createElement( 'div' ); |
148 | | - this.scalebar = document.createElement( 'div' ); |
149 | | - this.scalelabel = document.createElement( 'div' ); |
150 | | - this.scalelabel.appendChild( document.createTextNode( "null" ) ); |
151 | | - scalebox.appendChild( this.scalebar ); |
152 | | - scalebox.appendChild( this.scalelabel ); |
153 | | - |
154 | | - WikiMiniAtlasHTML = ''; |
155 | | - |
156 | | - // Settings page |
157 | | - WikiMiniAtlasHTML += |
158 | | - '<div id="wikiminiatlas_settings">' + |
159 | | - '<h4>' + this.strings.settings[this.lang] + '</h4>' + |
160 | | - '<p class="option">' + this.strings.mode[this.lang] + ' <select onchange="wmaSelectTileset(this.value)">'; |
161 | | - |
162 | | - for( var i = 0; i < this.tilesets.length; i++ ) |
163 | | - { |
164 | | - WikiMiniAtlasHTML += |
165 | | - '<option value="'+i+'">' + this.tilesets[i].name + '</option>'; |
166 | | - } |
167 | | - |
| 156 | + for( var i = 0; i < this.tilesets.length; i++ ) |
| 157 | + { |
168 | 158 | WikiMiniAtlasHTML += |
169 | | - '</select></p>' + |
170 | | - '<p class="option">' + this.strings.labelSet[this.lang] + ' <select onchange="wmaLabelSet(this.value)">' |
| 159 | + '<option value="'+i+'">' + this.tilesets[i].name + '</option>'; |
| 160 | + } |
171 | 161 | |
172 | | - for( var i in this.sites ) |
173 | | - { |
174 | | - WikiMiniAtlasHTML += |
175 | | - '<option value="'+i+'">' + this.sites[i] + '</option>'; |
176 | | - } |
| 162 | + WikiMiniAtlasHTML += |
| 163 | + '</select></p>' + |
| 164 | + '<p class="option">' + this.strings.labelSet[this.lang] + ' <select onchange="WMA_Global.WMA['+this.id+'].labelSet(this.value)">' |
177 | 165 | |
| 166 | + for( var i in this.sites ) |
| 167 | + { |
178 | 168 | WikiMiniAtlasHTML += |
179 | | - '</select></p>' + |
180 | | - '<p class="option">' + this.strings.linkColor[this.lang] + ' <select onchange="wmaLinkColor(this.value)">' + |
181 | | - '<option value="#2255aa">blue</option>' + |
182 | | - '<option value="red">red</option>' + |
183 | | - '<option value="white">white</option>' + |
184 | | - '<option value="black">black</option></select></p>' + |
185 | | - //'<p class="option" style="font-size: 50%; color:gray">Debug info:<br>marker: ' + this.marker.lat + ', ' + this.marker.lon + '<br>site:' + this.site+', uilang' + this.lang + '</p>' + |
186 | | - '<a href="http://tools.wikimedia.de/"><img src="/images/wikimedia-toolserver-button.png" border="0"></a>' + |
187 | | - '</div>' + |
188 | | - '</div>'; |
| 169 | + '<option value="'+i+'">' + this.sites[i] + '</option>'; |
| 170 | + } |
189 | 171 | |
190 | | - this.widget.style.clip = 'rect(0px,' + this.width + 'px,' + this.height + 'px,0px)'; |
191 | | - this.widget.style.position = 'absolute'; |
192 | | - this.widget.style.overflow = 'hidden'; |
| 172 | + WikiMiniAtlasHTML += |
| 173 | + '</select></p>' + |
| 174 | + '<p class="option">' + this.strings.linkColor[this.lang] + ' <select onchange="WMA_Global.WMA['+this.id+'].linkColor(this.value)">' + |
| 175 | + '<option value="#2255aa">blue</option>' + |
| 176 | + '<option value="red">red</option>' + |
| 177 | + '<option value="white">white</option>' + |
| 178 | + '<option value="black">black</option></select></p>' + |
| 179 | + //'<p class="option" style="font-size: 50%; color:gray">Debug info:<br>marker: ' + this.marker.lat + ', ' + this.marker.lon + '<br>site:' + this.site+', uilang' + this.lang + '</p>' + |
| 180 | + '<a href="http://tools.wikimedia.de/"><img src="/images/wikimedia-toolserver-button.png" border="0"></a>' + |
| 181 | + '</div>' + |
| 182 | + '</div>'; |
193 | 183 | |
194 | | - this.widget.oncontextmenu = function() { return false; }; |
195 | | - this.widget.innerHTML = WikiMiniAtlasHTML ; |
| 184 | + this.widget.style.clip = 'rect(0px,' + this.width + 'px,' + this.height + 'px,0px)'; |
| 185 | + this.widget.style.position = 'absolute'; |
| 186 | + this.widget.style.overflow = 'hidden'; |
196 | 187 | |
197 | | - this.widget.appendChild( button_minus ); |
198 | | - this.widget.appendChild( button_plus ); |
199 | | - this.widget.appendChild( button_menu ); |
200 | | - this.widget.appendChild( this.taget_button ); |
201 | | - this.widget.appendChild( homepage_link ); |
| 188 | + this.widget.oncontextmenu = function() { return false; }; |
| 189 | + this.widget.innerHTML = WikiMiniAtlasHTML ; |
| 190 | + this.settings = document.getElementById( 'wikiminiatlas_settings' ); |
202 | 191 | |
203 | | - // register global events (just once!) |
204 | | - if( this.id == 0 ) |
205 | | - { |
206 | | - document.onmousemove = WMA_Global.mouseMoveHandler; |
207 | | - document.onmouseup = WMA_Global.mouseUpHandler; |
208 | | - } |
| 192 | + this.widget.appendChild( button_minus ); |
| 193 | + this.widget.appendChild( button_plus ); |
| 194 | + this.widget.appendChild( button_menu ); |
| 195 | + this.widget.appendChild( this.taget_button ); |
| 196 | + this.widget.appendChild( homepage_link ); |
209 | 197 | |
210 | | - this.initializeMap(); |
211 | | - this.moveToTarget(); |
| 198 | + // |
| 199 | + // register global events (just once!) |
| 200 | + // |
| 201 | + if( this.id == 0 ) |
| 202 | + { |
| 203 | + document.onmousemove = WMA_Global.mouseMoveHandler; |
| 204 | + document.onmouseup = WMA_Global.mouseUpHandler; |
212 | 205 | } |
| 206 | + |
| 207 | + this.initializeMap(); |
| 208 | + this.moveToTarget(); |
213 | 209 | } |
214 | 210 | |
215 | 211 | // |
— | — | @@ -333,7 +329,7 @@ |
334 | 330 | } |
335 | 331 | |
336 | 332 | // |
337 | | -// Set new map Position (to wikiminiatlas_gx, wikiminiatlas_gy) |
| 333 | +// Set new map Position (to gx, gy) |
338 | 334 | // |
339 | 335 | //function moveWikiMiniAtlasMapTo() |
340 | 336 | WikiMiniAtlas.prototype.moveMapTo = function() |
— | — | @@ -341,8 +337,21 @@ |
342 | 338 | if( this.gy < 0 ) this.gy = 0; |
343 | 339 | if( this.gx < 0 ) this.gx += Math.floor( this.getZoomsize() * 256 ); |
344 | 340 | |
345 | | - var lx = Math.floor( this.gx / 128 ) % this.nx; |
346 | | - var ly = Math.floor( this.gy / 128 ) % this.ny; |
| 341 | + var lx = Math.floor( this.gx / 128 ); |
| 342 | + var ly = Math.floor( this.gy / 128 ); |
| 343 | + var refresh = true; |
| 344 | + |
| 345 | + // |
| 346 | + // speed up map movement by omitting unescessary tile refreshes |
| 347 | + // |
| 348 | + if( this.refreshmap != null && this.refreshmap.x == lx && this.refreshmap.y == ly ) |
| 349 | + refresh = false; |
| 350 | + else |
| 351 | + this.refreshmap = { x: lx, y: ly }; |
| 352 | + |
| 353 | + lx = lx % this.nx; |
| 354 | + ly - ly % this.ny; |
| 355 | + |
347 | 356 | var fx = this.gx % 128; |
348 | 357 | var fy = this.gy % 128; |
349 | 358 | var n; |
— | — | @@ -362,37 +371,40 @@ |
363 | 372 | thistile.style.left = (i*128-fx) + 'px'; |
364 | 373 | thistile.style.top = (j*128-fy) + 'px'; |
365 | 374 | |
366 | | - //thistile.innerHTML = (Math.floor(wikiminiatlas_gx/128)+i)+','+(Math.floor(wikiminiatlas_gy/128)+j); |
367 | | - tileurl = 'url("' + |
368 | | - this.tilesets[ this.tileset ].getTileURL( (Math.floor( this.gy/128)+j), (Math.floor(this.gx/128)+i), this.zoom ) + '")'; |
369 | | - dataurl = this.getDataURL( ( Math.floor( this.gy/128 ) + j ), ( Math.floor( this.gx/128 ) + i ), this.zoom ); |
370 | | - |
371 | | - if( WMA_Global.tile_URL[this.id][n] != tileurl ) |
| 375 | + if( refresh ) |
372 | 376 | { |
373 | | - WMA_Global.tile_URL[this.id][n] = tileurl; |
374 | | - thistile.style.backgroundImage = tileurl; |
| 377 | + //thistile.innerHTML = (Math.floor(wikiminiatlas_gx/128)+i)+','+(Math.floor(wikiminiatlas_gy/128)+j); |
| 378 | + tileurl = 'url("' + |
| 379 | + this.tilesets[ this.tileset ].getTileURL( (Math.floor( this.gy/128)+j), (Math.floor(this.gx/128)+i), this.zoom ) + '")'; |
| 380 | + dataurl = this.getDataURL( ( Math.floor( this.gy/128 ) + j ), ( Math.floor( this.gx/128 ) + i ), this.zoom ); |
375 | 381 | |
376 | | - if( WMA_Global.XHR[this.id][n] && |
377 | | - ( WMA_Global.XHR[this.id][n].readyState == 1 || |
378 | | - WMA_Global.XHR[this.id][n].readyState == 2 || |
379 | | - WMA_Global.XHR[this.id][n].readyState == 3 ) ) |
| 382 | + if( WMA_Global.tile_URL[this.id][n] != tileurl ) |
380 | 383 | { |
381 | | - WMA_Global.XHR[this.id][n].abort(); |
| 384 | + WMA_Global.tile_URL[this.id][n] = tileurl; |
| 385 | + thistile.style.backgroundImage = tileurl; |
| 386 | + |
| 387 | + if( WMA_Global.XHR[this.id][n] && |
| 388 | + ( WMA_Global.XHR[this.id][n].readyState == 1 || |
| 389 | + WMA_Global.XHR[this.id][n].readyState == 2 || |
| 390 | + WMA_Global.XHR[this.id][n].readyState == 3 ) ) |
| 391 | + { |
| 392 | + WMA_Global.XHR[this.id][n].abort(); |
| 393 | + } |
| 394 | + |
| 395 | + WMA_Global.XHR[this.id][n].open( "GET", dataurl, true ); |
| 396 | + thistile.innerHTML = 'loading'; |
| 397 | + WMA_Global.XHR[this.id][n].onreadystatechange = WMA_Global.XHR_callback[this.id][n]; |
| 398 | + WMA_Global.XHR[this.id][n].send( null ); |
382 | 399 | } |
383 | | - |
384 | | - WMA_Global.XHR[this.id][n].open( "GET", dataurl, true ); |
385 | | - thistile.innerHTML = 'loading'; |
386 | | - WMA_Global.XHR[this.id][n].onreadystatechange = WMA_Global.XHR_callback[this.id][n]; |
387 | | - WMA_Global.XHR[this.id][n].send( null ); |
388 | 400 | } |
389 | 401 | |
390 | | - var newcoords = this.latLonToXY( this.marker.lat, this.marker.lon ); |
391 | | - var newx = ( newcoords.x - this.gx ); |
392 | | - if( newx < -100 ) newx += ( this.getZoomsize() * 256 ); |
393 | | - this.marker.obj.style.left = ( newx - 6 ) + 'px'; |
394 | | - this.marker.obj.style.top = ( newcoords.y - this.gy -6 ) + 'px'; |
395 | 402 | } |
396 | 403 | |
| 404 | + var newcoords = this.latLonToXY( this.marker.lat, this.marker.lon ); |
| 405 | + var newx = ( newcoords.x - this.gx ); |
| 406 | + if( newx < -100 ) newx += ( this.getZoomsize() * 256 ); |
| 407 | + this.marker.obj.style.left = ( newx - 6 ) + 'px'; |
| 408 | + this.marker.obj.style.top = ( newcoords.y - this.gy -6 ) + 'px'; |
397 | 409 | } |
398 | 410 | |
399 | 411 | // |
— | — | @@ -590,6 +602,7 @@ |
591 | 603 | |
592 | 604 | me.gx = newcoords.x - me.width/2; |
593 | 605 | me.gy = newcoords.y - me.height/2; |
| 606 | + this.refreshmap = null; |
594 | 607 | me.moveMapTo(); |
595 | 608 | |
596 | 609 | return false; |
— | — | @@ -622,6 +635,7 @@ |
623 | 636 | var newcoords = me.latLonToXY( mapcenter.lat, mapcenter.lon ); |
624 | 637 | me.gx = newcoords.x - me.width/2; |
625 | 638 | me.gy = newcoords.y - me.height/2; |
| 639 | + this.refreshmap = null; |
626 | 640 | me.moveMapTo(); |
627 | 641 | |
628 | 642 | return false; |
— | — | @@ -644,7 +658,8 @@ |
645 | 659 | this.gy = newcoords.y - this.height/2; |
646 | 660 | } |
647 | 661 | |
648 | | - this.moveWikiMiniAtlasMapTo(); |
| 662 | + this.refreshmap = null; |
| 663 | + this.moveMapTo(); |
649 | 664 | this.toggleSettings(); |
650 | 665 | } |
651 | 666 | |
— | — | @@ -1121,7 +1136,7 @@ |
1122 | 1137 | name: "Physical", |
1123 | 1138 | getTileURL: function(y,x,z) |
1124 | 1139 | { |
1125 | | - return this.imgbase+'relief/'+z+'/'+y+'_'+( x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
| 1140 | + return WikiMiniAtlas.prototype.imgbase + 'relief/' + z + '/' + y + '_' + ( x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
1126 | 1141 | }, |
1127 | 1142 | linkcolor: "#2255aa", |
1128 | 1143 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1132,7 +1147,7 @@ |
1133 | 1148 | name: "Minimal basemap (coastlines)", |
1134 | 1149 | getTileURL: function(y,x,z) |
1135 | 1150 | { |
1136 | | - return this.imgbase+'newzoom'+(z+1)+'/tile_'+y+'_'+(x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
| 1151 | + return WikiMiniAtlas.prototype.imgbase + 'newzoom' + ( z + 1 ) + '/tile_' + y + '_' + ( x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
1137 | 1152 | }, |
1138 | 1153 | linkcolor: "#2255aa", |
1139 | 1154 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1146,7 +1161,7 @@ |
1147 | 1162 | var x1 = x % ( this.zoomsize[z] * 2 ); |
1148 | 1163 | if( x1<0 ) x1 += ( this.zoomsize[z] * 2 ); |
1149 | 1164 | |
1150 | | - return imgbase + 'satellite/earth/'+z+'/'+y+'_'+x1+'.jpg'; |
| 1165 | + return WikiMiniAtlas.prototype.imgbase + 'satellite/earth/' + z + '/' + y + '_' + x1 + '.jpg'; |
1151 | 1166 | }, |
1152 | 1167 | linkcolor: "white", |
1153 | 1168 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1157,7 +1172,8 @@ |
1158 | 1173 | name: "Night on Earth", |
1159 | 1174 | getTileURL: function(y,x,z) |
1160 | 1175 | { |
1161 | | - return imgbase+'nightonearth/'+z+'/'+y+'_'+(x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
| 1176 | + return WikiMiniAtlas.prototype.imgbase + |
| 1177 | + 'nightonearth/' + z + '/' + y + '_' + ( x % ( this.zoomsize[z] * 2 ) ) + '.png'; |
1162 | 1178 | }, |
1163 | 1179 | linkcolor: "#2255aa", |
1164 | 1180 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1168,8 +1184,8 @@ |
1169 | 1185 | name: "Daily aqua", |
1170 | 1186 | getTileURL: function(y,x,z) |
1171 | 1187 | { |
1172 | | - return imgbase + |
1173 | | - 'satellite/sat2.php?x='+(x % ( this.zoomsize[z] * 2 ) ) + '&y=' + y + '&z=' + z + '&l=0'; |
| 1188 | + return WikiMiniAtlas.prototype.imgbase + |
| 1189 | + 'satellite/sat2.php?x=' + ( x % ( this.zoomsize[z] * 2 ) ) + '&y=' + y + '&z=' + z + '&l=0'; |
1174 | 1190 | }, |
1175 | 1191 | linkcolor: "#aa0000", |
1176 | 1192 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1180,8 +1196,8 @@ |
1181 | 1197 | name: "Daily terra", |
1182 | 1198 | getTileURL: function(y,x,z) |
1183 | 1199 | { |
1184 | | - return imgbase + |
1185 | | - 'satellite/sat2.php?x='+(x % ( this.zoomsize[z] * 2 ) )+'&y='+y+'&z='+z+'&l=1'; |
| 1200 | + return WikiMiniAtlas.prototype.imgbase + |
| 1201 | + 'satellite/sat2.php?x=' + ( x % ( this.zoomsize[z] * 2 ) ) + '&y=' + y + '&z=' + z + '&l=1'; |
1186 | 1202 | }, |
1187 | 1203 | linkcolor: "#aa0000", |
1188 | 1204 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |
— | — | @@ -1195,7 +1211,7 @@ |
1196 | 1212 | var x1 = x % ( this.zoomsize[z] * 2 ); |
1197 | 1213 | if( x1<0 ) x1+=( this.prototype.zoomsize[z] * 2 ); |
1198 | 1214 | |
1199 | | - return imgbase + 'satellite/moon/'+z+'/'+y+'_'+x1+'.jpg'; |
| 1215 | + return WikiMiniAtlas.prototype.imgbase + 'satellite/moon/' + z + '/' + y + '_' + x1 + '.jpg'; |
1200 | 1216 | }, |
1201 | 1217 | linkcolor: "#aa0000", |
1202 | 1218 | zoomsize: [ 3, 6 ,12 ,24 ,48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304 ], |