[Geomoose-users] Select Info to a new window - A solution and a tip

Brent Fraser bfraser at geoanalytic.com
Mon Jun 1 12:46:59 EDT 2009


To all,

A solution:
-----------
  Following Dan's suggestion I edited the select.php to include:

} elseif($output == 'bare-html') {
	header('Content-type: text/html');
	print "<head>\n";
	print "</head>";
	print "<body>";
	print $template;
	print "</body>";
	print "</html>";

and added display="window" to my "select Feature" service attributes in my application's xml config file:
        <service title="Select Feature" default="true" display="window" 
as well as changing the output type:
            <input type="hidden" name="output" value="bare-html"/>

And a tip:
----------
 To get the results sent to the same window on each select operation (instead of separate windows being created each time), I added target="MySelection" to the service attributes:
        <service title="Select Feature" default="true" display="window" target="MySelection"

 The value can be anything, it just needs to be a named target.

Brent Fraser

Brent Fraser wrote:
> I had a look at the HTML generated by the SELECT service (not the IDENTIFY):
> 
> <html xmlns:moose="http://geomoose.org/"><head>
> <moose:mapbook>
> <moose:map title='Highlight' default='true'>
> 	<moose:file>../../TopoCan/select.map</moose:file>	<moose:param name='layers' value='Wells'/>	<moose:param name='qlayer' 
> 	:
> 	:
> 
> It doesn't render very well when sent to a new window (using the display="window" tag in the Select service.)
> 
> Any thoughts on how to fix this?
> 
> Thanks!
> Brent
> 
> 
> Brent Fraser wrote:
>> Brian,
>>
>>   I just found the display tag while sifting thru ServiceManager.js  It seems to work ok for Identify, but for Select it opens a new window and prints the value of the map tag, e.g:
>>
>> ./select.map
>>
>> strange...
>>
>> Many Thanks!
>> Brent
>>
>> Brian Fischer wrote:
>>> Brent,
>>> This use to work, but haven't tried it in a while.  You could set the display attribute of the service tag to display="window" and it would pop the results up in a new window.  Give that a try.  Here is the documentation we wrote on it:
>>> http://www.geomoose.org/moose/index.php?option=com_content&task=view&id=14&Itemid=29 Look at the display attribute under <service> section.
>>>
>>> Also I had Dan write a little custom feature for me to create a link to open the results tab up in a new window so users could print it.  I think he mainly did it with some JavaScript and CSS.  Here is the app that is doing that. http://klamathcounty
> .
>> houstoneng.com/klamathmap/klamathmap.html Select some parcels with the mailing labels tool or Identify tool then click on the "Print Info. Tab" in the menubar.
>>> Hope this helps,
>>> Brian
>>>
>>> Brian Fischer, CFM  GIS Project Manager
>>> Houston Engineering, Inc.
>>> Phone: W: 763.493.4522 / M: 763.229.2734
>>>
>>> -----Original Message-----
>>> From: Brent Fraser [mailto:bfraser at geoanalytic.com] 
>>> Sent: Thursday, May 28, 2009 11:36 AM
>>> To: Dan Little
>>> Cc: GeoMOOSE Users List
>>> Subject: Re: [Geomoose-users] Info from Select to a new window?
>>>
>>> Dan,
>>>
>>>  I'm using V1.6.1.  
>>>
>>> It looks like the target of the html/text generated by select.php is set around line 488 in ServiceManager.js (of course I could be totally out-to-lunch as my JavaScript is weak):
>>>
>>> 	} else if(returnType.match(/text/i) || contentType.match(/plain/i)){ // Plain Text Return
>>> 		var results = document.getElementById('content_results_form');
>>> 		var text = http.responseText;
>>> 		if(!(text.match(/\<html/))) {
>>> 			text = text.replace(/\n/g,'<br/>\n');
>>> 			text = '<tt>'+text+'</tt>';
>>> 		}
>>> 		results.innerHTML = text;
>>> 		EventManager.triggerEvent('changetab',TABS_RESULTS_NAME);
>>> 	} else if(returnType.match(/csv/i) || contentType.match(/csv/i)) { // CSV return type
>>>
>>>
>>> perhaps if do something like:
>>> 		var win = window.open("", "Results", "width=100, height=100, scrollbars=yes" );
>>> 		var results2 = win.document.body;
>>> 		results2.innerHTML = text;
>>>
>>> Any thoughts on that?
>>>
>>>
>>> Thanks!
>>> Brent
>>>
>>> Dan Little wrote:
>>>> 1.6 or 2.0?
>>>>
>>>>
>>>>
>>>> ----- Original Message ----
>>>>> From: Brent Fraser <bfraser at geoanalytic.com>
>>>>> To: GeoMOOSE Users List <geomoose-users at lists.sourceforge.net>
>>>>> Sent: Wednesday, May 27, 2009 11:35:08 AM
>>>>> Subject: [Geomoose-users] Info from Select to a new window?
>>>>>
>>>>> I'd like to send the attribute information of my selected features to a new 
>>>>> browser window instead of the Information tab.  What's a good way to do this?
>>>>>
>>>>> Thanks!
>>>>> Brent Fraser
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>>>>> is a gathering of tech-side developers & brand creativity professionals. Meet
>>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
>>>>> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
>>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
>>>>> _______________________________________________
>>>>> Geomoose-users mailing list
>>>>> Geomoose-users at lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>>>>       
>>>>
>>> ------------------------------------------------------------------------------
>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>>> is a gathering of tech-side developers & brand creativity professionals. Meet
>>> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
>>> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
>>> _______________________________________________
>>> Geomoose-users mailing list
>>> Geomoose-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>> is a gathering of tech-side developers & brand creativity professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
>> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
>> _______________________________________________
>> Geomoose-users mailing list
>> Geomoose-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>>
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geomoose-users
> 




More information about the Geomoose-users mailing list