1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| var gazetteer= new Geoportal.Control.LocationUtilityService.GeoNames(olsLayer, {
// force drawLocation
drawLocation:true,
// suffix of all fields' form - suffixe des champs du formulaire
id:'Gazetteer',
outsideViewport:true,
// place where to display results - endroit où lister les résultats
resultDiv: OpenLayers.Util.getElement('resultsGazetteer'),
fields:{
'q0':'name',
'c' :null,
's' :'search',
'w' :'wait'
},
activate: function() {
this.layer.selectCntrl.deactivate();
this.layer.destroyFeatures();
this.loadContent(OpenLayers.Util.getElement('gpSearch'));
if (!this.layer.map) {
this.map.addLayer(this.layer);
}
this.resultDiv.innerHTML= '';
this.resultDiv.style.display= 'none';
// turn auto-completion on :
if (this.autoCompleteControl) {
this.map.addControl(this.autoCompleteControl);
}
},
deactivate: function() {
this.layer.cleanQueries();
},
loadContent: function(form) {
// add mapping :
this.inputs[this.fields.q0]= OpenLayers.Util.getElement('nameGazetteer');
this.buttons[this.fields.s]= OpenLayers.Util.getElement('searchGazetteer');
this.wImg= this.buildImageButton(form,this.fields.w,Geoportal.Util.getImagesLocation()+'loading.gif');
this.wImg.style.display= 'none';
// add listeners :
var e= this.buttons[this.fields.s]; |
Partager