title: how to get directions using Google map v3 plugin for jQuery and jQuery Mobile?
body: <p>i am trying to get directions on a existing map. The <a href="https://code.google.com/p/jquery-ui-map/wiki/jquery_ui_map_v_3_api" rel="nofollow">documentation</a> leaded me to this:</p>
  
  <pre><code>function getDirections()
  {
      console.log('get directions');
      var map = $('#map');
      map.gmap().bind('init', function(evt, m) {
          map.gmap('displayDirections', { // error is here
              'origin': 'Los Angeles, USA',
              'destination': 'New York, USA',
              'travelMode': google.maps.DirectionsTravelMode.DRIVING
          }, {
              'map': map
          }, function(result, status) {
              if ( status === 'OK' ) {
                  alert('Results found!');
              }
          });
      });
  }
  </code></pre>
  
  <p>but this doesn't seem to do anything. I get an error <code>Uncaught Error: Invalid value for property &lt;map&gt;: [object Object]</code>.</p>
  
  <p>my objective is to load a map and click a button to show some directions.</p>
  
  <p>any ideas?</p>