// This file is generated, do not edit!

OpenLayers.Lang["de"]=OpenLayers.Util.applyDefaults({'unhandledRequest':"Unbehandelte Anfragerückmeldung ${statusText}",'permalink':"Permalink",'overlays':"Overlays",'baseLayer':"Grundkarte",'sameProjection':"Die Übersichtskarte funktioniert nur, wenn sie dieselbe Projektion wie die Hauptkarte verwendet",'readNotImplemented':"Lesen nicht implementiert.",'writeNotImplemented':"Schreiben nicht implementiert.",'noFID':"Ein Feature, für das keine FID existiert, kann nicht aktualisiert werden.",'errorLoadingGML':"Fehler beim Laden der GML-Datei ${url}",'browserNotSupported':"Ihr Browser unterstützt keine Vektordarstellung. Aktuell unterstützte Renderer:\n${renderers}",'componentShouldBe':"addFeatures: Komponente sollte vom Typ ${geomType} sein",'getFeatureError':"getFeatureFromEvent wurde vom einem Layer ohne Render aufgerufen. Dies bedeutet normalerweise, das ein Layer vernichtet wurde, aber nicht seine Handler, die auf ihn verweisen.",'commitSuccess':"WFS-Transaktion: Erfolgreich ${response}",'commitFailed':"WFS-Transaktion: Fehlgeschlagen ${response}",'googleWarning':"Der Google-Layer konnte nicht korrekt geladen werden.\x3cbr\x3e\x3cbr\x3eUm diese Meldung nicht mehr zu erhalten, wählen Sie einen anderen Hintergrundlayer aus dem LayerSwitcher in der rechten oberen Ecke.\x3cbr\x3e\x3cbr\x3eSehr wahrscheinlich tritt dieser Fehler auf, weil das Skript der Google-Maps-Bibliothek nicht eingebunden wurde oder keinen gültigen API-Schlüssel für Ihre URL enthält.\x3cbr\x3e\x3cbr\x3eEntwickler: Besuche \x3ca href=\'http://trac.openlayers.org/wiki/Google\' target=\'_blank\'\x3edas Wiki\x3c/a\x3e für Hilfe zum korrekten Einbinden des Google-Layers",'getLayerWarning':"Der ${layerType}-Layer konnte nicht korrekt geladen werden.\x3cbr\x3e\x3cbr\x3eUm diese Meldung nicht mehr zu erhalten, wählen Sie einen anderen Hintergrundlayer aus dem LayerSwitcher in der rechten oberen Ecke.\x3cbr\x3e\x3cbr\x3eSehr wahrscheinlich tritt dieser Fehler auf, weil das Skript der \'${layerLib}\'-Bibliothek nicht eingebunden wurde.\x3cbr\x3e\x3cbr\x3eEntwickler: Besuche \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3edas Wiki\x3c/a\x3e für Hilfe zum korrekten Einbinden von Layern",'scale':"Maßstab = 1 : ${scaleDenom}",'layerAlreadyAdded':"Sie versuchen den Layer „${layerName}“ zur Karte hinzu zufügen, er wurde aber bereits hinzugefügt",'methodDeprecated':"Die Methode ist veraltet und wird in 3.0 entfernt. Bitte verwende stattdessen ${newMethod}.",'boundsAddError':"Beide Werte (x und y) müssen der add-Funktion übergeben werden.",'lonlatAddError':"Beide Werte (lon und lat) müssen der add-Funktion übergeben werden.",'pixelAddError':"Beide Werte (x und y) müssen der add-Funktion übergeben werden.",'unsupportedGeometryType':"Nicht unterstützter Geometrie-Typ: ${geomType}",'pagePositionFailed':"OpenLayers.Util.pagePosition fehlgeschlagen: Element mit Id ${elemId} möglicherweise falsch platziert.",'filterEvaluateNotImplemented':"„evaluate“ ist für diesen Filter-Typ nicht implementiert."});OpenLayers.Lang["fr"]=OpenLayers.Util.applyDefaults({'unhandledRequest':"Requête non gérée, retournant ${statusText}",'permalink':"Permalien",'overlays':"Calques",'baseLayer':"Calque de base",'sameProjection':"La carte de situation ne fonctionne que lorsque sa projection est la même que celle de la carte principale",'readNotImplemented':"Lecture non implémentée.",'writeNotImplemented':"Ecriture non implémentée.",'noFID':"Impossible de mettre à jour un objet sans identifiant (fid).",'errorLoadingGML':"Erreur au chargement du fichier GML ${url}",'browserNotSupported':"Votre navigateur ne supporte pas le rendu vectoriel. Les renderers actuellement supportés sont : \n${renderers}",'componentShouldBe':"addFeatures : le composant devrait être de type ${geomType}",'getFeatureError':"getFeatureFromEvent a été appelé sur un calque sans renderer. Cela signifie généralement que vous avez détruit cette couche, mais que vous avez conservé un handler qui lui était associé.",'minZoomLevelError':"La propriété minZoomLevel doit seulement être utilisée pour des couches FixedZoomLevels-descendent. Le fait que cette couche WFS vérifie la présence de minZoomLevel est une relique du passé. Nous ne pouvons toutefois la supprimer sans casser des applications qui pourraient en dépendre. C\'est pourquoi nous la déprécions -- la vérification du minZoomLevel sera supprimée en version 3.0. A la place, merci d\'utiliser les paramètres de résolutions min/max tel que décrit sur : http://trac.openlayers.org/wiki/SettingZoomLevels",'commitSuccess':"Transaction WFS : SUCCES ${response}",'commitFailed':"Transaction WFS : ECHEC ${response}",'googleWarning':"La couche Google n\'a pas été en mesure de se charger correctement.\x3cbr\x3e\x3cbr\x3ePour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.\x3cbr\x3e\x3cbr\x3eCela est possiblement causé par la non-inclusion de la librairie Google Maps, ou alors parce que la clé de l\'API ne correspond pas à votre site.\x3cbr\x3e\x3cbr\x3eDéveloppeurs : pour savoir comment corriger ceci, \x3ca href=\'http://trac.openlayers.org/wiki/Google\' target=\'_blank\'\x3ecliquez ici\x3c/a\x3e",'getLayerWarning':"La couche ${layerType} n\'est pas en mesure de se charger correctement.\x3cbr\x3e\x3cbr\x3ePour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.\x3cbr\x3e\x3cbr\x3eCela est possiblement causé par la non-inclusion de la librairie ${layerLib}.\x3cbr\x3e\x3cbr\x3eDéveloppeurs : pour savoir comment corriger ceci, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3ecliquez ici\x3c/a\x3e",'scale':"Echelle ~ 1 : ${scaleDenom}",'layerAlreadyAdded':"Vous avez essayé d\'ajouter à la carte le calque : ${layerName}, mais il est déjà présent",'reprojectDeprecated':"Vous utilisez l\'option \'reproject\' sur la couche ${layerName}. Cette option est dépréciée : Son usage permettait d\'afficher des données au dessus de couches raster commerciales.Cette fonctionalité est maintenant supportée en utilisant le support de la projection Mercator Sphérique. Plus d\'information est disponible sur http://trac.openlayers.org/wiki/SphericalMercator.",'methodDeprecated':"Cette méthode est dépréciée, et sera supprimée à la version 3.0. Merci d\'utiliser ${newMethod} à la place.",'boundsAddError':"Vous devez passer les deux valeurs x et y à la fonction add.",'lonlatAddError':"Vous devez passer les deux valeurs lon et lat à la fonction add.",'pixelAddError':"Vous devez passer les deux valeurs x et y à la fonction add.",'unsupportedGeometryType':"Type de géométrie non supporté : ${geomType}",'pagePositionFailed':"OpenLayers.Util.pagePosition a échoué: l\'élément d\'id ${elemId} pourrait être mal positionné.",'filterEvaluateNotImplemented':"évaluer n\'a pas encore été implémenté pour ce type de filtre."});OpenLayers.Lang.en={'unhandledRequest':"Unhandled request return ${statusText}",'permalink':"Permalink",'overlays':"Overlays",'baseLayer':"Base Layer",'sameProjection':"The overview map only works when it is in the same projection as the main map",'readNotImplemented':"Read not implemented.",'writeNotImplemented':"Write not implemented.",'noFID':"Can't update a feature for which there is no FID.",'errorLoadingGML':"Error in loading GML file ${url}",'browserNotSupported':"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",'componentShouldBe':"addFeatures : component should be an ${geomType}",'getFeatureError':"getFeatureFromEvent called on layer with no renderer. This usually means you "+"destroyed a layer, but not some handler which is associated with it.",'minZoomLevelError':"The minZoomLevel property is only intended for use "+"with the FixedZoomLevels-descendent layers. That this "+"wfs layer checks for minZoomLevel is a relic of the"+"past. We cannot, however, remove it without possibly "+"breaking OL based applications that may depend on it."+" Therefore we are deprecating it -- the minZoomLevel "+"check below will be removed at 3.0. Please instead "+"use min/max resolution setting as described here: "+"http://trac.openlayers.org/wiki/SettingZoomLevels",'commitSuccess':"WFS Transaction: SUCCESS ${response}",'commitFailed':"WFS Transaction: FAILED ${response}",'googleWarning':"The Google Layer was unable to load correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, this is because the Google Maps library "+"script was either not included, or does not contain the "+"correct API key for your site.<br><br>"+"Developers: For help getting this working correctly, "+"<a href='http://trac.openlayers.org/wiki/Google' "+"target='_blank'>click here</a>",'getLayerWarning':"The ${layerType} Layer was unable to load correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, this is because the ${layerLib} library "+"script was not correctly included.<br><br>"+"Developers: For help getting this working correctly, "+"<a href='http://trac.openlayers.org/wiki/${layerLib}' "+"target='_blank'>click here</a>",'scale':"Scale = 1 : ${scaleDenom}",'layerAlreadyAdded':"You tried to add the layer: ${layerName} to the map, but it has already been added",'reprojectDeprecated':"You are using the 'reproject' option "+"on the ${layerName} layer. This option is deprecated: "+"its use was designed to support displaying data over commercial "+"basemaps, but that functionality should now be achieved by using "+"Spherical Mercator support. More information is available from "+"http://trac.openlayers.org/wiki/SphericalMercator.",'methodDeprecated':"This method has been deprecated and will be removed in 3.0. "+"Please use ${newMethod} instead.",'boundsAddError':"You must pass both x and y values to the add function.",'lonlatAddError':"You must pass both lon and lat values to the add function.",'pixelAddError':"You must pass both x and y values to the add function.",'unsupportedGeometryType':"Unsupported geometry type: ${geomType}",'pagePositionFailed':"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",'end':'','filterEvaluateNotImplemented':"evaluate is not implemented for this filter type."};OpenLayers.Util.extend(OpenLayers.Lang.de,{'mf.tools':'Werkzeuge','mf.layertree':'Legendendarstellung','mf.layertree.opacity':'Transparenz','mf.layertree.remove':'Ausblenden','mf.layertree.zoomToExtent':'Auf die Ausdehnung zoomen','mf.print.mapTitle':'Titel','mf.print.comment':'Kommentar','mf.print.loadingConfig':'Laden der Konfiguration...','mf.print.serverDown':'Der Druck-Systemdienst funktioniert nicht','mf.print.unableToPrint':"Kann nicht drucken",'mf.print.generatingPDF':"Generierung des PDFs...",'mf.print.dpi':'DPI','mf.print.scale':'Maßstab','mf.print.rotation':'Rotation','mf.print.print':'Drucken','mf.print.resetPos':'Zurücksetzen','mf.print.layout':'Layout','mf.print.addPage':'Seite hinzufügen','mf.print.remove':'Seite entfernen','mf.print.clearAll':'Alles löschen','mf.print.pdfReady':'Das PDF-Dokument kann heruntergeladen werden.','mf.print.noPage':'Keine Seite ausgewählt, bitte auf "'+this['mf.print.addPage']+'"-'+'Button klicken um eine Seite hinzuzufügen.','mf.print.print-tooltip':'Ein PDF generieren, dass mindestens die bounding box umfasst','mf.error':'Fehler','mf.warning':'Warnung','mf.information':'Information','mf.cancel':'Abbrechen','mf.recenter.x':'X','mf.recenter.y':'Y','mf.recenter.submit':'zentrieren','mf.recenter.missingCoords':'Fehlende Koordinaten.','mf.recenter.outOfRangeCoords':'Eingegebene Koordinaten (${myX}, ${myY}) sind außerhalb des Kartenperimeters<br />'+'und sollen in folgenden Auschnitt sein:<br/>'+'${coordX} zwischen ${minCoordX} und ${maxCoordX},<br />'+'${coordY} zwischen ${minCoordY} und ${maxCoordY}','mf.recenter.ws.error':'Ein Fehler ist beim Zugang zum Webdienst vorgekommen:','mf.recenter.ws.service':'Ausgewählter Webdienst','mf.control.previous':'Vorherige Ansicht','mf.control.next':'Nächste Ansicht','mf.control.pan':'Verschieben','mf.control.zoomIn':'Hinein zoomen','mf.control.zoomOut':'Heraus zoomen','mf.control.zoomAll':'Globale Ansicht'});OpenLayers.Util.extend(OpenLayers.Lang.fr,{'scale':"Echelle = 1 : ${scaleDenom}",'mf.tools':'Outils','mf.layertree':'Arbre des couches','mf.layertree.opacity':'Opacité','mf.layertree.remove':'Supprimer','mf.layertree.zoomToExtent':'Zoom sur l\'emprise','mf.print.mapTitle':'Titre','mf.print.comment':'Commentaires','mf.print.unableToPrint':"Impossible d'imprimer",'mf.print.generatingPDF':"Génération du PDF...",'mf.print.dpi':'Résolution','mf.print.scale':'Échelle','mf.print.rotation':'Rotation','mf.print.print':'Imprimer','mf.print.resetPos':'Réinit. pos.','mf.print.layout':'Format','mf.print.addPage':'Ajouter page','mf.print.remove':'Enlever page','mf.print.clearAll':'Supprimer toutes','mf.print.pdfReady':'Votre document PDF est prêt.','mf.print.noPage':'Pas de page sélectionnée, appuyez sur le bouton "Ajouter page" pour en créer une.','mf.print.print-tooltip':'Générer un PDF contenant au moins l\'étendue de la carte','mf.print.serverDown':"Le service d'impression ne fonctionne pas",'mf.error':'Erreur','mf.warning':'Attention','mf.information':'Information','mf.cancel':'Annuler','mf.recenter.x':'X','mf.recenter.y':'Y','mf.recenter.submit':'Recentrer','mf.recenter.missingCoords':'Les coordonnées sont incomplètes.','mf.recenter.outOfRangeCoords':'Les coordonnées fournies (${myX}, ${myY}) sont en dehors de la carte.<br />'+'Elles doivent être comprises dans les limites suivantes :<br/>'+'${coordX} entre ${minCoordX} et ${maxCoordX},<br />'+'${coordY} entre ${minCoordY} et ${maxCoordY}','mf.recenter.emptyText':'Texte à rechercher','mf.recenter.ws.error':'Une erreur est survenue lors de l\'accès au webservice distant:','mf.recenter.ws.service':'Service sélectionné','mf.control.previous':'Vue précédente','mf.control.next':'Vue suivante','mf.control.pan':'Déplacer','mf.control.zoomIn':'Zoom avant','mf.control.zoomOut':'Zoom arrière','mf.control.zoomAll':'Vue globale','mf.editing.comboNoneName':'Aucun','mf.editing.import':'Importer','mf.editing.importTooltip':'Importer les données','mf.editing.commit':'Sauver','mf.editing.commitTooltip':'Sauvegarder les données','mf.editing.delete':'Supprimer','mf.editing.deleteTooltip':'Supprimer l\'élément sélectionné','mf.editing.comboLabel':'Couche à éditer','mf.editing.confirmMessageTitle':'Eléments édités','mf.editing.confirmMessage':'Certains éléments ne sont pas sauvegardés, '+'changer de couche?','mf.editing.selectModifyFeature':'Modifier des éléments','mf.editing.drawPointTitle':'Dessiner des points','mf.editing.drawLineTitle':'Dessiner des lignes','mf.editing.drawPolygonTitle':'Dessiner des polygones','mf.editing.formTitle':'Attributs','mf.editing.gridIdHeader':'Id','mf.editing.gridStateHeader':'Etat','mf.editing.gridTitle':'Eléments sélectionnés','mf.editing.onContextClickMessage':'Editer cet élément','mf.editing.onBeforeUnloadMessage':'Le panneau d\'édition contient '+'des éléments non sauvegardés'});OpenLayers.Util.extend(OpenLayers.Lang.en,{'mf.tools':'Tools','mf.layertree':'Layer tree','mf.layertree.opacity':'Opacity','mf.layertree.remove':'Remove','mf.layertree.zoomToExtent':'Zoom to extent','mf.print.mapTitle':'Title','mf.print.comment':'Comments','mf.print.loadingConfig':'Loading the configuration...','mf.print.serverDown':'The print service is not working','mf.print.unableToPrint':"Unable to print",'mf.print.generatingPDF':"Generating PDF...",'mf.print.dpi':'DPI','mf.print.scale':'Scale','mf.print.rotation':'Rotation','mf.print.print':'Print','mf.print.resetPos':'Reset Pos.','mf.print.layout':'Layout','mf.print.addPage':'Add page','mf.print.remove':'Remove page','mf.print.clearAll':'Clear all','mf.print.pdfReady':'Your PDF document is ready.','mf.print.noPage':'No page selected, click on the "Add page" button to add one.','mf.print.print-tooltip':'Generate a PDF with at least the extent shown on the map','mf.error':'Error','mf.warning':'Warning','mf.information':'Information','mf.cancel':'Cancel','mf.recenter.x':'X','mf.recenter.y':'Y','mf.recenter.submit':'Recenter','mf.recenter.missingCoords':'Some coordinates are missing.','mf.recenter.outOfRangeCoords':'Submitted coordinates (${myX}, ${myY}) are not in the map area<br />'+'and must be within following ranges:<br/>'+'${coordX} between ${minCoordX} and ${maxCoordX},<br />'+'${coordY} between ${minCoordY} and ${maxCoordY}','mf.recenter.emptyText':'Text to search','mf.recenter.ws.error':'An error occured when accessing the distant webservice:','mf.recenter.ws.service':'Selected service','mf.control.previous':'Previous view','mf.control.next':'Next view','mf.control.pan':'Pan','mf.control.zoomIn':'Zoom in','mf.control.zoomOut':'Zoom out','mf.control.zoomAll':'Zoom all','mf.editing.comboNoneName':'None','mf.editing.import':'Import','mf.editing.importTooltip':'Import data','mf.editing.commit':'Commit','mf.editing.commitTooltip':'Commit data','mf.editing.delete':'Delete','mf.editing.deleteTooltip':'Delete selected feature','mf.editing.comboLabel':'Layer to edit','mf.editing.confirmMessageTitle':'Edited features','mf.editing.confirmMessage':'There are uncommitted features, are you sure '+'you want to switch layer?','mf.editing.selectModifyFeature':'Modify features','mf.editing.drawPointTitle':'Draw points','mf.editing.drawLineTitle':'Draw lines','mf.editing.drawPolygonTitle':'Draw polygons','mf.editing.formTitle':'Attributes','mf.editing.gridIdHeader':'Id','mf.editing.gridStateHeader':'State','mf.editing.gridTitle':'Edited features','mf.editing.onContextClickMessage':'Edit this feature','mf.editing.onBeforeUnloadMessage':'The feature editing panel has '+'uncommitted features'});OpenLayers.Util.extend(OpenLayers.Lang.fr,{'Overview Map':'Carte de référence','Coordinates':'Coordonnées','Coordinates (m): ':'Coordonnées (m): ','Map':'Carte','Layer Tree':'Arbre des couches','Print':'Impression','Map Queries':'Interrogation','Background':'Fonds de carte','Nationales Maps':'Cartes nationales','Grays Nationales Maps':'Cartes nationales noir/blanc','Aerial Images':'Images aeriennes','None':'Aucun','Gemeinde':'Commune','Bezirk':'District','Kanton':'Canton','Schweiz':'Suisse','Measure':'Mesure','searcher':'Informations','Pan':'Déplacement','Vue general':'Vue générale','Distance measurement (double-click to terminate)':'Mesure de distance (double-cliquer pour terminer)','Area measurement (double-click to terminate)':'Mesure de surface (double-cliquer pour terminer)','Zoom arriere':'Zoom arrière','Zoom avant':'Zoom avant','Previous view':'Vue précédente','Next view':'Vue suivante','Locate by coordinates':'Recenter par coordonnées','Locate':'Recentrage','address':'Rue','numero':'Numéro','Parcelle non trouvee':'Parcelle non trouvée'});project_config={WMSUrl:'http://coppet.geocommunes.ch/wms',maxExtent:[501378,129183,506190,132220],scales:[1400000,1000000,500000,200000,150000,100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500,250],projectName:'peitrequin_coppet',printUrl:'/print',localTilecacheUrl:'/tilecache',localTilecacheDirectUrl:'/cache',commonTilecacheUrl:'http://common.geocommunes.ch/tilecache',commonTilecacheDirectUrl:'http://common.geocommunes.ch/cache'};ModelMain=OpenLayers.Class({config:{},urlParams:{},layertree:null,map:null,layout:null,tooltips:null,measure:null,initialize:function(){this.urlParams=OpenLayers.Util.getParameters(location.search);this.setConfig();this.initLang();this.setLayertree();this.setMap();this.setMeasure();this.setLayout();},setConfig:function(){if(typeof(project_config)=='undefined'){OpenLayers.Console.error('project_config is missing');return;}
this.config=project_config;},initLang:function(){if(this.urlParams.lang){OpenLayers.Lang.setCode(this.urlParams.lang);}else{OpenLayers.Lang.setCode($('lang').value);}},setLayertree:function(){this.layertree=new ModelLayerTree(this);},setMap:function(){this.map=new ModelMap(this);},setLayout:function(){this.layout=new ModelLayout(this);},setTooltips:function(){this.tooltips=new ModelTooltips(this);},setMeasure:function(){this.measure=new ModelMeasure(this);},getLocale:function(){var code=OpenLayers.Lang.getCode();if(OpenLayers.Util.indexOf(['de','fr','it'],code)!=-1){return code+'_CH';}else{return'de_CH';}}});ModelMap=OpenLayers.Class({main:null,map:null,initialize:function(main){this.main=main;this.initMap();},initMap:function(){Ext.BLANK_IMAGE_URL="mfbase/ext/resources/images/default/s.gif";OpenLayers.IMAGE_RELOAD_ATTEMPTS=1;OpenLayers.DOTS_PER_INCH=254;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){this.src=this.src;}
this.style.display="none";};var options={projection:"EPSG:21781",units:"m",maxExtent:new OpenLayers.Bounds.fromArray(this.main.config.maxExtent),restrictedExtent:new OpenLayers.Bounds.fromArray(this.main.config.maxExtent),scales:this.main.config.scales,theme:null};options.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({div:$('mousepos'),numDigits:0,prefix:OpenLayers.i18n('Coordinates (m): ')}),new OpenLayers.Control.Scale($('scale'),{updateScale:function(){var scale=this.map.getScale();if(!scale){return;}
this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:OpenLayers.Number.format(scale,0,"'")});}})];this.map=new OpenLayers.Map('map',options);var OLlayers=this.main.layertree.getOlLayers();this.map.addLayers(OLlayers);if(this.main.config.initialExtent){var initialBounds=new OpenLayers.Bounds.fromArray(this.main.config.initialExtent);this.map.zoomToExtent(initialBounds);}else if(this.main.config.initialScale){if(this.main.config.initialLonLat){var target=new OpenLayers.LonLat(this.main.config.initialLonLat[0],this.main.config.initialLonLat[1]);}else{var initialBounds=new OpenLayers.Bounds.fromArray(this.main.config.maxExtent);var target=initialBounds.getCenterLonLat();}
this.map.moveTo(target,this.getZoomForScale(this.main.config.initialScale));}else{this.map.zoomToMaxExtent();}},getZoomForScale:function(scale){var zoom=0;for(var i=0;i<this.map.scales.length;i++){if(this.map.scales[i]==scale){zoom=i;}}
return zoom;}});ModelLayerTree=OpenLayers.Class({main:null,mfModel:[],olOverviewMapLayer:null,olLayers:[],baseUrl:'',initialize:function(main){this.main=main;this.baseLayerSource=this.main.config.localTilecacheUrl
this.applicativeLayerSource=this.main.config.localTilecacheUrl
this.mfModel=[{text:'Cadastre - voirie',id:'cadastre',iconCls:'voidIcon',leaf:true,checked:false,expanded:true,children:[{text:'Parcellaire',id:'cadastre_parcellaire',iconCls:'voidIcon',leaf:true,checked:true,expanded:true,maxScale:10000,children:[{layerName:'Vecteur:cad_parv',text:'Parcelles',id:'cadastre_parcellaire_parcelles',checked:true,icon:'mapfishModelPeitrequin/img/parcelle.png',iconCls:'customClass',children:[{text:"Droit distinct permanant",id:"cadastre_parcellaire_parcelles_droit",leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/parcelle_d.png'},{text:"Parcelle",id:"cadastre_parcellaire_parcelles_parcelle",leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/parcelle_p.png'}]},{layerName:'Vecteur:cad_parv_numero',text:'N° de parcelle',id:'cadastre_parcellaire_num',checked:true,icon:'mapfishModelPeitrequin/img/num_parcelle.png',iconCls:'customClass',maxScale:2000},{layerName:'Vecteur:cad_parv_point',text:'Points limites',id:'cadastre_parcellaire_lim',checked:false,icon:'mapfishModelPeitrequin/img/point_limit.png',iconCls:'customClass',maxScale:2000}]},{text:"Couverture du sol",id:"cadastre_couverture",leaf:true,iconCls:'voidIcon',checked:false,expanded:false,maxScale:10000,children:[{text:"Couverture du sol",id:"cadastre_couverture_couverture",leaf:true,iconCls:'voidIcon',checked:false,expanded:false,children:[{layerName:'Vecteur:cad_bat_hs_cadastre',text:'Bâtiments hors-sol',id:'cadastre_couverture_couverture_baths',iconCls:'customClass',icon:'mapfishModelPeitrequin/img/batimentsHS.png',checked:true},{layerName:'Vecteur:cad_bat_ss_cadastre',text:"Bâtiments sous-sol",id:'cadastre_couverture_couverture_batss',iconCls:'customClass',icon:'mapfishModelPeitrequin/img/batimentsSS.png',checked:true},{layerName:"Vecteur:movd_cad_couv",text:"Couvert",id:'cadastre_couverture_couverture_couvert',checked:false,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert.png'},{layerName:"Vecteur:movd_cad_couv_foret",text:"Forêt",id:'cadastre_couverture_couverture_foret',checked:false,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_foret.png'},{layerName:"Vecteur:movd_cad_couv_eau",text:"Cours d'eau",id:'cadastre_couverture_couverture_eau',checked:false,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_eau.png'},{layerName:"Vecteur:movd_cad_couv_divers",text:"Objets divers",id:'cadastre_couverture_couverture_divers',checked:false,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png',children:[{text:"Route, chemin",id:'cadastre_couverture_couverture_divers_route',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Chemin de fer",id:'cadastre_couverture_couverture_divers_fer',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Accès place",id:'cadastre_couverture_couverture_divers_acces',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Détail de bâtiment",id:'cadastre_couverture_couverture_divers_detail',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Mur mitoyen",id:'cadastre_couverture_couverture_divers_murmit',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Escalier important",id:'cadastre_couverture_couverture_divers_esca',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Mur",id:'cadastre_couverture_couverture_divers_mur',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Mat, antenne",id:'cadastre_couverture_couverture_divers_mat',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Débarcadère",id:'cadastre_couverture_couverture_divers_deb',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Pont, passerelle",id:'cadastre_couverture_couverture_divers_pont',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Couvert indépendant",id:'cadastre_couverture_couverture_divers_couvind',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Tunnel, passage inférieur",id:'cadastre_couverture_couverture_divers_tunnel',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Sentier à ventiler",id:'cadastre_couverture_couverture_divers_sentier',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Bord de chaussée à ventiler",id:'cadastre_couverture_couverture_divers_bord',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Ilot à ventiler",id:'cadastre_couverture_couverture_divers_ilot',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Voie ferrée",id:'cadastre_couverture_couverture_divers_voie',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris_trait.png'},{text:"Fontaine",id:'cadastre_couverture_couverture_divers_font',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_bleu.png'},{text:"Ligne aérienne haute tension",id:'cadastre_couverture_couverture_divers_ligne',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris_trait_alt.png'},{text:"Piscine",id:'cadastre_couverture_couverture_divers_pisc',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_bleu.png'},{text:"Terrain de sport",id:'cadastre_couverture_couverture_divers_sport',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_gris.png'},{text:"Eau à ventiler",id:'cadastre_couverture_couverture_divers_eau',leaf:true,iconCls:'customClass',icon:'mapfishModelPeitrequin/img/couvert_bleu.png'}]},{layerName:"Vecteur:movd_cad_labels",text:"Nom de rue et d'objet",id:'cadastre_couverture_couverture_nomrueobj',checked:false,maxScale:1000},{layerName:"Vecteur:movd_cad_labels_local",text:"Nom local",id:'cadastre_couverture_couverture_nomloc',checked:false,maxScale:5000}]},{layerName:"Vecteur:GrpConstruction",text:"Bâtiments projetés",id:'cadastre_couverture_batproj',icon:'mapfishModelPeitrequin/img/batimentsprojet.png',iconCls:'customClass',checked:true}]}]},{text:"Infrastructures",id:'infra',expanded:false,checked:false,iconCls:'voidIcon',maxScale:10000,children:[{text:"Assainissement",id:'infra_ass',expanded:false,checked:false,iconCls:'voidIcon',children:[{text:'Collecteur principal',id:'infra_ass_colprin',expanded:false,checked:false,iconCls:'voidIcon',children:[{layerName:'Vecteur:GrpAssainissPrinEU',text:'Eaux usées',id:'infra_ass_colprin_use',leaf:true,checked:false,iconCls:'voidIcon',children:[{text:'Collecteur',id:'infra_ass_colprin_use_col',icon:'mapfishModelPeitrequin/img/CollecteurPrincipalEU.png',iconCls:'customClass'},{text:'Collecteur (tracé supposé)',id:'infra_ass_colprin_use_colsup',icon:'mapfishModelPeitrequin/img/CollecteurPrincipalSupposeEU.png',iconCls:'customClass'},{text:'Chambre de visite',id:'infra_ass_colprin_use_cham',icon:'mapfishModelPeitrequin/img/RegardPrincipalEU.png',iconCls:'customClass'},{text:'Chambre de visite enterrée',id:'infra_ass_colprin_use_chament',icon:'mapfishModelPeitrequin/img/RegardEnterreEU.png',iconCls:'customClass'},{text:'Chambre de visite double (EU+EC)',id:'infra_ass_colprin_use_chamdbl',icon:'mapfishModelPeitrequin/img/RegardDouble.png',iconCls:'customClass'},{text:'Chambre de visite double (EU+EC) enterrée',id:'infra_ass_colprin_use_chamdblent',icon:'mapfishModelPeitrequin/img/RegardDoubleEnterre.png',iconCls:'customClass'}]},{layerName:'Vecteur:GrpAssainissPrinEC',text:'Eaux claires',id:'infra_ass_colprin_cl',checked:false,leaf:true,iconCls:'voidIcon',children:[{text:'Collecteur',id:'infra_ass_colprin_cl_col',icon:'mapfishModelPeitrequin/img/CollecteurPrincipalEC.png',iconCls:'customClass'},{text:'Collecteur (tracé supposé)',id:'infra_ass_colprin_cl_colsup',icon:'mapfishModelPeitrequin/img/CollecteurPrincipalSupposeEC.png',iconCls:'customClass'},{text:'Chambre de visite',id:'infra_ass_colprin_cl_cham',icon:'mapfishModelPeitrequin/img/RegardPrincipalEC.png',iconCls:'customClass'},{text:'Chambre de visite enterrée',id:'infra_ass_colprin_cl_chament',icon:'mapfishModelPeitrequin/img/RegardEnterreEC.png',iconCls:'customClass'}]}]},{text:'Raccordements privés',id:'infra_ass_priv',expanded:false,checked:false,iconCls:'voidIcon',maxScale:2000,children:[{layerName:'Vecteur:GrpAssainissPrivEU',text:'Eaux usées',id:'infra_ass_priv_use',leaf:true,checked:false,iconCls:'voidIcon',children:[{text:'Collecteur',id:'infra_ass_priv_use_col',icon:'mapfishModelPeitrequin/img/RaccordementEU.png',iconCls:'customClass'},{text:'Collecteur (tracé supposé)',id:'infra_ass_priv_use_colsup',icon:'mapfishModelPeitrequin/img/RaccordementSupposeEU.png',iconCls:'customClass'},{text:'Chambre de viste',id:'infra_ass_priv_use_cham',icon:'mapfishModelPeitrequin/img/RegardPriveEU.png',iconCls:'customClass'},{text:'Chambre de viste enterrée',id:'infra_ass_priv_use_chament',icon:'mapfishModelPeitrequin/img/RegardEnPriveEU.png',iconCls:'customClass'},{text:'Chambre de visite double (EU+EC)',id:'infra_ass_priv_use_chamdbl',icon:'mapfishModelPeitrequin/img/RegardDoublePrive.png',iconCls:'customClass'}]},{layerName:'Vecteur:GrpAssainissPrivEC',text:'Eaux claires',id:'infra_ass_priv_cl',leaf:true,checked:false,iconCls:'voidIcon',children:[{text:'Collecteur',id:'infra_ass_priv_cl_col',icon:'mapfishModelPeitrequin/img/RaccordementEC.png',iconCls:'customClass'},{text:'Collecteur (tracé supposé)',id:'infra_ass_priv_cl_colsup',icon:'mapfishModelPeitrequin/img/RaccordementSupposeEC.png',iconCls:'customClass'},{text:'Drainage',id:'infra_ass_priv_cl_drai',icon:'mapfishModelPeitrequin/img/Drainage.png',iconCls:'customClass'},{text:'Chambre de visite',id:'infra_ass_priv_cl_cham',icon:'mapfishModelPeitrequin/img/RegardPriveEC.png',iconCls:'customClass'},{text:'Chambre de visite enterrée',id:'infra_ass_priv_cl_chament',icon:'mapfishModelPeitrequin/img/RegardEnPriveEC.png',iconCls:'customClass'},{text:'Sac-grille / Gueule de loup',id:'infra_ass_priv_cl_gril',icon:'mapfishModelPeitrequin/img/Grille.png',iconCls:'customClass'},{text:'Puits perdu',id:'infra_ass_priv_cl_puit',icon:'mapfishModelPeitrequin/img/PuitsPerdu.png',iconCls:'customClass'}]}]}]},{text:"Eau potable",id:'infra_pot',expanded:false,checked:false,iconCls:'voidIcon',children:[{layerName:'Vecteur:GrpEauPotablePrin',text:'Conduites principales',id:'infra_pot_prin',leaf:true,checked:false,iconCls:'voidIcon',children:[{text:'Conduite',id:'infra_pot_prin_cond',icon:'mapfishModelPeitrequin/img/ConduitePrincipale.png',iconCls:'customClass'},{text:'Conduite (tracé supposé)',id:'infra_pot_prin_condsup',icon:'mapfishModelPeitrequin/img/ConduitePrincipaleSupposeeESP.png',iconCls:'customClass'},{text:'Vanne',id:'infra_pot_prin_van',icon:'mapfishModelPeitrequin/img/Vanne.png',iconCls:'customClass'},{text:'Borne hydrante',id:'infra_pot_prin_born',icon:'mapfishModelPeitrequin/img/BorneHydranteLegende.png',iconCls:'customClass'}]},{layerName:'Vecteur:GrpEauPotablePriv',text:'Raccordements privés',id:'infra_pot_priv',leaf:true,checked:false,iconCls:'voidIcon',maxScale:2000,children:[{text:'Conduite',id:'infra_pot_priv_cond',icon:'mapfishModelPeitrequin/img/Concession.png',iconCls:'customClass'},{text:'Vanne concession',id:'infra_pot_priv_van',icon:'mapfishModelPeitrequin/img/VanneConcession.png',iconCls:'customClass'},{text:'Compteur',id:'infra_pot_priv_comp',icon:'mapfishModelPeitrequin/img/Compteur.png',iconCls:'customClass'}]}]}]},{layerName:'Vecteur:SitVoAdressPoint',text:"Voirie",id:'voirie',expanded:false,checked:false,iconCls:"voidIcon",maxScale:5000,children:[{text:'Adresses',id:'voirie_add',leaf:true,checked:false,icon:'mapfishModelPeitrequin/img/adresse.png',iconCls:'customClass'}]},{text:"Aménagement du territoire",id:'terr',checked:false,iconCls:'voidIcon',leaf:true,maxScale:50000,children:[{text:'Protection des eaux',id:'terr_prot',iconCls:'voidIcon',checked:false,children:[{text:"Zones de protection des eaux",id:'terr_prot_zone',layerName:'Vecteur:GrpZoneProtectionEaux',leaf:true,checked:false,iconCls:'voidIcon',maxScale:25000,children:[{text:'S1',id:'terr_prot_zone_s1',icon:'mapfishModelPeitrequin/img/S1.png',iconCls:'customClass'},{text:'S2',id:'terr_prot_zone_s2',icon:'mapfishModelPeitrequin/img/S2.png',iconCls:'customClass'},{text:'S3',id:'terr_prot_zone_s3',icon:'mapfishModelPeitrequin/img/S3.png',iconCls:'customClass'}]},{layerName:"Vecteur:GrpSectProtectionEaux",text:"Secteurs de protection des eaux",id:'terr_prot_sec',leaf:true,checked:false,iconCls:'voidIcon',children:[{text:'A',id:'terr_prot_sec_a',icon:'mapfishModelPeitrequin/img/SectA.png',iconCls:'customClass'},{text:'B',id:'terr_prot_sec_b',icon:'mapfishModelPeitrequin/img/SectB.png',iconCls:'customClass'},{text:'C',id:'terr_prot_sec_c',icon:'mapfishModelPeitrequin/img/SectC.png',iconCls:'customClass'},{text:'S',id:'terr_prot_sec_s',icon:'mapfishModelPeitrequin/img/SectS.png',iconCls:'customClass'}]}]},{layerName:'Vecteur:Affectation',text:"Zones d'affectation",id:'terr_aff',leaf:true,checked:false,iconCls:'voidIcon',maxScale:25000,children:[{text:'Zone ancienne ville',id:'terr_aff_anc',icon:'mapfishModelPeitrequin/img/affectation_ancienne_ville.png',iconCls:'customClass'},{text:'Zone moyenne densité',id:'terr_aff_moy',icon:'mapfishModelPeitrequin/img/affectation_moyenne_densite.png',iconCls:'customClass'},{text:'Zone villas',id:'terr_aff_villa',icon:'mapfishModelPeitrequin/img/affectation_villas.png',iconCls:'customClass'},{text:'Zone littoral',id:'terr_aff_litt',icon:'mapfishModelPeitrequin/img/affectation_littoral.png',iconCls:'customClass'},{text:'Zone utilité publique',id:'terr_aff_pub',icon:'mapfishModelPeitrequin/img/affectation_utilite_publique.png',iconCls:'customClass'},{text:'Zone ferroviaire',id:'terr_aff_fer',icon:'mapfishModelPeitrequin/img/PartieZoneOccuperPlanSpec.png',iconCls:'customClass'},{text:'Zone verte',id:'terr_aff_vert',icon:'mapfishModelPeitrequin/img/affectation_verte.png',iconCls:'customClass'},{text:'Zone agricole',id:'terr_aff_agri',icon:'mapfishModelPeitrequin/img/affectation_agricole.png',iconCls:'customClass'},{text:'Zone viticole',id:'terr_aff_viti',icon:'mapfishModelPeitrequin/img/affectation_viticole.png',iconCls:'customClass'},{text:'Zone intermédiaire',id:'terr_aff_int',icon:'mapfishModelPeitrequin/img/affectation_intermediaire.png',iconCls:'customClass'},{text:'Aire forestière',id:'terr_aff_foret',icon:'mapfishModelPeitrequin/img/affectation_forestiere.png',iconCls:'customClass'},{text:'Plantation – Massif boisé',id:'terr_aff_plant',icon:'mapfishModelPeitrequin/img/affectation_plantation.png',iconCls:'customClass'}]}]},{layerName:'CN25_wms',id:'fond_cn',text:"Carte nationale (>5'000)",iconCls:'voidIcon',checked:false},{layerName:'imageswiss',id:'fond_photo',text:"Orthophotos",iconCls:'voidIcon',checked:true},{layerName:'white_layer',id:'fond_none',text:"Pas de fond de carte",iconCls:'voidIcon',checked:false}];this.olLayers=[new OpenLayers.Layer.WMS("Vecteur",this.applicativeLayerSource,{layers:['movd_cad_couv_foret','movd_cad_couv_eau','GrpConstruction','cad_bat_ss_cadastre','cad_bat_hs_cadastre','GrpZoneProtectionEaux','GrpSectProtectionEaux','Affectation','movd_cad_couv_divers','movd_cad_couv','cad_parv','GrpAssainissPrinEU','GrpAssainissPrinEC','GrpEauPotablePrin','GrpEauPotablePriv','cad_parv_point','SitVoAdressPoint','GrpAssainissPrivEU','GrpAssainissPrivEC','cad_parv_numero'],format:'image/png'},{isBaseLayer:false,visibility:true,alpha:true,buffer:0,ratio:1}),new OpenLayers.Layer("white_layer",{isBaseLayer:true,visibility:false}),new OpenLayers.Layer.TileCache("CN25_wms",this.main.config.commonTilecacheDirectUrl,'CN25',{maxExtent:new OpenLayers.Bounds(480000,122000,515000,158000),isBaseLayer:true,format:'image/jpeg',buffer:0,opacity:0.75}),new OpenLayers.Layer.TileCache("imageswiss",this.main.config.commonTilecacheDirectUrl,'imageswiss',{maxExtent:new OpenLayers.Bounds(480000,122000,515000,158000),isBaseLayer:true,format:'image/jpeg',buffer:0,opacity:0.75})];},getOverviewMap:function(){return new OpenLayers.Layer.Image("overview","ressources/keymap.png",new OpenLayers.Bounds(485000,65000,835000,298000),new OpenLayers.Size(150,99));},getModel:function(){return this.mfModel;},getOlLayers:function(){return this.olLayers;},getOlOverviewMapLayer:function(){return this.olOverviewMapLayer;},getLayerTree:function(){return this.main.layout.accordion.findById('layertree');},getPrintOverrides:function(){return{'Vecteur':{baseURL:this.main.config.WMSUrl}};}});ModelLayout=OpenLayers.Class({main:null,toolbar:{},accordion:{},mapComponent:{},treePanel:null,initialize:function(main){this.main=main;new Ext.Viewport({layout:'border',defaultType:'panel',items:[this.getViewportNorthItem(),this.getViewportCenterItem()]});this.initToolbarContent();},getViewportNorthItem:function(){return new Ext.BoxComponent({region:'north',el:'north'});},getViewportSouthItem:function(){return new Ext.BoxComponent({region:'south',el:'south'});},getViewportCenterItem:function(){return{region:'center',border:false,layout:'border',margins:'5 5 5 5',items:[this.getAccordion(),this.getPayload()]};},getPayload:function(){return{layout:'border',region:'center',border:false,margins:'0 0 0 0',items:[this.getMapComponent()]};},addSeparator:function(){this.toolbar.add(new Ext.Toolbar.Spacer());this.toolbar.add(new Ext.Toolbar.Separator());this.toolbar.add(new Ext.Toolbar.Spacer());},getToolbar:function(){this.toolbar=new mapfish.widgets.toolbar.Toolbar({map:this.main.map.map,configurable:false});this.toolbar.autoHeight=false;this.toolbar.height=25;return this.toolbar;},initToolbarContent:function(){this.initBrowsingToolbar();this.addSeparator();this.initQueryToolbar();this.addSeparator();this.initMeasureToolbar();this.addSeparator();this.initNavigationToolbar();this.initLoadingToolbar();this.toolbar.activate();},initLoadingToolbar:function(){this.toolbar.add(new Ext.Toolbar.Fill());this.toolbar.add(new mapfish.widgets.LoadingIndicator({map:this.main.map.map}));},initBrowsingToolbar:function(){this.toolbar.addControl(new OpenLayers.Control.ZoomToInitialExtent({map:this.main.map.map,config:this.main.config,utils:this.main.map,title:OpenLayers.i18n('Vue general')}),{iconCls:'zoomfull',toggleGroup:'map'});this.toolbar.addControl(new OpenLayers.Control.ZoomBox({title:OpenLayers.i18n('Zoom avant')}),{iconCls:'zoomin',toggleGroup:'map'});this.toolbar.addControl(new OpenLayers.Control.ZoomBox({out:true,title:OpenLayers.i18n('Zoom arriere')}),{iconCls:'zoomout',toggleGroup:'map'});this.toolbar.addControl(new OpenLayers.Control.DragPan({isDefault:true,title:OpenLayers.i18n('Pan')}),{iconCls:'pan',toggleGroup:'map'});},initMeasureToolbar:function(){this.toolbar.addControl(this.main.measure.getLengthCalculator(),{iconCls:'calculateLength',tooltip:OpenLayers.i18n('Distance measurement (double-click to terminate)'),toggleGroup:'map'});this.toolbar.addControl(this.main.measure.getAreaCalculator(),{iconCls:'calculateArea',tooltip:OpenLayers.i18n('Area measurement (double-click to terminate)'),toggleGroup:'map'});},initNavigationToolbar:function(){var nav=new OpenLayers.Control.NavigationHistory();this.main.map.map.addControl(nav);nav.activate();var listeners={activate:function(){this.enable();},deactivate:function(){this.disable();}};var back=this.toolbar.addButton({iconCls:'back',tooltip:OpenLayers.i18n('Previous view'),handler:nav.previous.trigger,disabled:true});nav.previous.events.on(OpenLayers.Util.extend(listeners,{scope:back}));var next=this.toolbar.addButton({iconCls:'next',tooltip:OpenLayers.i18n('Next view'),handler:nav.next.trigger,disabled:true});nav.next.events.on(OpenLayers.Util.extend(listeners,{scope:next}));},initQueryToolbar:function(){this.toolbar.addControl(Ext.getCmp('searcher').control,{iconCls:'interrogations',toggleGroup:'map',tooltip:OpenLayers.i18n('searcher')});},getMapComponent:function(){return{region:'center',xtype:'mapcomponent',map:this.main.map.map,tbar:this.getToolbar(),bbar:this.getMapInfo()};},getMapInfo:function(){return new Ext.BoxComponent({el:'mapinfo'});},getQueryResults:function(){return{region:'south',id:'queryResults',height:200,split:true,collapsible:true,collapsed:true,collapseMode:'mini',animCollapse:false,border:false};},initTreePanel:function(){this.treePanel=new mapfish.widgets.LayerTree({title:OpenLayers.i18n('Layer Tree'),id:'layertree',border:false,frame:false,autoHeight:true,bodyStyle:'padding: 3px;',map:this.main.map.map,model:this.main.layertree.getModel(),plugins:[mapfish.widgets.LayerTree.createContextualMenuPlugin(['opacitySlideDirect']),mapfish.widgets.LayerTree.createDisableLayersPlugin(254)]});return this.treePanel;},initLocatePeitrequin:function(){return{title:OpenLayers.i18n('Locate'),id:'locate',labelAlign:'top',xtype:'searchservicepeintrequin',border:false,defaultZoom:4,defaults:{anchor:'100%'},showCenter:true,map:this.main.map.map};},initPrintPanel:function(){return{title:OpenLayers.i18n('Print'),xtype:'print-simple',configUrl:this.main.config.printUrl+'/info.json',overrides:this.main.layertree.getPrintOverrides(),serviceParams:{locale:this.main.getLocale()},layerTree:this.treePanel,formConfig:{labelAlign:'top',defaults:{anchor:'100%'},items:[{xtype:'textfield',fieldLabel:OpenLayers.i18n('mf.print.mapTitle'),name:'mapTitle'},{xtype:'textarea',fieldLabel:OpenLayers.i18n('mf.print.comment'),name:'comment',height:50},{xtype:'hidden',name:'lang'+OpenLayers.Lang.getCode(),value:true},{xtype:'hidden',name:'copyright',id:'printCopyright',value:$('copyright').innerHTML}]}};},initQueryPeitrequin:function(){return{title:OpenLayers.i18n('Interrogation'),id:'searcher',xtype:'searcherpeitrequin',labelAlign:'top',border:false,layout:'fit',defaults:{anchor:'100%'},map:this.main.map.map};},initOverviewMapPanel:function(){return{title:OpenLayers.i18n('Overview Map'),contentEl:'overviewmap'};},getAccordion:function(){return{region:'west',collapsible:true,collapseMode:'mini',animCollapse:false,split:true,layout:'accordion',autoScroll:true,border:false,width:300,minSize:100,maxSize:380,layoutConfig:{animate:true},defaults:{border:false,frame:false,width:'auto',bodyStyle:'padding: 3px;',map:this.main.map.map},items:this.getPanels()};},getPanels:function(){return[this.initTreePanel(),this.initPrintPanel(),this.initLocatePeitrequin(),this.initQueryPeitrequin()];}});mapfish.widgets.LoadingIndicator=function(config){this.map=config.map;config.text=config.text?config.text:Ext.LoadMask.prototype.msg;mapfish.widgets.LoadingIndicator.superclass.constructor.call(this,config);Ext.get(this.el).addClass('loading');var listners={loadstart:this.increaseCounter,loadend:this.decreaseCounter,scope:this};this.map.events.on({preaddlayer:function(evt){if(evt.layer){evt.layer.events.on(listners);}},scope:this});for(var i=0;i<this.map.layers.length;i++){this.map.layers[i].events.on(listners);}};Ext.extend(mapfish.widgets.LoadingIndicator,Ext.Toolbar.TextItem,{counter:0,render:function(e){mapfish.widgets.LoadingIndicator.superclass.render.call(this,e);this.hide();},increaseCounter:function(evt){this.counter++;if(this.counter>0){this.show();}},decreaseCounter:function(evt){if(this.counter>0){this.counter--;}
if(this.counter==0){this.hide();}}});OpenLayers.Control.ZoomToInitialExtent=OpenLayers.Class(OpenLayers.Control,{config:null,utils:null,type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){if(this.config.initialExtent){var initialBounds=new OpenLayers.Bounds.fromArray(this.config.initialExtent);this.map.zoomToExtent(initialBounds);}else if(this.config.initialScale){if(this.config.initialLonLat){var target=new OpenLayers.LonLat(this.config.initialLonLat[0],this.config.initialLonLat[1]);}else{var initialBounds=new OpenLayers.Bounds.fromArray(this.config.maxExtent);var target=initialBounds.getCenterLonLat();}
this.map.moveTo(target,this.utils.getZoomForScale(this.config.initialScale));}else{this.map.zoomToMaxExtent();}}},CLASS_NAME:"OpenLayers.Control.ZoomToInitialExtent"});ModelMeasure=OpenLayers.Class({main:null,prevPopup:null,options:null,lengthCalculator:null,areaCalculator:null,initialize:function(main){this.main=main;},getOptions:function(){if(!this.options){this.options={handlerOptions:{style:"default",layerOptions:{styleMap:this.getStyleMap()},persist:true},eventListeners:{'measure':this.renderMeasure,'measurepartial':this.clearMeasure,'deactivate':this.clearMeasure},scope:this};}
return this.options;},clearMeasure:function(){var th=this.scope||this;if(th.prevPopup){th.prevPopup.close();}
th.prevPopup=null;},createPopup:function(value){this.clearMeasure();var html=value;var popup=new Ext.Window({title:OpenLayers.i18n('Measure'),html:html,width:150,bodyStyle:'background-color: #FFFFD0;'});this.prevPopup=popup;popup.show();},renderMeasure:function(event){function calcVincenty(geometry){var dist=0;for(var i=1,l=geometry.components.length;i<l;i++){var first=geometry.components[i-1];var second=geometry.components[i];dist+=OpenLayers.Util.distVincenty({lon:first.x,lat:first.y},{lon:second.x,lat:second.y});}
return dist;}
var th=this.scope||this;var geometry=event.geometry;var units=event.units;var order=event.order;var measure=event.measure;var out="";if(order==1){out+=measure.toFixed(3)+" "+units;if(th.main.map.map.getProjection()=="EPSG:4326"){out+='<br />';out+='<a href="';out+=OpenLayers.i18n('http://en.wikipedia.org/wiki/Great_circle');out+='" target="_blank">';out+=OpenLayers.i18n('Great Circle Distance');out+='</a>: ';out+=calcVincenty(geometry).toFixed(3)+" km";}}else{out+=measure.toFixed(3)+" "+units+"<sup>2</sup>";}
th.createPopup(out);},getStyleMap:function(){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#FFFF00"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#FFFF00"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#FFFF00",fillColor:"white",fillOpacity:0.3}};var style=new OpenLayers.Style();style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);return new OpenLayers.StyleMap({"default":style});},getLengthCalculator:function(){if(!this.lengthCalculator){this.lengthCalculator=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,this.getOptions());}
return this.lengthCalculator;},getAreaCalculator:function(){if(!this.areaCalculator){this.areaCalculator=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,this.getOptions());}
return this.areaCalculator;}});ModelLayerTree.prototype.getOlOverviewMapLayer=function(){return new OpenLayers.Layer.Image("overview","mapfishModelPeitrequin/ressources/keymap.png",new OpenLayers.Bounds(485000,65000,835000,298000),new OpenLayers.Size(150,99));};ModelLayerTree.prototype.getModel=function(){this.mfModel[1].children.push({layerName:'Vecteur:GrpCandelabre',text:'Candelabres',leaf:true,checked:false,iconCls:'voidIcon',maxScale:2000,children:[{text:'Candélabre 1',iconCls:'customClass',icon:'img/Candelabre_2_icon.png'},{text:'Candélabre 2',iconCls:'customClass',icon:'img/Candelabre_1_icon.png'}]});this.mfModel[1].children.push({layerName:'Vecteur:GrpContainer',text:'Containers',leaf:true,checked:false,iconCls:'customClass',maxScale:2001,icon:'img/Contener_icon.png'});return this.mfModel;}
ModelLayerTree.prototype.getOlLayers=function(){this.olLayers[0]=new OpenLayers.Layer.WMS("Vecteur",this.applicativeLayerSource,{layers:['GrpZoneProtectionEaux','GrpConstruction','cad_bat_ss_cadastre','cad_bat_hs_cadastre','Affectation','movd_cad_couv_foret','movd_cad_couv_eau','movd_cad_couv_divers','movd_cad_couv','cad_parv','GrpAssainissPrinEU','GrpAssainissPrinEC','GrpEauPotablePrin','GrpEauPotablePriv','GrpSectProtectionEaux','cad_parv_point','SitVoAdressPoint','GrpAssainissPrivEU','GrpAssainissPrivEC','GrpContainer','GrpCandelabre','cad_parv_numero','movd_cad_labels','movd_cad_labels_local'],format:'image/png'},{isBaseLayer:false,visibility:true,alpha:true,buffer:0,ratio:1})
return this.olLayers;}
Ext.namespace('mapfish.widgets','mapfish.widgets.recenter');mapfish.widgets.recenter.Wspparcelle=function(config){Ext.apply(this,config);mapfish.widgets.recenter.Wspparcelle.superclass.constructor.call(this);};Ext.extend(mapfish.widgets.recenter.Wspparcelle,mapfish.widgets.recenter.Base,{getParcelleInput:function(){return new Ext.form.TextField({fieldLabel:OpenLayers.i18n('Parcelle'),name:'parcelle',value:'',listeners:{specialkey:function(textField,event){if(event.getKey()==event.ENTER){this.onParcelleInput(textField);}},scope:this}});},onParcelleInput:function(textField){if(!this.mask)this.initMask();this.mask.show();var tvalue=textField.getValue();if(tvalue==''){return;}
var url='parcelle/bbox/'+tvalue;OpenLayers.Request.GET({url:url,success:function(response){if(this.mask)this.mask.hide();var parser=new OpenLayers.Format.JSON();var bbox=parser.read(response.responseText);if(bbox==null){msg=OpenLayers.i18n('Parcelle non trouvee');this.showError(msg);return;}
var fbox=OpenLayers.Bounds.fromArray(bbox);this.recenterOnBbox(fbox);},failure:function(response){if(this.mask)this.mask.hide();var msg=this.errorMsg+"<br /><br />"+url+"<br /><br />";msg+=response.status+"<br />"+response.statusText;this.showError(msg);},scope:this});},initMask:function(){var mask=this.mask=new Ext.LoadMask(Ext.getCmp('locate').body,{msg:OpenLayers.Lang.translate('En chargement')});}});Ext.reg('searchservicepeintrequinparcelle',mapfish.widgets.recenter.Wspparcelle);Ext.namespace('mapfish.widgets','mapfish.widgets.recenter');mapfish.widgets.recenter.Wsp=function(config){Ext.apply(this,config);mapfish.widgets.recenter.Wsp.superclass.constructor.call(this);};Ext.extend(mapfish.widgets.recenter.Wsp,mapfish.widgets.recenter.Base,{wsRecenterstore:null,wsRecenterServicestore:null,wsRecenterCurrentService:null,errorMsg:OpenLayers.i18n('mf.recenter.ws.error'),currentWsRecenterCombo:null,storeAddress:null,storeNumero:null,selectedId:null,numeroCombo:null,addItems:function(){this.removeAll();this.selectedId=null;this.addressCombo=this.getAddressCombo();this.add(this.addressCombo);if(this.scales){this.addScaleCombo('Ws');}
foo=new mapfish.widgets.recenter.Wspparcelle;foo.map=this.map;this.parcelField=foo.getParcelleInput();this.add(this.parcelField);},getAddressCombo:function(){return new Ext.form.ComboBox({fieldLabel:OpenLayers.i18n('address'),name:'address',value:'',displayField:'voie',valueField:'id',mode:'remote',queryParam:'keyword',minChars:2,typeAhead:true,store:this.getStore('storeAddress'),listeners:{select:function(combo,record,index){this.onAddressSelect(combo);},specialkey:function(combo,event){if(event.getKey()==event.ENTER){this.onAddressSelect(combo);}},scope:this},forceSelection:true,hideTrigger:true});},getNumeroCombo:function(){return new Ext.form.ComboBox({id:'numeroCombo',fieldLabel:OpenLayers.i18n('numero'),name:'numero',value:'',displayField:'numero',valueField:'id',mode:'remote',queryParam:'numero',triggerAction:'all',editable:false,store:this.getStore('storeNumero'),listeners:{select:function(combo,record,index){this.onNumeroSelect(combo);},specialkey:function(combo,event){if(event.getKey()==event.ENTER){this.onNumeroSelect(combo);}},scope:this},forceSelection:true});},getTemplate:function(tplId){var tpl=new Ext.XTemplate('<tpl for=".">','<div class="x-combo-list-item">','<h3><span>{name}</span></h3>','</div>','</tpl>');return tpl;},getStore:function(storeId){if(!this.storeId){switch(storeId){case'storeAddress':this.initStoreAddress();break;case'storeNumero':this.initStoreNumero();break;}}
return this[storeId];},onAddressSelect:function(combo){if(combo.value.length==0){return;}
this.selectedId=combo.value;if(!this.numeroCombo){this.numeroCombo=this.getNumeroCombo();this.storeNumero.proxy.conn.method='POST';this.insert(1,this.numeroCombo);this.doLayout();}else{this.storeNumero.proxy.conn.url='adresse/numero/'+this.selectedId+'/';this.storeNumero.load();this.numeroCombo.reset();}},onNumeroSelect:function(combo){if(combo.value.length==0){return;}
OpenLayers.Request.GET({url:'adresse/location/'+combo.value+'/',success:function(response){var scale=1000;var zoom;var values=this.getForm().getValues();var f=new OpenLayers.Format.GeoJSON();var feature=f.read(response.responseText)[0];if(!feature){return;}
if(feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Polygon"&&!!feature.geometry.getBounds()){this.recenterOnBbox(feature.geometry.getBounds());}else if(feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"&&!!feature.geometry.x&&!!feature.geometry.y){var resolution=OpenLayers.Util.getResolutionFromScale(scale,this.map.units);zoom=this.map.getZoomForResolution(resolution);this.recenterOnCoords(feature.geometry.x,feature.geometry.y,zoom);}},failure:function(response){var msg=this.errorMsg+"<br /><br />"+url+"<br /><br />";msg+=response.status+"<br />"+response.statusText;this.showError(msg);},scope:this});},onWsRecenterSelect:function(combo){if(combo.value.length==0){return;}
var scaleField=this.wsRecenterCurrentService.scaleField||null;var url=this.wsRecenterCurrentService.url;url+=this.wsRecenterCurrentService.urlSuffixGeo+'?';url+=this.wsRecenterCurrentService.paramIdGeo+'='+combo.value;url+='&ref='+this.wsRecenterCurrentService.ref;url+=(scaleField)?'&scalefield='+(scaleField):'';OpenLayers.Request.GET({url:url,success:function(response){var values=this.getForm().getValues();var zoom;var f=new OpenLayers.Format.GeoJSON();var feature=f.read(response.responseText)[0];if(!feature){return;}
if(feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Polygon"&&!!feature.geometry.getBounds()){this.recenterOnBbox(feature.geometry.getBounds());}else if(feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"&&!!feature.geometry.x&&!!feature.geometry.y){if(this.scales&&values.scaleValue){var resolution=OpenLayers.Util.getResolutionFromScale(values.scaleValue,this.map.units);zoom=this.map.getZoomForResolution(resolution);}
if(scaleField){var scaleValue=feature.attributes[scaleField];var resolution=OpenLayers.Util.getResolutionFromScale(scaleValue,this.map.units);zoom=this.map.getZoomForResolution(resolution);}
this.recenterOnCoords(feature.geometry.x,feature.geometry.y,zoom);}},failure:function(response){var msg=this.errorMsg+"<br /><br />"+url+"<br /><br />";msg+=response.status+"<br />"+response.statusText;this.showError(msg);},scope:this});},initStoreAddress:function(){this.storeAddress=new Ext.data.JsonStore({url:'adresse/voie/',root:"results",id:"id",fields:['id','voie'],listeners:{loadexception:function(proxy,options,response){if(response.status<200||response.status>=300){var msg=this.errorMsg+"<br /><br />";msg+=this.wsRecenterstore.proxy.conn.url+"<br /><br />"
msg+=response.status+"<br />"+response.statusText;this.showError(msg);}},scope:this}});},initStoreNumero:function(){this.storeNumero=new Ext.data.JsonStore({url:'adresse/numero/'+this.selectedId+'/',root:"results",fields:['id','numero'],autoLoad:true,listeners:{loadexception:function(proxy,options,response){if(response.status<200||response.status>=300){var msg=this.errorMsg+"<br /><br />";msg+=this.wsRecenterstore.proxy.conn.url+"<br /><br />"
msg+=response.status+"<br />"+response.statusText;this.showError(msg);}},scope:this}});}});Ext.reg('searchservicepeintrequin',mapfish.widgets.recenter.Wsp);Ext.form.TriggerField.override({afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);var y;if(Ext.isIE&&!this.hideTrigger&&this.el.getY()!=(y=this.trigger.getY())){this.el.position();this.el.setY(y);}}});var SearcherPeitrequin=Ext.extend(Ext.Panel,{map:null,url:null,protocol:null,mediator:null,control:null,triggerEventProtocol:null,tree:null,mask:null,initComponent:function(){SearcherPeitrequin.superclass.initComponent.apply(this,arguments);this.protocol=new mapfish.Protocol.MapFish({url:"interrogations",params:{layers:this.getEnabledLayers,no_geom:true}});this.triggerEventProtocol=new mapfish.Protocol.TriggerEventDecorator({protocol:this.protocol});this.triggerEventProtocol.events.register('crudtriggered',this,function(){this.triggerEventProtocol.protocol.params.layers=this.getEnabledLayers();});this.triggerEventProtocol.events.register('crudfinished',this,this.onGotFeatures);var searcher=new mapfish.Searcher.Map({map:this.map,scope:this,searchTolerance:10,protocol:this.triggerEventProtocol});this.control=new SearchControl({searcher:searcher});},getEnabledLayers:function(){var layers=[];var olLayers=this.map.getLayersByClass('OpenLayers.Layer.WMS');for(var i=0;i<olLayers.length;++i){var cur=olLayers[i];if(cur.getVisibility()){for(var j=0;j<cur.params.LAYERS.length;++j){layers.push(cur.name+":"+cur.params.LAYERS[j]);}}}
return layers;},onGotFeatures:function(response){var features=response.features;this.clearTree();this.expand();if(!this.mask){this.mask=new Ext.LoadMask(this.getEl(),{msg:"En chargement..."});}
if(!features)return;this.mask.show();SearcherPeitrequin.features=features;var parentNodes={};var tree=this.getOrCreateTree();var root=tree.root;for(var i=0;i<features.length;++i){var feature=features[i];var type=feature.data.type_table;var parent=parentNodes[type];if(parent==null){var def=SearcherPeitrequin.tables[type];if(def==null)OpenLayers.Console.warn("Unknown table type: "+type);var text=def.plural;parent=new Ext.tree.TreeNode({id:type,text:text,leaf:false});root.appendChild(parent);parentNodes[type]=parent;}
parent.appendChild(this.createNode(feature,i+1));}
for(var key in parentNodes){var cur=parentNodes[key];var nbSub=cur.childNodes.length;cur.setText(cur.text+" ("+nbSub+")");if(nbSub<=1){cur.expand();}}
this.expand();this.mask.hide();},getOrCreateTree:function(){if(this.tree==null){var tree=this.tree=new Ext.tree.TreePanel({border:false,useArrows:true,autoScroll:true,containerScroll:true,rootVisible:false,root:new Ext.tree.TreeNode({id:0,text:'/',leaf:false})});this.add(tree)
this.doLayout();tree.on('click',this.nodeClick,this);}
return this.tree;},createNode:function(feature,id){var template=SearcherPeitrequin.tables[feature.data.type_table].treeTemplate;var html=template.applyTemplate(feature.data);var result=new Ext.tree.TreeNode({id:id,text:html,leaf:true});result.feature=feature;return result;},clearTree:function(){var tree=this.getOrCreateTree();var root=tree.root;var cur=null;while(root.childNodes.length>0){root.childNodes[0].remove()}},nodeClick:function(node,e){if(node.isLeaf()){this.showInfo(node);}},showInfo:function(node){var feature=node.feature;var type=feature.data.type_table;var template=SearcherPeitrequin.tables[type].detailTemplate;var html='<div class="interrogations-details">'+
template.applyTemplate(feature.data)+'</div>';var win=new Ext.Window({title:SearcherPeitrequin.tables[type].singular+': '+node.text,html:html,width:800,autoScroll:true,bodyStyle:'background-color: #FFFFD0;'});win.show(this);var el=win.body.first().last();win.setWidth(el.getSize(true).width+win.getFrameWidth());}});SearcherPeitrequin.tables={parcelles_polygon:{plural:'Parcelles',singular:'Parcelle',treeTemplate:new Ext.Template('<span>{pa_ident}</span>'),detailTemplate:new Ext.Template('<table>','<tr><th><b>Numéro de parcelle : </b></th><td>{pa_ident}</td></tr>','<tr><th><b>Surface technique [m²] : </b></th><td>{tech}</td></tr>','<tr><th><b>Registre Foncier : </b></th><td>{url}</a></td></tr>','</table>')}};var SearchControl=OpenLayers.Class(OpenLayers.Control,{searcher:null,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);},activate:function(){if(OpenLayers.Control.prototype.activate.call(this)){this.searcher.activate();}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.call(this)){this.searcher.deactivate();}},CLASS_NAME:'SearchControl'});Ext.reg('searcherpeitrequin',SearcherPeitrequin);