[OpenLayers-Commits] r11344 -
sandbox/bartvde/sencha/openlayers/examples
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Feb 23 11:00:26 EST 2011
Author: bartvde
Date: 2011-02-23 08:00:26 -0800 (Wed, 23 Feb 2011)
New Revision: 11344
Modified:
sandbox/bartvde/sencha/openlayers/examples/mobile-sencha.js
Log:
some cleanup in Sencha layer switcher
Modified: sandbox/bartvde/sencha/openlayers/examples/mobile-sencha.js
===================================================================
--- sandbox/bartvde/sencha/openlayers/examples/mobile-sencha.js 2011-02-23 15:57:24 UTC (rev 11343)
+++ sandbox/bartvde/sencha/openlayers/examples/mobile-sencha.js 2011-02-23 16:00:26 UTC (rev 11344)
@@ -6,20 +6,13 @@
createStore: function() {
Ext.regModel('Layer', {
- fields: ['id', 'name', 'visibility', 'zindex', 'cls']
+ fields: ['id', 'name', 'visibility', 'zindex']
});
var data = [];
Ext.each(this.map.layers, function(layer) {
if (layer.displayInLayerSwitcher === true) {
- var visibility, cls;
- if (layer.isBaseLayer === true) {
- cls = 'baselayer';
- visibility = (map.baseLayer == layer) && layer.getVisibility();
- } else {
- cls = 'overlay';
- visibility = layer.getVisibility();
- }
- data.push({id: layer.id, name: layer.name, cls: cls, visibility: visibility, zindex: layer.getZIndex()});
+ var visibility = layer.isBaseLayer ? (this.map.baseLayer == layer) : layer.getVisibility();
+ data.push({id: layer.id, name: layer.name, visibility: visibility, zindex: layer.getZIndex()});
}
});
return new Ext.data.Store({
@@ -31,7 +24,7 @@
initComponent: function() {
this.store = this.createStore();
- this.itemTpl = new Ext.XTemplate('<span class="{cls}">',
+ this.itemTpl = new Ext.XTemplate('<span">',
'<tpl if="visibility == true">',
'<img width="20" src="img/check-round-green.png">',
'</tpl>',
More information about the Commits
mailing list