Use drupal.settings variables on javascript I'm using the Google Maps API on my website regarding restaurants.
The map loads when a restaurant has been selected.
I was initially using the google embed map, but I got some errors (e.g. markers not showing), so I switched to gm API.

How do I use a drupal.setting variable to a javascript? This is my code.

var myCenter = new google.maps.LatLng(Drupal.settings.eatery_geo.address);
function initialize() {
  var mapProp = {
    center:myCenter,
    zoom:16,
    mapTypeId:google.maps.MapTypeId.ROADMAP
  };

  var map = new google.maps.Map(document.getElementById("map-canvas"),mapProp);

  var marker = new google.maps.Marker({
    position:myCenter,
  });

  marker.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);


Where Drupal.settings.eatery_geo.address has the variable?

This doesn't seem to work; it only shows a blank &lt;div&gt;.
It gets its value from your PHP code. Here is an example of using drupal_add_js:

//Your module.php
$settings = array(
  'helloWorld' =&gt; array(
    'display' =&gt; 'alert',
    'message' =&gt; 'Hello World!',
  ),
);
drupal_add_js($settings, 'setting');


You can access the message in your JavaScript with Drupal.settings.helloWorld.message.