mixture of perl/mapscript and mapserver

Ed McNierney ed at TOPOZONE.COM
Fri Dec 17 15:24:46 PST 2004


Joseph -

It would be much more helpful if you could describe in some detail what
it is you're trying to do - then we can recommend the best solution,
rather than trying to patch up a solution that might have gotten off on
the wrong foot in the first place!

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 978 251-4242   Fax: +1 978 251-1396  

-----Original Message-----
From: Joseph Norris [mailto:sirronj at pacbell.net] 
Sent: Friday, December 17, 2004 6:07 PM
To: Ed McNierney; MAPSERVER-USERS at lists.umn.edu
Subject: RE: [UMN_MAPSERVER-USERS] mixture of perl/mapscript and
mapserver

Ed,

So in the scenario you mention below.  I would get a blank img that I
could lay layers on top of?  Currently I am pulling in the map file and
adding new layers to that.

#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print @c=map
chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,
14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at lists.umn.edu]On
Behalf Of Ed McNierney
Sent: Friday, December 17, 2004 1:45 PM
To: MAPSERVER-USERS at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] mixture of perl/mapscript and
mapserver

Joseph -

No, you're mixing apples and oranges.  Running MapServer through your
$url HTTP GET request simply fires off a different, completely unrelated
instance of MapServer.  IF you created a template file that consisted
solely of the single line

[img]

Then that HTTP GET request (executing MapServer) would return to you
nothing but the URL pointing to the map image it just created.  You can
then load that image file separately and do whatever you like with it.

But there's no "IMG" querystring variable to pass the name of an image
file - IMG.X and IMG.Y are CGI variables for passing the coordinates of
a mouse click.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Joseph Norris
Sent: Friday, December 17, 2004 4:37 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] mixture of perl/mapscript and mapserver

Everyone,

I have the following bit of code:

$layerObj->draw($map, $img);
$point_layer->draw($map, $img);


my $new_map = "$png_location/" . sprintf("mx%0.10d",rand(1000000000)) .
".map";

$map->save($new_map);

my $image_name = "$png_location/" .
sprintf("map%0.10d",rand(1000000000)) .
".png";


$img->save($image_name, $map);

$img->free();


my $url = qq!http://$domain/cgi-bin/mapserv!;
   $url .= "?map_web_template=$template_path/map_template.html";
   $url .= "&zoomsize=5";
   $url .= "&zoomdir=1";
   $url .= "&zoom=2";
   $url .= "&map=$new_map";
   $url .= "&map_web_imagepath=$png_location/";
   $url .= "&map_web_imageurl=/$http_png_location/";
   $url .= "&root=/maps/";
   $url .= "&img=$image_name";
   $url .= "&program=/cgi-bin/mapserv";
   $url .= "&imgext=5890870.385 -192053.200 8943310.847 3226086.749";
   $url .= "&mode=browse";


I thought that upon the run of mapserver in my map_template_html I would
be able to load the [img] via the &img=$image_name.  However when it
loads I am getting a whole new image that contains nothing and is not at
all the same name that I have built.

I am not sure how to mix these - I would like to start out building my
own layers  ( which I have been able to do - thanks to all of your help
), save these out in an image and the load this into mapserver so as to
have the browse capability.

Have I made myself clear as mud?

Thanks.


#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print @c=map
chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,
14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);



More information about the MapServer-users mailing list