var map= null;
function geoportalLoadmap(idDivMap, mode, territoire, crs, dispcrs, proxy){
var options= new Object();
if(mode) options.mode= mode;
if(territoire) options.territory= territoire;
if(crs) options.projection= crs;
if(dispcrs) options.displayProjection= dispcrs;
if(proxy) options.proxy= proxy;
options.nameInstance= 'map';
options.apiKey= '8123755081098605204';
options.tokenServerUrl= 'http://jeton-api.ign.fr';
options.tokenTtl= 600;
map= new Geoportal.Map(idDivMap, options);
map.allowedGeoportalLayers= ['ORTHOIMAGERY.ORTHOPHOTOS','GEOGRAPHICALGRIDSYSTEMS.MAPS'];
Geoportal.Catalogue.prototype.urlServices.wmsc= 'http://wxs.ign.fr/geoportail/wmsc';
return map;
}
// Geoportal API version 1.0beta3()
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'http://api.ign.fr/geoportail/api/js/1.0beta3/Geoportal.js';
script.charset='utf-8';
script.defer= true;
script.onload= script.onreadystatechange= function(){
if(script.readyState && script.readyState!=4 && script.readyState!='loaded' && script.readyState!='complete'){return;}
script.onload= script.onreadystatechange= null;
if(typeof(initGeoportalMap)=='function'){initGeoportalMap();}else{
var save_callback= function(){};
if(typeof(window.onload)!='undefined'){save_callback= window.onload;}
window.onload= function() {
if(typeof(initGeoportalMap)=='function'){initGeoportalMap();}
if(save_callback != 'undefined' && save_callback!=null) {save_callback();}
};
}
};
//Useful only on FireFox (to have an error in case of a 404)
script.onerror= function() {throw ('The script ' + this.src + ' has not been found.');};
var nodes= document.getElementsByTagName('head');
var head= nodes.length>0? nodes[0]: document.body;
head.appendChild(script);

