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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
,createMap: function() {
function createIgnLayer(couche,opacite,LayerBase,extentMax){
if(couche==null){
setTimeout('createIgnLayer('+couche+','+opacite+','+LayerBase+','+extentMax+');',300);
return;
}
couche.options.opacity = opacite;
couche.options.isBaseLayer = LayerBase;
couche.options.maxExtent = extentMax;
couche.transitionEffect= 'resize';
var ignLayer = new couche.classLayer(
OpenLayers.i18n(couche.options.name),
couche.url,
couche.params,
couche.options);
return ignLayer
};
var id = Ext.id();
Ext.DomHelper.append(Ext.getBody(), {tag: 'div', cn: {tag: 'div', id: id}, style:'visibility: hidden'});
map = new OpenLayers.Map(id
,OpenLayers.Util.extend({
maxResolution: resolution_max
,numZoomLevels: num_zoom_levels
,projection: 'EPSG:3857'
// ,projection: 'EPSG:310024001'
,units: 'meters'
,maxExtent: extent_max
,controls:[
new Geoportal.Control.TermsOfService()
,new Geoportal.Control.PermanentLogo()
,new OpenLayers.Control.ScaleLine()
,new OpenLayers.Control.MousePosition({
prefix: "Lambert 93 : x = "
,suffix: " m"
,separator: " m, y = "
,displayProjection: new OpenLayers.Projection("IGNF:LAMB93")
,numDigits: 0
,emptyString: ''
})
,new OpenLayers.Control.KeyboardDefaults()
,new OpenLayers.Control.Attribution()
,new OpenLayers.Control.Navigation()
]
}
,gGEOPORTALRIGHTSMANAGEMENT)
);
maMap = map;//debug
// get IGNF's catalogue :
var cat = new Geoportal.Catalogue(map,gGEOPORTALRIGHTSMANAGEMENT);
var zon = cat.getTerritory('EUE');
// get Geoportail layer's parameters :
var scanOpts= cat.getLayerParameters(zon, 'GEOGRAPHICALGRIDSYSTEMS.MAPS');
var orthoOpts= cat.getLayerParameters(zon, 'ORTHOIMAGERY.ORTHOPHOTOS');
var cadastreOpts= cat.getLayerParameters(zon, 'CADASTRALPARCELS.PARCELS');
// var etatmajorOpts= cat.getLayerParameters(zon, 'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40');
//create layers
var scan = createIgnLayer(scanOpts,1.0,true,extent_max);
var ortho = createIgnLayer(orthoOpts,1.0,false,extent_max);
var cadastre = createIgnLayer(cadastreOpts,null,false,extent_max);
// var etatmajor = createIgnLayer(etatmajorOpts,1.0,false,extent_max);
// map.addLayers([scan,ortho,cadastre,etatmajor]);
map.addLayers([scan,ortho,cadastre]);
var overlay = new OpenLayers.Layer.WMS("overlay",
"/faun/faun"
,{
layers: [
'znieff2'
,'znieff1'
,'coeur'
,'aoa'
, 'ab'
,'reservesnat'
,'reservesint'
, 'reserveschasse'
, 'sitesinscrits'
, 'sitesclasses'
, 'n2000'
,'communes'
,'secteurs'
,'unitesgeo'
]
,transparent: true
,projection:'EPSG:3857'
,units: 'meters'
,maxResolution: resolution_max
,maxExtent: extent_max
,statuscode: application.synthese.user.statuscode
}
,{singleTile: true}
);
map.addLayers([overlay]);
this.searchVectorLayer = new OpenLayers.Layer.Vector('search_vector_layer', {
style: {
fillColor: "#000000"
,strokeColor: "#ff0000"
,cursor: "pointer"
,fillOpacity: 0.1
,strokeOpacity: 1
,strokeWidth: 2
,pointRadius: 8
}
,styleMap: new OpenLayers.StyleMap({
temporary: new OpenLayers.Style({
strokeWidth: 2
,strokeColor: "#ffa500"
,fillOpacity: 0.2
})
})
});
map.addLayers([this.searchVectorLayer]);
this.selectFeatureControl = new OpenLayers.Control.SelectFeature(this.searchVectorLayer, {});
map.addControl(this.selectFeatureControl);
this.selectFeatureControl.activate();
map.setCenter(centre_map, 13);
return map;
} |
Partager