Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery and Google Maps JS api not working together
    primarykey
    data
    text
    <p>I am really stuck trying to use both the Google Maps API and the JQuery API in the same block.. My page is jspx (Spring) and I need the JQuery so that I can get and parse google fusion table data. </p> <p>However, when I declare both libraries together the map div will not load (if I load Google Maps alone, all of the mapping works fine). </p> <p>Here is the relevant code:</p> <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.pack.js" type="text/javascript"/&gt; &lt;script src="http://maps.googleapis.com/maps/api/js?v=3key=MYKEY&amp;amp;sensor=false" type="text/javascript"&gt; &lt;jsp:text/&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var map; function initialize() { var mapDiv = document.getElementById('map_canvas'); var geocoder = new google.maps.Geocoder(); retrieveDeprivationFigure(); if (geocoder) { geocoder.geocode({ 'address': '${property.postcode}' }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { var latlng = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()) var mapOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); } function retrieveDeprivationFigure(){ var postcode = '${property.postcode}'.split(' ').join(''); var url = "https://www.googleapis.com/fusiontables/v1/query?sql=SELECT LSOA FROM XXXXXXXX WHERE Postcode='"+ postcode +"'&amp;key=AIzaSyBQaHw1aSWtIjQzAiriBPC3hvm7Bs1R35U&amp;jsonCallback=?"; var localIMDS; console.log("this far"); $.getJSON(url, function retrieveIMDS(){ console.log(url); }); }; google.maps.event.addDomListener(window, 'load', initialize); // ]]&gt; &lt;/script&gt; </code></pre> <p>Any pointers or ideas would help me greatly, I even tried retrieving the deprivation stat via JQuery in a seperate JS block, however despite my efforts, the function was not called on page load.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload