我需要在Magento 1.9中嵌入Google map API v3:
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map-canvas"></div>
但是没有任何事情发生,因为Google map API v3与prototype.js冲突:
未捕获的TypeError:undefined不是函数
this.each(function(value, index) {
results.push(iterator.call(context, value, index));
});
return results;
}
如何解决此问题?