[mapserver-users] external links in a map

Richard Greenwood Rich at GreenwoodMap.com
Wed Sep 4 09:00:25 PDT 2002


At 10:37 AM 9/4/2002 +0100, you wrote:
>Hi all,
>
>Is there a way to include URL's / links into a map?
>For example: the user clicks on an object, symbol or label and the click 
>triggers the link.
>
>Thanks for all suggestions,
>
>Stefan

Put the URL in your TEMPLATE definition. Here's something I posted a year 
or so ago:


A TEMPLATE can be either a File or a URL. MapServer examines a template 
definition, decides  whether you have specified a File or a URL, and 
responds accordingly. For example;
      "Display_Results.html"
looks like a file and so will be processed as a file, but
     "http://www.some_domain.com/Index.html"
looks like a URL and so will be processed as a URL, which is quite a 
bit  different than how a File is processed.

If MapServer decides that it has a file template, it goes through the file 
and replaces stuff within [] with appropriate data. If the template is a 
URL, however, MapServer redirects to that URL. The URL might be on the same 
server, or another server. Although MapServer can not process the file 
pointed to by a URL, it does process the URL string itself. For example:
     http://www.tetonwyo.org/clerk/query/default.asp?pidn=[PIDN]
MapServer will replace [PIDN] with an appropriate value before redirecting 
to the new location. Note also that you can go to an Active Server Page, or 
other not-purely HTML type location. (To me, this is really sweet, because 
it allows you to easily mix CGI MapServer with other web technologies.)

Okay, so you read this far and I still haven't told you anything that you 
didn't already know, but here's what had me flailing. A template can only 
reference a URL in a SINGLE query mode. So if you are in a MULTIPLE query 
mode, e.g. nquery, MapServer only attempts to processes the template as a 
file. Not a good thing if you specified a URL, but still entirely logical. 
A URL is intrinsically a single thing, and you can't simultaneously 
redirect a browser to multiple locations. In other words, MapServer assumes 
that if your query could potentially return more than one result, that you 
would have specified a File for the template, not a URL.


Richard W. Greenwood, PLS
Greenwood Mapping, Inc.
Rich at GreenwoodMap.com
(307) 733-0203
http://www.GreenwoodMap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020904/1d0a4af1/attachment.htm>


More information about the MapServer-users mailing list