Re: [pmapper-users] issue hiperlink
Brought to you by:
arminburger
From: Armin B. <arm...@gm...> - 2006-11-03 15:59:42
|
Stirner have a look at the JS file at http://www.pmapper.net/demo/p2/javascript/custom.js First you define in 'openHyperlink' with the case statements what you=20 want to do with which layer. What you have to do is create the Web link=20 based on the field values you receive from the queries. The required=20 field is specified in the map file. eg. for a field named 'HOMEPAGE'=20 (lowercase for Postgis layers) "RESULT_HYPERLINK" "HOMEPAGE||Hotel Homepage" What you'll see in the result table is then 'Hotel Homepage', if you=20 want the field value displayed just use "RESULT_HYPERLINK" "HOMEPAGE" The link is used to be opened with the JS command 'window.open' that=20 creates a pop up window and loads the link specified as first argument.=20 In the case of the site mentioned above window.open('http://en.wikipedia.org/wiki/' + fldValue, 'wikiquery'); it uses a static first part 'http://en.wikipedia.org/wiki/' and combines=20 it with a second part received from the field value. 'wikiquery' is just=20 the JS naming of the opened window. If it is a static value it opens the=20 next link into the same window as the one used last (see eg.=20 http://developer.mozilla.org/en/docs/DOM:window.open for details about=20 window.open) If your field value is already a full HTML link than it's sufficient to=20 use directly that. So if you have eg. a layer 'hotels' and field values=20 like 'http://www.besthotel.com' then all you have to define is function openHyperlink(layer, fldName, fldValue) { switch(layer) { case 'hotels': window.open(fldValue, 'namewhatyouwant'); } } and the opened window will load the site http://www.besthotel.com. Hope that helps armin stirner mathematic wrote: > Hi list >=20 > I am new in pmapper game >=20 > I ask for tool hiperlink, is very interest.... My question is how I can= work=20 > with Hiperlink.... >=20 > I have pmapper 2.0 ..... I have an shape of point (hotel - restaurant)= and=20 > have an field in data base with web site of hotel, restaurant, etc.....= . I=20 > how can that? >=20 > I see other question about it, like : > -----------------------------------------------------------------------= ------------------- > ack Nicholson > Fri, 28 Jul 2006 05:05:04 -0700 (PDT) >=20 > In the mapfile you have to add in RESULT_HYPERLINK the fields of the ch= art > that you use as link. > Example: >=20 > METADATA > "DESCRIPTION" "layer" > "RESULT_FIELDS" "ID,FIELD1,FIELD2" > "RESULT_HEADERS" "Id,field1,field2" > "RESULT_HYPERLINK" "FIELD||Link to detail" > "LAYER_ENCODING" "UTF-8" > END # Metadata >=20 > After having done this you continue this way: > In the first part of the javascript custom.js, > has to insert the run of the file pdf that you want link, > then to discriminate the various documents associate it to an univocal = field > for every polygon. >=20 > window.open('http://localhost/pathtodocumet/file' +fldValue+ '.pdf'); > -- >=20 >=20 >=20 > but I have address to web site ... not document, so in part=20 > "window.open(".......?).....i don't know how put addrress web site.. >=20 > I need Help please......I sorry my bad Inglish... > Regards >=20 > _________________________________________________________________ > Visita MSN Latino Entretenimiento: =A1m=FAsica, cine, chismes, TV y m=E1= s...!=20 > http://latino.msn.com/entretenimiento/ >=20 >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job = easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > pmapper-users mailing list > pma...@li... > https://lists.sourceforge.net/lists/listinfo/pmapper-users >=20 >=20 |