jQuery update Google Map
        Posted  
        
            by 
                Beardy
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Beardy
        
        
        
        Published on 2013-11-04T15:47:19Z
        Indexed on 
            2013/11/04
            15:53 UTC
        
        
        Read the original article
        Hit count: 274
        
I am trying to update a google map v3 with jQuery and at the moment it loads the map but when .preview is clicked the map scaled to the width and height and then goes grey.
$('.preview').click(function(){
    var width = $('#width').val();
    var height = $('#height').val();
    $('#map').css({
        'width':width,
        'height':height
    });
    var mapElement = document.getElementById('map');
    var updateOptions = {
        zoom: 6
    }
    var map = new google.maps.Map(mapElement, updateOptions);
});
© Stack Overflow or respective owner