nakijun / morisoliver

Automatically exported from code.google.com/p/morisoliver
0 stars 0 forks source link

Task Order 5 - Add the ability to have one layer be filtered, using a set of pre-defined filter categories. All aspects of the layer interaction will respect the filter. #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Overview:

DOR would like to have the query functionality of the previous (now 
non-functional) JSP DOR LA3 viewer in OLIVER 
(http://maps.massgis.state.ma.us/LA3/pages/main.jsp).  Currently OLIVER 
doesn’t have any query functionality and the challenge will be carrying a 
query filter through the application’s parts.

An example use case:
-   User optionally zooms somewhere
-   User clicks the button on the upper toolbar with a table icon, which launches 
a dialog box
    (this button needs to be hideable in the configuration)
-   In the dialog box are items that allow the user to make this type of query:
1.  Required: Pick one or more property types from a list of about 100 (a 
dropdown where the user can shift click more than one would work)
2.  Optional:  2 boxes where the user can enter Sale price low (no commas) and 
Sale price high (no commas). (we’ll use inclusive)
3.  Optional: 2 boxes where the user can enter Sale date low (MM/DD/YYYY) and 
Sale date high (MM/DD/YYYY)  (No calendars) (we’ll use inclusive) 
4.  Radio button for all sales, only arms-length sales or only non-arms-length 
sales 

This enhancement is to generalize the construction of such filter 
functionality.  This enhancement has 3 parts:

Part A: Create a user-facing “filter dialog box” based on a configuration 
provided in toolconfig_XYZ.js

This part of the enhancement will take a filter configuration from 
toolconfig_XYZ.js and will build a corresponding filter dialog box.  When the 
“filter” button on the upper toolbar is pushed, the configured filter 
dialog box will be shown.  For example, the following might be a sample filter 
dialog configuration:

[
  {
     columnName : 'startDate'
     ,type       : 'date'
    ,required   : true
    ,values     : [new Date(2009,0,1),new Date(2011,0,1)]  // min - max range
  }
  ,{
     columnName : 'countyCode'
    ,type       : 'number'
    ,required   : false
    ,values     : null // any number will do
  }
  ,{
     columnName ; 'gender'
    ,type       : 'radioButton'
    ,required   : true
    ,values     : ['female','male']
  }
  ,{
     columnName : 'favoriteFood'
    ,type     : 'multiSelect'
    ,required : false
    ,values   : ['PB&J','M&M\’s']
  }
]

Part B: Change OLIVER to display, identify and extract data based on the 
supplied filter

When a user creates a data filter using the filter dialog from part A and 
clicks “apply”:

 1. If there are no features let the user know
 2. If there are features then OLIVER will:
 a) If the filter's target layer is not already present in the map, then add the filter's target layer (in this case “Real Property Verified Market Sales”) from the OLIVER folder-set.
 b) Apply the user-generated filter to the target layer (added to the map in step 2.a if it wasn't already present) by encoding the filter as an XML string and adding it to the WMS request for the filter layer
 c) Apply the user-generated filter to all “identify” requests by encoding the filter as an OGC XML filter then “and”-ing the user-generated filter to the clicked point filter
 d) Add a “Zoom to all” next to “Unselect all” in the Feature Details area to zoom to the extent of the filter results. 
 e) Apply the user-generated filter to all “extract” requests by encoding the filter as an OGC XML filter and submitting it along with the extract request
 f) Apply the user-generated filter to all “print” requests by passing the XML filter for the WMS layer along with the request to print the layer

An example of the results of clicking “identify” on a target layer with a 
user-generated filter active is shown here.  Note that the standard “Identify 
Results” tab is shown, the results are simply restricted to those that also 
match the active user-generated filter.

Then the user can click on the row to open up the table as usual.

Part C – Preserve user-defined filter in Permalink

It’s important that the Permalink preserve the filter if possible.  The user 
will want to search for something (say, hotels sold in 2011 greater than 
$1,000,000) and then send a Permalink of the map to someone.  Currently the 
Permalink does not contain filters.  A filter could encode the PROP_TYPE_ID, 
SALE_DATE,SALE_PRICE and NAL as the bounding box is separate.

When a permalink is loaded, the user-defined filter which is encoded in the 
permalink will be applied to the map.  A click on the “launch filter” 
button will present the filter UI dialog box filled in to match the filter 
encoded in the permalink.

A note on long URLs in Internet Explorer.  Internet Explorer only supports URLs 
up to 2038 characters long.  This means that a very long permalink could exceed 
the supported URL length of Internet Explorer.  We will attempt to design 
around this limitation, but it is possible that some extremely large 
user-defined queries will just “not fit” under 2038 characters.  This issue 
will not be explicitly addressed under this Task Order, and a full solution to 
this issue will be left for a further enhancement.

Original issue reported on code.google.com by Aleda.Fr...@state.ma.us on 20 Jun 2012 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 20 Jun 2012 at 4:24

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 31 Oct 2012 at 4:03