Hi
you can get a direct link to the map image using some javascript:
for (var i=0; i<mainmap.layers.length; i++) {
if (mainmap.layers[i].id == "raster") {
var imgpath = mainmap.layers[i].features[0].img;
}
}
imgpath = for example: generated/images/4a1fcdc7_607e_9.jpg
but the problem is the link will not be valid indefinitively, as all
Cartoweb server should include some cleaning script, erasing the map
generated every x hours/days to prevent the server hard disk to fill up
(resulting in an application not working anymore).
so you may end up senfing a link with may not work anymore or not for long
another way would be to use the exportImg plugin so people can do a
copy/past of the image into a email (or any other document editor)
it would not be automatic but that way you are sure of the email content
or, you could generate the email directly on the server and put the image
inside, using php this time
pick the solution you prefer
regards
Oliver
----- Original Message -----
From: "Jady" <
jadychow@...>
To: <
cartoweb-users@...>
Sent: Thursday, April 16, 2009 6:20 AM
Subject: [Cartoweb-users] Generate email with map image
_______________________________________________
Cartoweb-users mailing list
Cartoweb-users@...
http://lists.maptools.org/mailman/listinfo/cartoweb-users