Google map- What I am doing wrong

Discussion in 'Google API' started by Kivanc, Jul 3, 2010.

  1. #1
    I got my Google ID decades ago and embed the code on my web page. I had no problem displaying the map since then. But two days ago when I launch the google maps on my web page, the part of the screen that normally shows the map remains gray.

    Here is the code which I have embeded:
    
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAZ0siWEZVNHiFmraZijQZQRQuLP6W3V-H0ScFv63leCKFmQiNMhSjJKhtVApfmk6deJ4nLuclP4JqQg"
          type="text/javascript"></script>
     <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAZ0siWEZVNHiFmraZijQZQRQuLP6W3V-H0ScFv63leCKFmQiNMhSjJKhtVApfmk6deJ4nLuclP4JqQg"
          type="text/javascript"></script>
     <script src="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/src/markermanager.js"></script>
        <script type="text/javascript">
    
        //<![CDATA[
            
          var IMAGES = [ "sun", "rain", "snow", "storm" ];
        var ICONS = [];
        var map = null;
        var mgr = null;
    
          function createMarker(point, text) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click",
          function() {
          marker.openInfoWindowHtml(text);
          }
        );
        return marker;
    }
       
     function setupMap() {
          if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map"));
            map.setCenter(new GLatLng(39.82246, 33.3078, 11));
    
    var myLayer = new GLayer("org.wikipedia.en");
        map.addOverlay(myLayer);
     
    var point = new GLatLng(39.836915, 33.297372);
    
        var marker = createMarker(point,'<b>GüneşKöy</b><br /><img src="images/ice/img_0345.jpg" width=150 height=100>');
        map.addOverlay(marker);	
    
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl()); 
            map.enableDoubleClickZoom();
            window.setTimeout(setupWeatherMarkers, 0);
          }
        }
        
        function getWeatherIcon() {
          var i = Math.floor(IMAGES.length*Math.random());
          if (!ICONS[i]) {
            var icon = new GIcon();
            icon.image = "http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/examples/images/"
                + IMAGES[i] + ".png";
            icon.iconAnchor = new GPoint(16, 16);
            icon.infoWindowAnchor = new GPoint(16, 0);
            icon.iconSize = new GSize(32, 32);
            icon.shadow = "http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/examples/images/"
                + IMAGES[i] + "-shadow.png";
            icon.shadowSize = new GSize(59, 32);
            ICONS[i] = icon;
          }
          return ICONS[i];
        }
        
        function getRandomPoint() {
          var lat = 40.25 + (Math.random() - 0.5)*14.5; 
          var lng = 38.26 + (Math.random() - 0.5)*14.0; 
          return new GLatLng(Math.round(lat*10)/10, Math.round(lng*10)/10);
        }
    
    function getWeatherMarkers(n) {
          var batch = [];
          for (var i = 0; i < n; ++i) {
            batch.push(new GMarker(getRandomPoint(), { icon: getWeatherIcon() }));
          }
          return batch;
        }    
    
        
        function setupWeatherMarkers() {
          mgr = new MarkerManager(map);
          mgr.addMarkers(getWeatherMarkers(20), 3);
          mgr.addMarkers(getWeatherMarkers(200), 6);
          mgr.addMarkers(getWeatherMarkers(1000), 8);
          mgr.refresh();
        }
        //]]>
        </script>
         <body onload="setupMap()" onunload="GUnload()" style="font-family: Arial;border: 0 none;"> 
        <div id="map" style="margin: 5px auto; width: 500px; height: 400px"></div>
        <div style="text-align: center; font-size: large;">
        </div>
      </body>
    
    Code (markup):
    Thank you for your responds.
     
    Kivanc, Jul 3, 2010 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    QiSoftware, Jul 5, 2010 IP
  3. lkboy4u

    lkboy4u Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Seems to that your code is ok. Check with other issues related to your site, specially band with of your hosting place
     
    lkboy4u, Jul 24, 2010 IP
  4. Michael smith

    Michael smith Peon

    Messages:
    313
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i think code is too complicated try some other Google map code and host properly.
     
    Michael smith, Aug 2, 2010 IP
  5. switched

    switched Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    </script>
    <body onload="setupMap()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
    <div id="map" style="margin: 5px auto; width: 500px; height: 400px"></div>
    <div style="text-align: center; font-size: large;">
    </div>
    </body>

    i have see the first <body> and end </body> but where is the begin <header> and end of </header> ?
     
    switched, Aug 6, 2010 IP
  6. iMarketingGuru

    iMarketingGuru Well-Known Member

    Messages:
    486
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    160
    #6
    Simplify the code and get better hosting - dedicated if possible
     
    iMarketingGuru, Aug 9, 2010 IP