我已经汇编了javascript代码,该代码将显示路线和路线。如何启用这些指示的打印选项?我经历了documentation,但是找不到任何允许用户打印路线的选项。
到目前为止,我已经绘制了一张地图,并在其旁边列出了方向。
是否有启用打印按钮的选项?
这是我的剧本。
function loadMapScenario() {
var map = new Microsoft.Maps.Map(document.getElementById("myMap"), {
/* No need to set credentials if already passed in URL */
center: new Microsoft.Maps.Location(40.418386, -80.019262),
zoom: 160 });
Microsoft.Maps.loadModule("Microsoft.Maps.Directions", function () {
var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
directionsManager.setRenderOptions(
{
itineraryContainer: document.getElementById("printoutPanel"),
displayDisclaimer:false,
showInputPanel:true,
drivingPolylineOptions:
{
strokeColor: 'green',
strokeThickness: 6
},
}
);
directionsManager.setRequestOptions({
routeMode: Microsoft.Maps.Directions.RouteMode.truck,
vehicleSpec: {
vehicleAxles: 3,
vehicleTrailers: 2,
vehicleSemi: true
}
});
var wp1 = new Microsoft.Maps.Directions.Waypoint({
address: "590 Crane Ave, Pittsburgh, PA",
location: new Microsoft.Maps.Location(40.419228, -80.018138)
});
var wp2 = new Microsoft.Maps.Directions.Waypoint({
address: "600 Forbes Ave, Pittsburgh, PA",
location: new Microsoft.Maps.Location(40.033230, 75.622310)
});
var wp3 = new Microsoft.Maps.Directions.Waypoint({
address: "600 Exton Commons, Exton, PA",
location: new Microsoft.Maps.Location(40.033230, 75.622310)
});
directionsManager.addWaypoint(wp1);
//directionsManager.addWaypoint(wp2);
directionsManager.addWaypoint(wp3);
directionsManager.calculateDirections();
});
$("#printoutPanel").hide();
$("#btnPrint").hide()
}