[OpenLayers-Users] Map layer control

truongxuan quang truongxuanquang at yahoo.com
Wed Jul 20 08:55:59 EDT 2011


Hello list


I got two layers (let say they are conflict together)

 One is:
...............
var Obs_Combo = new Ext.form.ComboBox({
        mode: 'local',
value: "rain fall",
triggerAction: 'all',
forceSelection: true,
            width: 205,
            fieldLabel:     'Title',
name:           'title',
hiddenName:     'title',
displayField:   'name',
valueField:     'value',
mode: "local",
store:          new Ext.data.JsonStore({
fields : ['name', 'value'],
data   : [
{name : 'rainfall',   value: 's1'},
{name : 'technical stations',  value: 's2'},
{name : 'station group 1', value: 's3'},
{name : 'station group 2', value: 's4'}
//{name : 'hydrological stations', value: 's5'},
]
})
    });
Obs_Combo.on('select', 
        function(combo, record, index) {
           var tt; tt=record.get("value");
  check(tt);
check_store(tt);
store_data.load();
gridPanel.reload();
store_data.bind(vecLayer_ds);
select2.bind(vecLayer_ds);
        },
        this
    );     

and the other is as e.g. bellows
........
function submit()
.......// input data from textbox here
......//input (lat,lon)...etct.
......
marker.events.register('mousedown', feature, markerClick);
markers=new OpenLayers.Layer.Markers("stations");
map.addLayer(markers); 

I have two problems:
1) when I click to the makers on the map, pupup doesn't appear until I turn off 
the vecLayer_ds on the tree menu, How could I do in this case, without turn on 
and turn off the vecLayer_ds.

2) How can I search for mapLayer name markers and turn it off if I click again 
on the submit() function because If I click n time  code will do n time of 
map.addLayer(markers)

Please give me a solution, many thanks for reading this msg

Quang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110720/12ca3c74/attachment.html


More information about the Users mailing list