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
|
// Création du controle pour recherche autocomplétée de Géoportail
var tbx = viewer.getMap().getControlsByClass('Geoportal.Control.ToolBox')[0];
var panel = new Geoportal.Control.Panel({div:OpenLayers.Util.getElement(tbx.id+'_search')});
var gazetteer1 = new Geoportal.Control.LocationUtilityService.GeoNames(
new Geoportal.Layer.OpenLS.Core.LocationUtilityService(
'PositionOfInterest:OPENLS;Geocode',//layer name
{
maximumResponses: 10,
formatOptions: {}
}
),
{
// tooltip
uiOptions: {title: 'gpControlLocationUtilityService.geonames.title'},
setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
filterOptions: null,
//Ajout de l'autocomplétion
autoCompleteOptions: {}
}
);
var gazetteer2 = new Geoportal.Control.LocationUtilityService.CadastralParcel(
new Geoportal.Layer.OpenLS.Core.LocationUtilityService(
'CadastralParcel:OPENLS;Geocode',//layer name
{
maximumResponses: 10,
formatOptions: {}
}
),
{
// tooltip
uiOptions: {title: 'gpControlLocationUtilityService.cadastralparcel.title'},
filterOptions: null,
//Ajout de l'autocomplétion
autoCompleteOptions: {}
}
);
panel.addControls([gazetteer1, gazetteer2]);
viewer.getMap().addControls([panel]); |
Partager