ASP with server-side scripting in map template

Ed McNierney ed at TOPOZONE.COM
Thu Jun 16 10:28:31 PDT 2005


Dave -
 
I'm not sure why that needs to become "ugly" - as long as you can
specify the map request via an HTTP GET request and querystring (and if
you can use the CGI template mechanism you can, by definition, do that)
you should be OK.
 
You can certainly have your ASP code make ONE request to the CGI program
in "browse" mode and then - instead of returning the generated HTML to
the client - capture the generated HTML and parse it.  This can be very
easy to do, since you simplify your template file to onlye be a list of
MapServer template variables, one per line or something.  You then just
get a short text file returned to your ASP page with all the "answers"
in it, including the URLs of any map images generated for you.
 
    - 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 


________________________________

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of David Shorthouse
Sent: Thursday, June 16, 2005 1:20 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] ASP with server-side scripting in map
template


Ed,
 
    Thanks for the suggestions. I now understand why it won't work as I
had hoped. Your solution is probably the best for what I want to do but
will get really ugly really fast. One layer in my map file comes as a
result of a virtual connection to an Access db via an ovf file and DSN.
I guess I'll just have to stick with what I have an be happy with it.
 
    What I was attempting to do was not only pull some x and y
coordinates from the Access db via the virtual connection but also pull
the contents of a timestamp field from the same db. I suppose I could
make a second layer and a second virtual connection. This however, might
be a drain on my server with every pan and zoom the client performs.
 
Thanks,
 
Dave


________________________________

	From: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Ed McNierney
	Sent: Thursday, June 16, 2005 9:57 AM
	To: MAPSERVER-USERS at LISTS.UMN.EDU
	Subject: Re: [UMN_MAPSERVER-USERS] ASP with server-side
scripting in map template
	
	
	David -
	 
	No, you can't do that.  Your Web server will run one
processor/handler for each page request.  You're essentially trying to
send *one* HTTP request to a CGI program, and then have the ASP output
of that program treated as if it were an ASP source page, and run
through the ASP processor.  That's double-dipping.
	 
	However, most of the MapServer template functionality allows you
to do pretty powerful things WITHOUT a scripting language.  If you've
already got a scripting language like ASP, you can just do those things
in ASP.
	 
	The easiest way (IMHO) to do this is to have your ASP code
generate the "template" output, and insert the appropriate IMG tags with
SRC properties specifying MapServer CGI requests, like:
	 
	<img src="mapserv.exe?mode=scalebar&....">
	 
	where you'd like to insert the scalebar in the output HTML
generated by your ASP page.
	 
	     - 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 

________________________________

	From: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of David Shorthouse
	Sent: Thursday, June 16, 2005 10:25 AM
	To: MAPSERVER-USERS at LISTS.UMN.EDU
	Subject: [UMN_MAPSERVER-USERS] ASP with server-side scripting in
map template
	
	
	
	Hey folks,
	 
	    Is it possible to include server-side vbscript on a map
template? MapServer can use .asp as a map template, but nothing is done
with the scripting I tried to include. In fact, if you look at the
source of the resultant page, the vbscript is clearly visible. My
problem is that I'm stuck with asp and there are a few things I would
like to add to the map template that would be more efficient to do via
vbscript than a MapServer layer.
	 
	Thanks for any advice,
	 
	David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050616/7c173708/attachment.htm>


More information about the MapServer-users mailing list