Google maps api 3 当我点击一个按钮时,我怎么能抓拍谷歌地图呢?

Google maps api 3 当我点击一个按钮时,我怎么能抓拍谷歌地图呢?,google-maps-api-3,Google Maps Api 3,在这里,我被演示页面中的一个功能绊倒了。在这里,我想拍一张我能看到的快照(谷歌地图),它可以由用户调整 现在我想当我点击一个按钮时,我拍摄屏幕上看到的截图,然后在地图下方的窗口中打开这个截图,我还想下载这个截图 在这里,我可以把我的演示代码放在这里。在这个代码中,我可以插入那个代码,以及哪个代码对它有用 希望得到非常快的答复与积极的答复 提前谢谢你 我的代码是: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

在这里,我被演示页面中的一个功能绊倒了。在这里,我想拍一张我能看到的快照(谷歌地图),它可以由用户调整

现在我想当我点击一个按钮时,我拍摄屏幕上看到的截图,然后在地图下方的窗口中打开这个截图,我还想下载这个截图

在这里,我可以把我的演示代码放在这里。在这个代码中,我可以插入那个代码,以及哪个代码对它有用

希望得到非常快的答复与积极的答复

提前谢谢你

我的代码是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


var标记=[
{
“头衔”:“阿宾顿”,
“lat”:“40.803572”,
“液化天然气”:“-90.400770”,
“描述”:“阿宾顿是伊利诺伊州诺克斯县的一座城市,50英里(80公里)皮奥里亚以西。它是盖尔斯堡微利坦统计区的一部分。该市于1828年首次建立,并于1857年成立。1894年,普通弹簧捕鼠器的专利权授予了阿宾顿的威廉·胡克。1890年,1321人住在这里;1900年,2022年;1910年,2464人。2000年,人口为3612人人口普查。”
}
,
{
“标题”:“锡达拉皮兹”,
“lat”:“41.9831”,
“液化天然气”:“-91.6686”,
“说明”:“该市是爱荷华州东部繁荣的艺术和文化中心,拥有锡达拉皮兹艺术博物馆、捷克和斯洛伐克国家博物馆和图书馆、派拉蒙剧院、锡达拉皮兹剧院、爱荷华州非裔美国人历史博物馆和文化中心以及爱荷华州文化走廊联盟。锡达拉皮兹是爱荷华州的经济中心位于380号州际公路核心的州
}
,
{
“标题”:“芝加哥”,
“lat”:“41.8369”,
“液化天然气”:“-87.6847”,
“描述”:“芝加哥于1837年合并为一座城市,位于五大湖和密西西比河流域之间的一个交通枢纽附近,并于19世纪中期迅速发展。[7]这座城市是金融、商业、工业、技术、电信和运输的国际枢纽:以飞机流量衡量,奥哈雷国际机场是世界上最繁忙的机场;它还拥有数量最多的美国公路和铁路货运
}
,
{
“标题”:“奥兰公园”,
“lat”:“41.6073508”,
“液化天然气”:“-87.8616741”,
“描述”:“Orland Park是美国伊利诺伊州库克县的一个村庄,是芝加哥的一个中产阶级郊区,2010年人口为56767人。”
}
];
window.onload=函数(){
变量映射选项={
中心:新建google.maps.LatLng(标记[0].lat,标记[0].lng),
缩放:10,
mapTypeId:google.maps.mapTypeId.ROADMAP
};
var map=new google.maps.map(document.getElementById(“dvMap”)、mapOptions);
var infoWindow=new google.maps.infoWindow();
var lat_lng=新阵列();
var latlngbounds=new google.maps.latlngbounds();
对于(i=0;i

var markers = [
        {
            "title": 'Abingdon',
            "lat": '40.803572',
            "lng": '-90.400770',
            "description": 'Abingdon is a city in Knox County, Illinois, 50 miles (80 km) west of Peoria. It is part of the Galesburg Micropolitan Statistical Area. The city was first settled in 1828 and was incorporated in 1857. In 1894, the patent for the common spring-loaded mousetrap was awarded to William Hooker of Abingdon. In 1890, 1,321 people lived here; in 1900, 2,022; and in 1910, 2,464. The population was 3,612 at the 2000 census.'
        }
    ,
        {
            "title": 'Cedar Rapids',
            "lat": '41.9831',
            "lng": '-91.6686',
            "description": 'A flourishing center for arts and culture in Eastern Iowa, the city is home to the Cedar Rapids Museum of Art, the National Czech & Slovak Museum & Library, the Paramount Theatre, Theatre Cedar Rapids, the African-American Historical Museum and Cultural Center of Iowa, and the Iowa Cultural Corridor Alliance. Cedar Rapids is an economic hub of the state, located in the core of the Interstate 380.'
        }
    ,
        {
            "title": 'Chicago',
            "lat": '41.8369',
            "lng": '-87.6847',
            "description": 'Chicago was incorporated as a city in 1837, near a portage between the Great Lakes and the Mississippi River watershed, and grew rapidly in the mid-nineteenth century.[7] The city is an international hub for finance, commerce, industry, technology, telecommunications, and transportation: OHare International Airport is the busiest airport in the world when measured by aircraft traffic; it also has the largest number of U.S. highways and rail road freight.'
        }
    ,
        {
            "title": 'Orland Park',
            "lat": '41.6073508',
            "lng": '-87.8616741',
            "description": 'Orland Park is a village in Cook County, Illinois, United States, and a middle-class suburb of Chicago which in 2010 had a population of 56,767.'
        }
    ];
    window.onload = function () {
        var mapOptions = {
            center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
            zoom: 10,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
        var infoWindow = new google.maps.InfoWindow();
        var lat_lng = new Array();
        var latlngbounds = new google.maps.LatLngBounds();
        for (i = 0; i < markers.length; i++) {
            var data = markers[i]
            var myLatlng = new google.maps.LatLng(data.lat, data.lng);
            lat_lng.push(myLatlng);
            var marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                title: data.title
            });
            latlngbounds.extend(marker.position);
            (function (marker, data) {
                google.maps.event.addListener(marker, "click", function (e) {
                    infoWindow.setContent(data.description);
                    infoWindow.open(map, marker);
                });
            })(marker, data);
        }
        map.setCenter(latlngbounds.getCenter());
        map.fitBounds(latlngbounds);

        //***********ROUTING****************//

        //Intialize the Path Array
        var path = new google.maps.MVCArray();

        //Intialize the Direction Service
        var service = new google.maps.DirectionsService();

        //Set the Path Stroke Color
        var poly = new google.maps.Polyline({ map: map, strokeColor: '#252365' });

        //Loop and Draw Path Route between the Points on MAP
        for (var i = 0; i < lat_lng.length; i++) {
            if ((i + 1) < lat_lng.length) {
                var src = lat_lng[i];
                var des = lat_lng[i + 1];
                path.push(src);
                poly.setPath(path);
                service.route({
                    origin: src,
                    destination: des,
                    travelMode: google.maps.DirectionsTravelMode.DRIVING
                }, function (result, status) {
                    if (status == google.maps.DirectionsStatus.OK) {
                        for (var i = 0, len = result.routes[0].overview_path.length; i < len; i++) {
                            path.push(result.routes[0].overview_path[i]);
                        }
                    }
                });
            }
        }
    }
</script>
<div id="dvMap" style="width: 700px; height: 500px">
</div>