Embed Google Map in Colorbox
Hey all, I am using the following code to embed Google Maps in Colorbox but i am getting this error in Firebug console:
TypeError: window.initializeGeneral is not a function
not sure what's wrong here.. any ideas?
thanks in advance for your help
Andy
- jQuery(document).ready(function() {
-
- jQuery(".fmap").colorbox({
- html:'<div id="map_canvas_all" style="width:730px; height:550px;"></div>',
- scrolling:false,
- width:"750px",
- height:"570px",
- onComplete:function(){ loadScriptGeneral(); }
- });
- function loadScriptGeneral() {
- var script = document.createElement("script");
- script.type = "text/javascript";
- script.src = "http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false&callback=initializeGeneral";
- document.body.appendChild(script);
- };
- function initializeGeneral() {
- var imageG = new google.maps.MarkerImage('http://www.betaaa.com/images/pin.png',
- new google.maps.Size(20, 26),
- new google.maps.Point(0, 0),
- new google.maps.Point(0, 26)
- );
- var myLatlngG = new google.maps.LatLng(35.518421,24.018758);
- var myOptionsG = {
- zoom: 16,
- center: myLatlngG,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- }
- var mapG = new google.maps.Map(document.getElementById("map_canvas_all"), myOptionsG);
-
- var markerG = new google.maps.Marker({
- position: myLatlngG,
- map: mapG,
- title: "aaa",
- icon: imageG
- });
- };
- });