[Cartoweb-users] Generate email with map image

Oliver Christen oliver.christen at camptocamp.com
Fri May 29 09:24:08 EST 2009


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 at gmail.com>
To: <cartoweb-users at lists.maptools.org>
Sent: Thursday, April 16, 2009 6:20 AM
Subject: [Cartoweb-users] Generate email with map image


>
> Hi all,
>
> I am trying to put a "mailto:" link in cartoweb template so that when user
> clicks it, it will open Outlook and paste the map image automatically in 
> the
> body content.  My question is how can I paste the map image in the email?
> Should I set it in the "body" parameter of the mailto link?
>
> Thanks very much for any hints.
>
> Best regards,
> Jady
> -- 
> View this message in context: 
> http://www.nabble.com/Generate-email-with-map-image-tp23052002p23052002.html
> Sent from the cartoweb-users mailing list archive at Nabble.com.
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 



More information about the Cartoweb-users mailing list