0

this is what i want onclick:

my map

this is what i get onclick:getting this image

Im using this script for capturing image in php:

<script type="text/javascript"> 
    $(function()
        {           
            $('#capture').click(function(){
                //get the div content
                //proxy: "html2canvasproxy.php",
                useCORS: true,
                div_content = document.querySelector("#map_canvas")
                //make it as html5 canvas
                html2canvas(div_content).then(function(canvas) {
                    //change the canvas to jpeg image
                    data = canvas.toDataURL('image/jpeg');                  
                    //then call a super hero php to save the image
                    save_img(data);
                });
            });         
        });     
    function save_img(data)
        {           
            $.post('save_jpg.php', {data: data}, function(res)
            {               
                if(res != '')
                {
                    yes = confirm('File saved in output folder, click ok to see it!');          
                }
                else
                {
                    alert('something wrong');
                }
            });
        }
</script>

as you can see if i used proxy that i download from github nothing will capture. and if i comment that part map will capture but not as per my conditions. Im using it on live server with php html5 and css3

mahadev sutar
  • 171
  • 2
  • 16

0 Answers0