Saturday 22 August 2009 5:41:05 am
Hello, I thought that my gmaplocation was working fine but it was just working fine locally. Once I published my site on my domain space, I had this message :
The Google Maps Api server rejected your request. This could be
because the API key used on this site was registered for a different website. Here is the code of my override template used to display my Google Map localisation:
<div class="class-gallery">
<h1>{$node.name|wash()}</h1>
{section show=$node.data_map.image.content}
<div class="attribute-image">
{attribute_view_gui alignment=right image_class=medium attribute=$node.data_map.image}
</div>
{/section}
<div class="attribute-short">
{attribute_view_gui attribute=$node.data_map.description}
</div>
<p> </p>
{literal}
<script src="http://maps.google.com/maps?file=api&v=2.x&key={ezini('SiteSettings','GMapsKey')}" type="text/javascript"></script>
<script type="text/javascript">
function MapViewer_{/literal}{$node.node_id}{literal}()
{
{/literal}
var attribid = {$node.node_id};
var mapid = 'map_{$node.node_id}';
{if is_set($node.data_map.localisation.content.latitude)}
var lat = {$node.data_map.localisation.content.latitude};
var long = {$node.data_map.localisation.content.longitude};
{else}
var lat = 0.0;
var long = 0.0;
{/if}
{literal}
var map = null;
var geocoder = null;
var gmapExistingOnload = null;
var marker = null;
if (GBrowserIsCompatible())
{
var startPoint = new GLatLng(0,0);
var zoom = 0;
if(lat && long)
{
startPoint = new GLatLng(lat,long);
zoom=16
}
map = new GMap2(document.getElementById(mapid));
map.addControl(new GSmallMapControl());
map.setCenter(startPoint, zoom);
map.addOverlay(new GMarker(startPoint));
}
}
if (window.addEventListener)
{
{/literal}
window.addEventListener('load', MapViewer_{$node.node_id}, false);
{literal}
}
else if (window.attachEvent)
{
{/literal}
window.attachEvent('onload', MapViewer_{$node.node_id});
{literal}
}
{/literal}
</script>
I tried to enter the key directly in the code, but nothing. It works only on my local Macintosh. If someone can help, it would be great.
|