0

我想问一下我们是否可以创建带有方向的静态谷歌地图,并在邮件正文中发送带有该图像的电子邮件以及方向步骤。谢谢你。

更多信息:这将在 asp.net 中编码

4

1 回答 1

0

用您想要的值替换origindestination值,渲染

<!DOCTYPE html>
<html> 
<head> 
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
   <title>Google Maps API v3 Directions Example</title> 
   <script type="text/javascript" 
           src="http://maps.google.com/maps/api/js?sensor=false&language=de"></script>
</head> 
<body style="font-family: Arial; font-size: 12px;"> 
   <div style="width: 600px;">
     <div id="map" style="width: 400px; height: 400px; float: left;"></div> 
     <div id="panel" style="width: 400px; float: left;"></div> 
   </div>

   <script type="text/javascript"> 

     var directionsService = new google.maps.DirectionsService();
     var directionsDisplay = new google.maps.DirectionsRenderer();

     var map = new google.maps.Map(document.getElementById('map'), {
       zoom:7,
       mapTypeId: google.maps.MapTypeId.ROADMAP
     });

     directionsDisplay.setMap(map);
     directionsDisplay.setPanel(document.getElementById('panel'));

     var request = {
       origin: 'Im Soll 43d, Hamburg', 
       destination: 'Albada 13, Cala Llombards, Mallorca',
       travelMode: google.maps.DirectionsTravelMode.DRIVING
     };

     directionsService.route(request, function(response, status) {
       if (status == google.maps.DirectionsStatus.OK) {
         directionsDisplay.setDirections(response);
       }
     });
   </script> 
</body> 
</html>

在后台,从渲染的画布制作 PDF,邮寄 PDF。

于 2012-12-17T08:45:29.873 回答