[Users] basemapcombo
Matt Priour
mpriour at kestrelcomputer.com
Wed Aug 3 01:05:52 CEST 2011
the setBaseLayer function doesn’t work because that value is a string
You need to pass a reference to the actual layer
Matt Priour
Kestrel Computer Consulting
From: Robert Buckley
Sent: Tuesday, August 02, 2011 3:51 PM
To: users at geoext.org
Subject: [Users] basemapcombo
Hi,
I´ve been trying for ages to get this to work...but it just doesn´t.
I wanted to make a simple array store from which I can choose my basemaps...
var baselayerStore = new Ext.data.ArrayStore({
fields: ['basemap'],
data:[['mapnik'],['gsat'],['gphy'],['gmap'],['ghyb']]
});
var baselayercombo = new Ext.form.ComboBox({
id:'baselayercombo',
store: baselayerStore,
displayField:'basemap',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a basemap...',
selectOnFocus:true
});
baselayercombo.on('select', function (combo, record, index) {
select = Ext.getCmp('baselayercombo').getValue();
var mapPanel = Ext.getCmp('mapPanel');
alert(select);
map.setBaseLayer(select);
}, this);
The problem is, the map.setBaseLayer just won´t take the getValue from the the comboBox.
The alert even sends the correct value, but nothing happens!?!?!?!?
Can anyone see what my error is?
yours,
Rob
--------------------------------------------------------------------------------
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110802/b31d83e7/attachment.htm
More information about the Users
mailing list