Ticket #725: customizing_labels_layerswitcher.patch
| File customizing_labels_layerswitcher.patch, 2.7 kB (added by penyaskito, 2 years ago) |
|---|
-
lib/OpenLayers/Control/LayerSwitcher.js
old new 26 26 27 27 /** @type Array */ 28 28 baseLayers: null, 29 30 /** @type DOMElement */ 31 baseLbl: null, 32 33 /**@type String */ 34 baseLblTitle:null, 29 35 30 36 31 37 /** @type DOMElement */ 32 38 dataLbl: null, 33 39 40 /**@type String */ 41 dataLblTitle:null, 42 34 43 /** @type DOMElement */ 35 44 dataLayersDiv: null, 36 45 … … 373 382 this.layersDiv.style.height = "100%"; 374 383 375 384 376 varbaseLbl = document.createElement("div");377 baseLbl.innerHTML = "<u>Base Layer</u>";378 baseLbl.style.marginTop = "3px";379 baseLbl.style.marginLeft = "3px";380 baseLbl.style.marginBottom = "3px";385 this.baseLbl = document.createElement("div"); 386 this.baseLbl.innerHTML = "<u>"+this.getBaseLayersTitle()+"</u>"; 387 this.baseLbl.style.marginTop = "3px"; 388 this.baseLbl.style.marginLeft = "3px"; 389 this.baseLbl.style.marginBottom = "3px"; 381 390 382 391 this.baseLayersDiv = document.createElement("div"); 383 392 this.baseLayersDiv.style.paddingLeft = "10px"; … … 387 396 388 397 389 398 this.dataLbl = document.createElement("div"); 390 this.dataLbl.innerHTML = "<u> Overlays</u>";399 this.dataLbl.innerHTML = "<u>"+this.getOverlaysTitle()+"</u>"; 391 400 this.dataLbl.style.marginTop = "3px"; 392 401 this.dataLbl.style.marginLeft = "3px"; 393 402 this.dataLbl.style.marginBottom = "3px"; … … 396 405 this.dataLayersDiv.style.paddingLeft = "10px"; 397 406 398 407 if (this.ascending) { 399 this.layersDiv.appendChild( baseLbl);408 this.layersDiv.appendChild(this.baseLbl); 400 409 this.layersDiv.appendChild(this.baseLayersDiv); 401 410 this.layersDiv.appendChild(this.dataLbl); 402 411 this.layersDiv.appendChild(this.dataLayersDiv); 403 412 } else { 404 413 this.layersDiv.appendChild(this.dataLbl); 405 414 this.layersDiv.appendChild(this.dataLayersDiv); 406 this.layersDiv.appendChild( baseLbl);415 this.layersDiv.appendChild(this.baseLbl); 407 416 this.layersDiv.appendChild(this.baseLayersDiv); 408 417 } 409 418 … … 456 465 457 466 this.div.appendChild(this.minimizeDiv); 458 467 }, 459 468 getOverlaysTitle:function(){ 469 return this.dataLblTitle==null ? "Overlays":this.dataLblTitle; 470 }, 471 getBaseLayersTitle:function(){ 472 return this.baseLblTitle == null ? "Base Layers" : this.baseLblTitle; 473 }, 460 474 /** 461 475 * @private 462 476 *
