2

Update: Based on the OVER_QUERY_LIMIT recommendation, I found a potentially promising solution that I will try tonight.

Initially I could not get a Google Map API v3 to display on my PC. The same code worked on an Amazon server. I've moved to Rackspace and now it doesn't display. Here's the code I'm using:

<script  type="text/javascript"
  src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBiv-nrDCYEEGzD1mk3jAfapfrBH878pqc&sensor=true">
</script>
<script>
  var geocoder;
  var map;
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var phpAddressInit = "<?php echo $mapAddress ?>";
    //document.write("phpAddressInit: " + phpAddressInit);
    //var latlng = new google.maps.LatLng(-34.397, 150.644);
    var latlng = new google.maps.LatLng(33.5750, -117.7256);
    var mapOptions = {
      zoom: 10,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
    geocoder.geocode( { 'address': phpAddressInit}, function(results, status) {
      //alert("---address3: " + phpAddressInit);
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert('Geocode was not successful for the following reason: ' + status);
      }
    });
  }

  function codeAddress(control,ctrlAddress) {
    //alert("---in codeAddress; " + "control: " + control
    //      + "ctrlAddress: " + ctrlAddress);
    //var address = document.getElementById('address').value;
    //aws.push
    var address;
    if ( control == 1 )
    {
        address = document.getElementById('address').value;
    }
    else
    {
        address = ctrlAddress;
    }

    geocoder = new google.maps.Geocoder();
      //alert("---address1: " + address);
    geocoder.geocode( { 'address': address}, function(results, status) {
      //alert("---address2: " + address);
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert('Geocode was not successful for the following reason: ' + status);
      }
    });
  }
</script>

...

I've googled this for several hours, tried several different examples, but it won't display. What am I missing?

j0k
  • 22,600
  • 28
  • 79
  • 90
  • possible duplicate of [Google Maps Geocode Status OVER\_QUERY\_LIMIT](http://stackoverflow.com/questions/14782496/google-maps-geocode-status-over-query-limit) – geocodezip Jun 09 '13 at 05:27
  • Do you call the initialize function somewhere? Perhaps adding `google.maps.event.addDomListener(window, 'load', initialize);` to the end of your script code might work. – J. Rahmati Jun 09 '13 at 07:43
  • please give us a link to the page – Dr.Molle Jun 09 '13 at 15:41
  • No, that's the only place. I did try what you recommended but it didn't work. Since it worked on my Amazon Linux server, I have to believe the code works and it's an environmental problem. I see the query limit recommendations on this question which I will try later today. Although I know I couldn't have exceeded the limit, I've seen stranger things. Thanks for your help. – Brad Hummel Jun 09 '13 at 15:44
  • Dr. Molle, the page is lightly protected. Go to http://www.myjitmate.com/jm-main/login.php , login as user: guest, password: glass123 . Click on the large "hallway" image or go to http://www.myjitmate.com/fe/html/view-lc-pop.php . That's the page with the Google Map. Sorry for the inconvenience. Thanks for looking at this. – Brad Hummel Jun 09 '13 at 16:15
  • Your are using https to access the Google Maps API. Try to use plain http and check if you have any firewall/certificate restrictions on the system where your code does not work. – FrVaBe Jun 10 '13 at 06:33
  • I've just trying to log on your web site and the map is displayed on the page http://www.myjitmate.com/fe/html/view-lc-pop.php The problem is it still relevant? – Seb P Jun 11 '13 at 16:55
  • Thanks Seb P. I just tried it and it works now. I went back to the original code last night and it didn't work; it hasn't changed since. I still consider it a problem but not sure how to fix it. Problem may be related to Rackspace and the manner in which IP addresses are grouped together for multiple users. – Brad Hummel Jun 11 '13 at 17:36

1 Answers1

0

Seb P made me aware it is working now. Thank you, it is working now.

Still using the original code that didn't work so I can't say with confidence that the problem is fixed. Looking through links associated with OVER_QUERY_LIMIT, Rackspace seems to group users together to use the same IP leading to this error.

None of this is confirmed but that seems to fit with what I am seeing. It would be nice if someone could shed more light on this so that this problem can be avoided.