[Chameleon] Customizing Query Results
Bart van den Eijnden
BEN at Syncera-ITSolutions.NL
Fri Aug 26 07:49:48 EDT 2005
I hope you are looking at the HTML file with a text editor and not with a browser :-) .....
function myOnLoad()
{
CWC2OnLoadFunction();
goEventManager.registerForEvent('ON_QUERY', 'stragiswebquery');
}
<body onLoad="myOnLoad()">
function stragiswebquery( nX, nY )
{
// determine the site name from the URL
loc = document.location.href;
pos = loc.indexOf("sites/");
endpos = loc.indexOf("index.phtml");
if (endpos >= 0)
{
var site = loc.substring(pos+6, endpos);
}
else
{
var site = loc.substring(pos+6, loc.length);
}
if (site.indexOf("/") >= 0)
{
site = site.substring(0, site.length-1);
}
if ((document.forms[0].RADIUS) && (document.forms[0].RADIUS.value != ""))
{
iRadiusGeo = document.forms[0].RADIUS.value;
iRadiusPix = (iRadiusGeo/(goCWCJSAPI.oMap.maxx-goCWCJSAPI.oMap.minx))*gMapWiWidth;
if ((parseInt(document.forms[0].RADIUS.value) >= 0) )
{
ROICircleToolInitObjects();
ROICircleToolStartZoomBox();
goROICircleObj.centerX = nX;
goROICircleObj.centerY = nY;
goROICircleObj.radius = iRadiusPix;
goROICircleObj.edgeColor = '0000FF';
goROICircleObj.edgeWidth = 5;
goROICircleObj.fillOpacity = 1;
goCWCROIManager.Add(goROICircleObj);
document.getElementById('TreeFrame').src = '/stragisweb/common/stragisquery.phtml?x='+ nX + '&y=' + nY + '&sid=' + document.forms[0].sid..value + '&radius=' + iRadiusGeo + '&site='+site+'&maxfeatures='+iMaxFeatures;
ShowTreeLayer();
}
}
}
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> "Davelaar, Hilbert" <Hilbert.Davelaar at wur.nl> 08/26/05 1:46 pm >>>
I can't find anything you are mentioning in that file. It consist mainly of inlcuded of other files.
Regards,
Hilbert
-----Oorspronkelijk bericht-----
Van: Bart van den Eijnden [mailto:BEN at Syncera-ITSolutions.NL]
Verzonden: vr 26-8-2005 13:38
Aan: Davelaar, Hilbert
CC: chameleon at lists.maptools.org
Onderwerp: RE: [Chameleon] Customizing Query Results
I have attached an example of how I did it, hopefully that clarifies things.
Look for myOnLoad and stragisquery to get answer to 1) and 3).
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> "Davelaar, Hilbert" <Hilbert.Davelaar at wur.nl> 08/26/05 1:28 pm >>>
OK thank you Bart. But I'm not that familiair with javascript etc, so I couldn't get it working. If I'm right I have to do four things:
1 Place'goEventManager.registerForEvent( 'ON_QUERY', 'function_to_call' );' in the onload event of my chameleon application, but I don't know how and where?!
2 Set popupresults to false. That's no that difficult.
3 Put a function in my template. I added this to template.html, is that right?
<script language="JavaScript" type="text/javascript">
function myOnQuery( nX, nY )
{
var url = 'query.phtml?x=' + nX + '&y=' + nY + '&sid=' + document.forms0.sid.value;
}
</script>
4 Create a query.phtml in the htdocs of my application dir. Also not that difficult.
So, Bart (or someone else) can you tell me more about step 1 and 3 please.
Kind regards,
Hilbert
-----Oorspronkelijk bericht-----
Van: chameleon-bounces at lists.maptools.org namens Bart van den Eijnden
Verzonden: vr 26-8-2005 12:53
Aan: chameleon at lists.maptools.org; Davelaar, Hilbert
CC:
Onderwerp: Re: [Chameleon] Customizing Query Results
See the Wiki:
http://chameleon-tiki.maptools.org/tiki-index.php?page=QueryWidgetCustomizingResults
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> "Davelaar, Hilbert" <Hilbert.Davelaar at wur.nl> 08/26/05 12:11 pm >>>
Hi all,
I have a queryable layer in my mapfile and when this layer is queried using the query-widget I get the default Query Result popup, which shows all attributes of the feature. Is it possible to customize this? For example: I want to get a popup of which I can control the layout and I only want to show two attributes. If possible display one these attributes as a hyperlink. Maybe even sent the Query Result to another layer or frame in the same browser, without opening a popup.
Someone has some knowledge about this matter? I hope there's a not too difficult way to achieve these kind of customizations.
Regards,
Hilbert Davelaar
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list