Click here to Skip to main content
15,921,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working on functionality to take snapshot of google map with polylines and open popup window on polyline click on google map.

snapshot of google map with polylines is working
but it will not able to take snapshot open popup window on polyline.

polyline are showing on sanpshot picture but info window are not showing .

here is code to take snapshot.

this code is to intialize the code control on javascript onload :

here is the method take snap to take the sanp shot of google map .

function takeSnap() {

//static map size
var sizeStr = "640x640";
var imgSize = "";
if (sizeStr != "") {
var sizeArray = sizeStr.split("x");
imgSize = new GSize(sizeArray[0], sizeArray[1]);
var format = "jpg";

var url = snapShotControl.getImage();
// document.getElementById("snapshot_canvas").src = url;


//this will add polyline overlay to draw line on google map with different color of polyline on google map .

var polyline = directionsArray[num].getPolyline();
polyline.setStrokeStyle({ color: streetColor, weight: 3, opacity: 0.7 });

///this code will open the pop info window on polyline those polyline created on google map

and problem is their these pop window not included on sanpshot when i take sanpshot of google map.

var MousePoint = "";
var marker;
GEvent.addListener(map, "mousemove", function (point) {
MousePoint = new GLatLng(, point.lng());


GEvent.addListener(polyline, "click", function () {
map.openInfoWindowHtml(MousePoint, headMarkerHtml);
GEvent.addListener(polyline, "mouseout", function () {
// map.closeInfoWindow();

can you please tell who i pass popup window in polyline overlay .

i have use javascript file snapshotcontrol.js to take the snapshot.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900