## jMaps

This example shows you how easily jQuery + jMaps makes adding and removing streetviews from your map.

Google streetview allows you to define and add a flash-based streetview panorama to your map.

### Example 1: Simple Adding and Removing A Streetview.

Show Streetview | Hide Streetview

    jQuery(document).ready(function(){

    	var streetMapCenter = [40.74569634433956,-73.99635314941406];

    	jQuery('#map1').jmap('init', {'mapType':G_HYBRID_MAP,'mapCenter':streetMapCenter});

    	jQuery('.add-streetview').click(function(){
    		jQuery('#map1').jmap('CreateStreetviewPanorama', {
    			'latlng':streetMapCenter
    		}, function (view, options){
    			jQuery('.remove-streetview').click(function(){
    				jQuery('#map1').jmap('RemoveStreetviewPanorama', view);
    				jQuery('#map1').jmap('init', {'mapType':G_HYBRID_MAP,'mapCenter': streetMapCenter});
    				return false;
    			});
    		});
    		return false;
    	});
    });

### Example 2: Adding a Streetview to another DIV.

Add Streetview | Remove Streetview

    jQuery(document).ready(function(){

    	var streetMapCenter = [40.74569634433956,-73.99635314941406];

    	jQuery('#map2').jmap('init', {'mapType':G_HYBRID_MAP,'mapCenter':streetMapCenter});
    	jQuery('.add-streetview-2').click(function(){
    		jQuery('#map2').jmap('CreateStreetviewPanorama', {
    			'latlng':streetMapCenter,
    			'overideContainer': '#streetview'
    		}, function (view, options){
    			jQuery('.remove-streetview-2').click(function(){
    				jQuery('#map2').jmap('RemoveStreetviewPanorama', view);
    				return false;
    			});
    		});
    		return false;
    	});
    });