Mercurial > dive4elements > gnv-client
diff gnv/src/main/webapp/scripts/viewport.jsp @ 973:1bb54da8c8ed
Added more resources which are required to use the ol-client properly
gnv/trunk@1141 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 01 Jun 2010 14:15:10 +0000 |
parents | a0e6566cd111 |
children | 5779220ebb80 |
line wrap: on
line diff
--- a/gnv/src/main/webapp/scripts/viewport.jsp Tue Jun 01 13:01:25 2010 +0000 +++ b/gnv/src/main/webapp/scripts/viewport.jsp Tue Jun 01 14:15:10 2010 +0000 @@ -90,47 +90,13 @@ /* --------------------------------------------------------------------------- */ - // Scale Chooser - var scaleStore = new GeoExt.data.ScaleStore({map: map}); - var zoomSelector = new Ext.form.ComboBox({ - store: scaleStore, - emptyText: "Zoom Level", - tpl: '<tpl for="."><div class="x-combo-list-item">1 : {[parseInt(values.scale)]}</div></tpl>', - editable: false, - triggerAction: 'all', // needed so that the combo box doesn't filter by its current content - mode: 'local' // keep the combo box from forcing a lot of unneeded data refreshes - }); - - zoomSelector.on('select', - function(combo, record, index) { - map.zoomTo(record.data.level); - }, - this - ); - - map.events.register('zoomend', this, function() { - var scale = scaleStore.queryBy(function(record){ - return this.map.getZoom() == record.data.level; - }); - - if (scale.length > 0) { - scale = scale.items[0]; - zoomSelector.setValue("1 : " + parseInt(scale.data.scale)); - } else { - if (!zoomSelector.rendered) return; - zoomSelector.clearValue(); - } - }); - - // create MapPanel mapPanel = new GeoExt.MapPanel({ border: true, - title: "Karte mit GeoNames Suche", region: "center", map: map, - layers: layers, - bbar: [zoomSelector] + layers: layers + }); // map.setCenter(INITIAL_CENTER);