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 
want to do with which layer. What you have to do is create the Web link 
based on the field values you receive from the queries. The required 
field is specified in the map file. eg. for a field named 'HOMEPAGE' 
(lowercase for Postgis layers)

"RESULT_HYPERLINK" "HOMEPAGE||Hotel Homepage"

What you'll see in the result table is then 'Hotel Homepage', if you 
want the field value displayed just use

"RESULT_HYPERLINK" "HOMEPAGE"


The link is used to be opened with the JS command 'window.open' that 
creates a pop up window and loads the link specified as first argument. 
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 
it with a second part received from the field value. 'wikiquery' is just 
the JS naming of the opened window. If it is a static value it opens the 
next link into the same window as the one used last (see eg. 
http://developer.mozilla.org/en/docs/DOM:window.open for details about 
window.open)

If your field value is already a full HTML link than it's sufficient to 
use directly that. So if you have eg. a layer 'hotels' and field values 
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
> 
> I am new in pmapper game
> 
> I ask for tool hiperlink, is very interest.... My question is how I can work 
> with Hiperlink....
> 
> I have pmapper 2.0  ..... I have an shape of point (hotel - restaurant) and 
> have an field in data base with web site of hotel, restaurant, etc...... I 
> how can that?
> 
> I see other question about it, like :
> ------------------------------------------------------------------------------------------
> ack Nicholson
> Fri, 28 Jul 2006 05:05:04 -0700 (PDT)
> 
> In the mapfile you have to add in RESULT_HYPERLINK the fields of the chart
> that you use as link.
> Example:
> 
> 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
> 
> 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.
> 
> window.open('http://localhost/pathtodocumet/file' +fldValue+ '.pdf');
> --
> 
> 
> 
> but I have address to web site ... not document, so in part 
> "window.open(".......?).....i don't know how put addrress web site..
> 
> I need Help please......I sorry my bad Inglish...
> Regards
> 
> _________________________________________________________________
> Visita MSN Latino Entretenimiento: ¡música, cine, chismes, TV y más...! 
> http://latino.msn.com/entretenimiento/
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> 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 Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> pmapper-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
> 
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
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 Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to