[mapserver-users] What's the best solution (FWD)

Obe, Regina DND\MIS Regina.Obe.PFD at ci.boston.ma.us
Tue Feb 5 09:50:58 EST 2002


I think it depends on how seamless you want this.  To simply replace your
static ArcView maps with dynamically generated mapserver maps, you can use
the itemquerymap feature of mapserver which will give you the url to the
generated map image and then use this as the source of your img tag -
something like this

<img
src="/mapserv/scripts/mapserv35.exe?map=mapfilegoeshere&qlayer=layer_to_quer
y&mode=itemquerymap&layer=layer1&layer=layer2&some_query_field=some_query_va
lue">

Where the arguments 

layer_to_query is the layer defined in your map file that has a filter set

some_query_field is the name of the query field you have defined
some_query_value is the value to zoom the map to.

If you want to get one step fancier, you can put an A Href around the map
image, which would take the user to the map.  The HREF would use mode
itemquery instead of itemquerymap.


Also note in your map file for the template you can use a URL instead of a
mapserver template which would allow your user to go to an ASP page when
they click on a feature instead of a mapserver generated page.  Your
template statement in your map file would then look something like

TEMPLATE
"http://mywebserver/mydynamicpage.asp?myfield=[afieldinmaplayerdatatable]"

If you want it very integrated with your ASP pages, then you would go with
Richard's suggestion.  I would like to add to Richard's suggestion that if
you don't want to spend the money on the ASPHttp component, you can achieve
the same trick using the ServerXMLHTTP component that is built into IIS 5
(IIS 4 you might have to download the XML pack form microsoft's site, but it
is free at anyrate).

The syntax to use that would be something like  (note you might want to
check the manual since my syntax may be a bit off)

mapServerURL =
"http://myserver.com/cgi-bin/mapserv.exe?map=mymapfile.map&layer=" &
layername
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
' Opens the connection to the remote server.  You can do a post instead if
you wish and the 
' send syntax would then be something like xmlhttp.send "text you want to
post"

xmlhttp.Open "GET", mapServerURL, False
xmlhttp.send

mapServerHTML = xmlhttp.responseText









-----Original Message-----
From: Richard Greenwood [mailto:Rich at GreenwoodMap.com]
Sent: Monday, February 04, 2002 11:23 PM
To: mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] What's the best solution (FWD)


I'd be reluctant to say what the "best" way to do it was, but you should 
read Ed McNierney excellent discussion of calling mapserver from an asp
script:

http://mapserver.gis.umn.edu/wilma/mapserver-users/0112/msg00066.html

Rich

At 05:02 PM 2/4/2002 -0600, you wrote:

>------------- Begin Forwarded Message -------------
>
>From: "SergioVallejo" <sergio.vallejo at wanadoo.fr>
>To: <mapserver-info at lists.gis.umn.edu>
>Subject: What's the best solution
>Date: Mon, 4 Feb 2002 23:35:35 +0100
>MIME-Version: 1.0
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
>
>Good day
>
>My name is Sergio Vallejo. I'm developing a site that uses soil
>maps. Actually, all the maps are images that we generate from
>shape files of ARcview. We would like to use MapServer to create
>a dynamic map interface to interrogate the databases.
>
>All ours pages are in ASP/VBScript.
>
>Is their a simple solution in this case ?
>
>Sergio Vallejo
>2A rue Pierre de Coubertin
>30320 Marguerittes
>tél : 04 66 75 53 36
>e-mail : sergio.vallejo at wanadoo.fr
>
>------------- End Forwarded Message -------------


Richard W. Greenwood, PLS
Greenwood Mapping, Inc.
Rich at GreenwoodMap.com
(307) 733-0203
http://www.GreenwoodMap.com



More information about the mapserver-users mailing list