|
27 |
* DEALINGS IN THE SOFTWARE. |
27 |
* DEALINGS IN THE SOFTWARE. |
28 |
*/ |
28 |
*/ |
29 |
|
29 |
|
| |
30 |
/* |
| |
31 |
* MODIFICATIONS (C) 2005, Andreas Hocevar <andreas.hocevar@prisma-solutions.at> |
| |
32 |
* - bugfix: use tolerance from cwc2 call (and not 3!) |
| |
33 |
* - bugfix: use correct variable $this->mszOnMouseOut (not $this->onMouseOut) |
| |
34 |
* for $onmouseout and fix semicolon typo in $onmouseover definiton. |
| |
35 |
* - bugfix: set default onmouseover and onmouseout to correct names |
| |
36 |
* (i.e. MapTipContent and MapTip clear instead of MapTipsContent and |
| |
37 |
* MapTipsClear). |
| |
38 |
* - add feature: if keyword "LinkUniqueID" (case insensitive) is found in the |
| |
39 |
* LINKURL attribute, it is replaced by the current link-id. This is useful |
| |
40 |
* if your LinkURL looks more like "javascript:openURL(12345, 'foo')" that |
| |
41 |
* "http://www.foo.bar/index.php?id=12345". |
| |
42 |
* - add feature: new LINKTARGET attribute. If not set, "_blank" is used to |
| |
43 |
* keep compatibility with previous versions. If LINKTARGET attribute is set |
| |
44 |
* to "", it will be omitted in the according hfres. |
| |
45 |
*/ |
| |
46 |
|
30 |
include_once(dirname(__FILE__)."/../Widget.php"); |
47 |
include_once(dirname(__FILE__)."/../Widget.php"); |
31 |
include_once(dirname(__FILE__)."/../Button.php"); |
48 |
include_once(dirname(__FILE__)."/../Button.php"); |
32 |
include_once(dirname(__FILE__)."/../Popup.php"); |
49 |
include_once(dirname(__FILE__)."/../Popup.php"); |
|
49 |
var $mszLayer = ''; |
66 |
var $mszLayer = ''; |
50 |
var $maszAttributes = array(); |
67 |
var $maszAttributes = array(); |
51 |
var $mszLinkURL = ''; // URL to go to |
68 |
var $mszLinkURL = ''; // URL to go to |
| |
69 |
var $mszLinkTarget = '_blank'; // Link target |
52 |
var $mszLinkUniqueID = ''; // unique location id to append to url |
70 |
var $mszLinkUniqueID = ''; // unique location id to append to url |
53 |
var $mszTitleClass = 'label'; |
71 |
var $mszTitleClass = 'label'; |
54 |
var $mszTitleStyle = ''; |
72 |
var $mszTitleStyle = ''; |
|
62 |
var $mszTransparentMapImage = 'maptips_image'; |
80 |
var $mszTransparentMapImage = 'maptips_image'; |
63 |
var $mszPixelGif = ''; |
81 |
var $mszPixelGif = ''; |
64 |
|
82 |
|
65 |
var $mszOnMouseOver = 'MapTipsContent'; |
83 |
var $mszOnMouseOver = 'MapTipContent'; |
66 |
var $mszOnMouseOut = 'MapTipsClear'; |
84 |
var $mszOnMouseOut = 'MapTipClear'; |
67 |
|
85 |
|
68 |
/** |
86 |
/** |
69 |
* MapTips |
87 |
* MapTips |
|
98 |
$this->maAttributes["TOLERANCE"] = new IntegerAttribute( "TOLERANCE", false ); |
116 |
$this->maAttributes["TOLERANCE"] = new IntegerAttribute( "TOLERANCE", false ); |
99 |
$this->maAttributes["LINK"] = new BooleanAttribute( "LINK", false ); |
117 |
$this->maAttributes["LINK"] = new BooleanAttribute( "LINK", false ); |
100 |
$this->maAttributes["LINKURL"] = new StringAttribute( "LINKURL", false ); |
118 |
$this->maAttributes["LINKURL"] = new StringAttribute( "LINKURL", false ); |
| |
119 |
$this->maAttributes["LINKTARGET"] = new StringAttribute( "LINKTARGET", false ); |
101 |
$this->maAttributes["LINKUNIQUEID"] = new StringAttribute( "LINKUNIQUEID", false ); |
120 |
$this->maAttributes["LINKUNIQUEID"] = new StringAttribute( "LINKUNIQUEID", false ); |
102 |
$this->maAttributes["MAPTIPSDIV"] = new StringAttribute( "MAPTIPSDIV", true ); |
121 |
$this->maAttributes["MAPTIPSDIV"] = new StringAttribute( "MAPTIPSDIV", true ); |
103 |
$this->maAttributes["TITLECLASS"] = new StringAttribute( "TITLECLASS", false ); |
122 |
$this->maAttributes["TITLECLASS"] = new StringAttribute( "TITLECLASS", false ); |
|
142 |
$this->mszLink = $this->maParams["LINK"]; |
161 |
$this->mszLink = $this->maParams["LINK"]; |
143 |
if (isset($this->maParams["LINKURL"])) |
162 |
if (isset($this->maParams["LINKURL"])) |
144 |
$this->mszLinkURL = $this->maParams["LINKURL"]; |
163 |
$this->mszLinkURL = $this->maParams["LINKURL"]; |
| |
164 |
if (isset($this->maParams["LINKTARGET"])) |
| |
165 |
$this->mszLinkTarget = $this->maParams["LINKTARGET"]; |
145 |
if (isset($this->maParams["LINKUNIQUEID"])) |
166 |
if (isset($this->maParams["LINKUNIQUEID"])) |
146 |
$this->mszLinkUniqueID = $this->maParams["LINKUNIQUEID"]; |
167 |
$this->mszLinkUniqueID = $this->maParams["LINKUNIQUEID"]; |
147 |
} |
168 |
} |
|
345 |
$href = "href=\"".$this->mszLinkURL; |
366 |
$href = "href=\"".$this->mszLinkURL; |
346 |
if ($this->mszLinkUniqueID != "") |
367 |
if ($this->mszLinkUniqueID != "") |
347 |
{ |
368 |
{ |
348 |
$href .= "[".$this->mszLinkUniqueID."]"; |
369 |
if (strpos( strtolower( $this->mszLinkURL ), 'linkuniqueid' ) !== false) |
|
|
370 |
{ |
|
|
371 |
$href = preg_replace( '/linkuniqueid/i', "[".$this->mszLinkUniqueID."]", $href ); |
|
|
372 |
} |
|
|
373 |
else |
|
|
374 |
{ |
|
|
375 |
$href .= "[".$this->mszLinkUniqueID."]"; |
|
|
376 |
} |
|
|
377 |
} |
|
|
378 |
if ($this->mszLinkTarget) |
|
|
379 |
{ |
|
|
380 |
$href .= "\" target=\"".$this->mszLinkTarget."\""; |
|
|
381 |
} |
|
|
382 |
else { |
|
|
383 |
$href .= "\""; |
349 |
} |
384 |
} |
350 |
$href .= "\" target=\"_blank\""; |
| |
351 |
|
385 |
|
352 |
$onmouseover = 'szMapTipsNavCmd = '.$this->mszHTMLForm.'.NAV_CMD.value; '.$this->mszHTMLForm.'.NAV_CMD.value = \'\'; szMapTipsNavSubmit = '.$this->mszHTMLForm.'.NAV_SUBMIT.value; '.$this->mszHTMLForm.'.NAV_SUBMIT.value = 0.'.$this->mszOnMouseOver.'(\''.$this->mszMapTipsDiv.'\', \''.$szContents.'\', arguments[0])'; |
386 |
$onmouseover = 'szMapTipsNavCmd = '.$this->mszHTMLForm.'.NAV_CMD.value; '.$this->mszHTMLForm.'.NAV_CMD.value = \'\'; szMapTipsNavSubmit = '.$this->mszHTMLForm.'.NAV_SUBMIT.value; '.$this->mszHTMLForm.'.NAV_SUBMIT.value = 0;'.$this->mszOnMouseOver.'(\''.$this->mszMapTipsDiv.'\', \''.$szContents.'\', arguments[0])'; |
353 |
$onmouseout = $this->mszHTMLForm.'.NAV_CMD.value = szMapTipsNavCmd; '.$this->mszHTMLForm.'.NAV_SUBMIT.value = szMapTipsNavSubmit; '.$this->onMouseOut.'(\''.$this->mszMapTipsDiv.'\', \''.$this->mszDefaultText.'\', arguments[0])'; |
387 |
$onmouseout = $this->mszHTMLForm.'.NAV_CMD.value = szMapTipsNavCmd; '.$this->mszHTMLForm.'.NAV_SUBMIT.value = szMapTipsNavSubmit; '.$this->mszOnMouseOut.'(\''.$this->mszMapTipsDiv.'\', \''.$this->mszDefaultText.'\', arguments[0])'; |
354 |
} |
388 |
} |
355 |
else |
389 |
else |
356 |
{ |
390 |
{ |
|
360 |
} |
394 |
} |
361 |
if ($oLayer->type == MS_LAYER_POINT) |
395 |
if ($oLayer->type == MS_LAYER_POINT) |
362 |
{ |
396 |
{ |
363 |
$szTemplate = '<area shape="circle" coords="[shpxy xf="," proj="image"],3" '.$href.' onmouseover="'.$onmouseover.'" onmouseout="'.$onmouseout.'">'; |
397 |
$szTemplate = '<area shape="circle" coords="[shpxy xf="," proj="image"],'.$this->mnTolerance.'" '.$href.' onmouseover="'.$onmouseover.'" onmouseout="'.$onmouseout.'">'; |
364 |
} |
398 |
} |
365 |
elseif ($oLayer->type == MS_LAYER_LINE) |
399 |
elseif ($oLayer->type == MS_LAYER_LINE) |
366 |
{ |
400 |
{ |