Multiples Dominios key Google maps
function getHostname(str)
{
var re = new RegExp('^(?:f|ht)tp(?:s)?\://([^/]+)', 'im');
return str.match(re)[1].toString();
}
function GetKeyGoogleMaps()
{
var gMapKeys = new Array();
gMapKeys["www.misite.com"] = "ABQIAAAApBvstQUDNh9VQg0CvrbEmRRiTtBb6uXrC6esI_erwerwer34f2pcm6a1I41SH8WyCYJeGGg";
gMapKeys["www.misite2.com"] = "ABQIAAAApBvstQUDNh9VQg0CvrbEmRRiTtBb6uXrC6esI_erwerwer34fert874534845f22f1g2f1g";
var hostName = getHostname(document.location.href);
document.write("<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=" + gMapKeys[hostName] + "'>\n<\/script>");
document.write("<script type='text/javascript' src='http://www.google.com/uds/api?file=uds.js&v=1.0&key=" + gMapKeys[hostName] + "'>\n<\/script>");
// document.write("<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2&sensor=false&key=" + gMapKeys[hostName] + "'>\n<\/script>");
}
{
var re = new RegExp('^(?:f|ht)tp(?:s)?\://([^/]+)', 'im');
return str.match(re)[1].toString();
}
function GetKeyGoogleMaps()
{
var gMapKeys = new Array();
gMapKeys["www.misite.com"] = "ABQIAAAApBvstQUDNh9VQg0CvrbEmRRiTtBb6uXrC6esI_erwerwer34f2pcm6a1I41SH8WyCYJeGGg";
gMapKeys["www.misite2.com"] = "ABQIAAAApBvstQUDNh9VQg0CvrbEmRRiTtBb6uXrC6esI_erwerwer34fert874534845f22f1g2f1g";
var hostName = getHostname(document.location.href);
document.write("<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=" + gMapKeys[hostName] + "'>\n<\/script>");
document.write("<script type='text/javascript' src='http://www.google.com/uds/api?file=uds.js&v=1.0&key=" + gMapKeys[hostName] + "'>\n<\/script>");
// document.write("<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2&sensor=false&key=" + gMapKeys[hostName] + "'>\n<\/script>");
}
Comentarios