jMaps

This example shows you how easily jQuery + jMaps makes searching for directions.

Google Directions allows you to pass multiple points to search for directions.

Example: Searching directions.

Example: Searching directions Enter the query in the format From: [location] to: [location] to: [location]....
                        
jQuery(document).ready(function(){
    jQuery('#map1').jmap('init', {'mapType':G_HYBRID_MAP,'mapCenter':[37.4419, -122.1419]});
  
    jQuery('#query-submit-1').click(function(){
        jQuery('#map1').jmap('SearchDirections', {
            'query': jQuery('#query').val(),
            'panel':'#directions1'
        }, function(result, options) {
             var valid = Mapifies.SearchCode(result.getStatus());
             if (valid.success) {
               jQuery.each(result.Placemark, function(i, point){
                 jQuery('#map1').jmap('AddMarker',{
                   'pointLatLng':[point.Point.coordinates[1], point.Point.coordinates[0]],
                   'pointHTML':point.address
                 });
               });
             } else {
               jQuery('#address').val(valid.message);
             }
       });
       return false;	
    });
});