My favorites | Sign in
Project Logo
                
Show all Featured wiki pages:
SitesUsingjMaps Versions
People details
Project owners:
  digitalspaghetti

jMaps is a jQuery plugin that provides a really easy API to create and manage multiple google maps on any page.

News:

Also now tracking #jmaps on http://twitter.com/tanepiper

The full API Documentation and examples are available at http://map.ifies.org

Here is an example of how to use jMaps to create an address search facility:

jQuery(document).ready(function(){
    
    jQuery('#map1').jmap('init', {'mapType':'hybrid','mapCenter':[37.4419, -122.1419]});
    
    jQuery('#address-submit-1').click(function(){
        jQuery('#map1').jmap('SearchAddress', {
            'query': jQuery('#address').val(),
            'returnType': 'getLocations'
        }, function(result, options) {
            
            var valid = Mapifies.SearchCode(result.Status.code);
            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;	
    });
});








Hosted by Google Code