[OpenLayers-Users] Hyperlinked Features

Richard Greenwood richard.greenwood at gmail.com
Mon May 28 09:53:09 EDT 2007


On 5/28/07, Darren Cope <darrencope at gmail.com> wrote:
> Hi Christopher,
>
> Thanks for the link.  That is the closest example I could find as
> well.  However, my JavaScript knowledge is minimal, so I can't seem to
> figure it out.  Is there an easier way to accomplish what I want, or
> will I have to dig into learning JavaScript?  I have seem some
> OpenLayers demos with an "identify" tool.  Perhaps that is the way to
> go, with a hyperlink showing up as one of the identify results?
>
> Anyone else have any thoughts?
>
> Darren

The getFeatureInfo functionality is an example of an "identify" tool.
I'm not sure that it will get you exactly what you want (open a new
page) but it may get you close enough. It will display attribute data
from your canoe trip layer, and from that you could link to a page. In
your mapserver map file you need to define a TEMPLATE for your canoe
trip layer. The template is a separate HTML file like:
  Name of trip: [NAME]<br>
  Date: [DATE]<br>
  Link: <a>href="[HREF]">Click to see my pictures</>
where NAME, DATE, and HREF are columns in your shapefile (or whatever
format your canoe trip data is in). Mapserver will substitute in the
correct values for the [parameters]. The user clicks on a line segment
and the attribute data gets put into the div.

Keep paddling,
Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Users mailing list