Project: Active / Sold Buttons

Add Active and Sold Radio Buttons to Advanced Search Criteria.

Start Date: November 10, 2010  
Deadline:   Modified Files
Assigned by: Bob Carpenter  

The advanced Search criteria is in three places:

Add Header

  • Listing Status.
    inline style change:
    style="font-size: 12px;
    margin-bottom:0"

Add radio buttons for Active / Sold

  • <input name="status"
    type="radio" id="statusActive"
    value="1" onclick="hideTime()
    checked="checked"" />
  • <input name="status"
    type="radio" id="statusSold"
    value="2" onclick="showTime()" />

Add Time Frame

  • <div style="margin-top:7px" id="soldtimediv">
          <select name="soldtime" id="soldtime">
               <option value="30">Previous Month</option>
               <option value="90">Previous 3 Months</option>
               <option value="180">Previous 6 Months</option>
               <option value="365">Previous Year</option>
          </select>
    </div>

Add onclick to radio buttons

    • onclick="showTime()"
      onclick="hideTime()"
The Home page contains /Views/vAbout/dspHomePageMessage.cfm The Search Landing page contains /Views/vListing/dspPropertyCriteriaPP.cfm the Property List View page contains
/Views/vListing/dspListView.cfm
/Views/vListing/dspSearchForm.cfm
  • Ensure that Active is the currently selected choice.
    document.hp_search_form.status[0].checked = true;
    (not implemented - need to test)

11/17/10 - got wireframes and see that radio buttons should be one checkbox.

<input type="checkbox" name="status" id="statusInclude" onclick="showTime()" />
<label id="statusIncludeLab" for="statusActive" style="color: ##666666;">Include Sold Data</label>

  • The advanced Options section is segmented like the description in "Curious about something" to the left. It shows bed and bath and residential / condo for basic options.
  • Change font size of header from 9 to 12
    <div style="font-size: 12px; padding-left: 10px; padding-top: 3px; border-bottom: 3px; solid ##000;">
  • Added spacer images to each column to keep form from changing when drop-down is displayed
    <img src="/images/spacer.gif" width="120px" height="1" />
  • Ensure that Active is the currently selected choice.
    document.searchListingForm.status[0].checked = true;
    (not implemented - need to test)

11/17/10 - got wireframes and see that radio buttons should be one checkbox.

<input type="checkbox" name="status" id="statusInclude" onclick="showTime()" />
<label id="statusIncludeLab" for="statusActive" style="color: ##666666;">Include Sold Data</label>

11/18/10 - no, two checkboxes

/Views/vListing/dspPropertyCriteriaPP.cfm

  • To the right of () Property () Listing# I added [] Active [] Sold in a floated-right div with width of 143. Depending on whether or not there is a scroll bar, the div moves left and right. Changed to a relative positioned div with top:-18px; left:260px. Works well, ISSUE: created a space between top section and criteria section.
  • ISSUE: If By Listing# radio button is checked, Active/Sold needs to hide.
Added if/then around
  • Sold Price
  • Address (taken care of by show_address)
  • Agent/Office
  • Clippings
  • Map This

Style/refresh/listView.css

Home Page Template files Search Landing Page Template files
/cf-instance/root/W/index.cfm
/cf-instance/root/W/techspeditionFBcore_CF50_v3_00_21.cfm
/cf-instance/root/W/Models/mGeography/fbx_Switch.cfm
/cf-instance/root/W/Models/mGeography/actMapAuthenticateRegion.cfm
/cf-instance/root/W/fbx_Settings.cfm
/cf-instance/root/W/Models/mGeography/actInitInteractiveMapDefaults.cfm
/cf-instance/root/W/Views/vGeography/fbx_Switch.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapPP3.cfm
/cf-instance/root/W/Views/vLayout/fbx_Switch.cfm
/cf-instance/root/W/Views/vListing/dspPropertyCriteriaPP.cfm
/cf-instance/root/W/Views/vListing/fbx_Switch.cfm
/cf-instance/root/W/actSetApplication.cfm
/cf-instance/root/W/Views/vGeography/dspPP3MapLayout.cfm
/cf-instance/root/W/Views/vLayout/masterLayout.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlJumpTo.cfm
/cf-instance/root/W/Views/vLayout/dspPP3Skin.cfm
/cf-instance/root/CustomTags/setEnvironment.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapPopulateStates.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlRegion.cfm
/cf-instance/root/W/Views/vListing/dspMLSNum.cfm
/cf-instance/root/W/Views/vUtility/fbx_Switch.cfm
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getAsset
(asset.external.proxyServer, jubilee.windermere.com:8080) ]
from /cf-instance/root/W/CFC/process/Asset.cfc
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getProxyServer() ]
from /cf-instance/root/W/CFC/process/Asset.cfc
/cf-instance/root/CustomTags/UtilitiesTrimWhiteSpace.cfm
/cf-instance/root/CustomTags/publicTopNav.cfm
/cf-instance/root/CustomTags/resource/addScript.cfm
/cf-instance/root/CustomTags/resource/addStyle.cfm
/cf-instance/root/W/UDF/StructToQueryString.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlDragDraw.cfm
/cf-instance/root/W/Views/vGeography/fbx_Settings.cfm
/cf-instance/root/W/fbx_Layouts.cfm
/cf-instance/root/CustomTags/OpenHouseControl.cfm
/cf-instance/root/CustomTags/form/formMaxPrice.cfm
/cf-instance/root/CustomTags/form/formMinPrice.cfm
/cf-instance/root/CustomTags/form/formSelectState.cfm
/cf-instance/root/CustomTags/resource/addOnload.cfm
/cf-instance/root/CustomTags/resource/addOnresize.cfm
/cf-instance/root/CustomTags/resource/checkMobile.cfm
/cf-instance/root/CustomTags/resource/delStyle.cfm
/cf-instance/root/CustomTags/resource/srcHelp.cfm
/cf-instance/root/CustomTags/resource/srcOnloads.cfm
/cf-instance/root/CustomTags/resource/srcOnresizes.cfm
/cf-instance/root/CustomTags/resource/srcScripts.cfm
/cf-instance/root/CustomTags/resource/srcStyles.cfm
/cf-instance/root/W/Application.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Layouts.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Settings.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Switch.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Layouts.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Settings.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Switch.cfm
/cf-instance/root/W/Models/mGeography/fbx_Layouts.cfm
/cf-instance/root/W/Models/mGeography/fbx_Settings.cfm
/cf-instance/root/W/OnRequestEnd.cfm
/cf-instance/root/W/UDF/BitOrAll.cfm
/cf-instance/root/W/UDF/IncrCounter.cfm
/cf-instance/root/W/UDF/InitCounter.cfm
/cf-instance/root/W/UDF/IsEmail.cfm
/cf-instance/root/W/UDF/isDefinedValue.cfm
/cf-instance/root/W/UDF/isLegitValue.cfm
/cf-instance/root/W/UDF/sumList.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlAutoZoom.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlConstraintType.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlListingPagination.cfm
/cf-instance/root/W/Views/vGeography/fbx_Layouts.cfm
/cf-instance/root/W/Views/vLayout/fbx_Layouts.cfm
/cf-instance/root/W/Views/vLayout/fbx_Settings.cfm
/cf-instance/root/W/Views/vListing/fbx_Layouts.cfm
/cf-instance/root/W/Views/vListing/fbx_Settings.cfm
/cf-instance/root/W/Views/vUtility/dspiFrameCheck.cfm
/cf-instance/root/W/Views/vUtility/fbx_Layouts.cfm
/cf-instance/root/W/Views/vUtility/fbx_Settings.cfm
/cf-instance/root/W/fbx_Circuits.cfm
/cf-instance/root/W/techspeditionFBcoremethods_CF50_v3_00_21.cfm
CFC[ /cf-instance/root/W/CFC/docType.cfc | getDocType(THISFUSEACTION = listing.SearchLanding) ]
from /cf-instance/root/W/CFC/docType.cfc
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getProperty
(asset.external.proxyServer, jubilee.windermere.com:8080) ]
from /cf-instance/root/W/CFC/process/Asset.cfc
CFC[ /cf-instance/root/W/CFC/security/Util.cfc | getClientAddress() ]
from /cf-instance/root/W/CFC/security/Util.cfc
/cf-instance/root/W/index.cfm
/cf-instance/root/W/techspeditionFBcore_CF50_v3_00_21.cfm
/cf-instance/root/W/Models/mGeography/fbx_Switch.cfm
/cf-instance/root/W/Models/mGeography/actMapAuthenticateRegion.cfm
/cf-instance/root/W/Views/vGeography/fbx_Switch.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapPP3.cfm
/cf-instance/root/W/Models/mGeography/actInitInteractiveMapDefaults.cfm
/cf-instance/root/W/fbx_Settings.cfm
/cf-instance/root/W/Views/vGeography/dspPP3MapLayout.cfm
/cf-instance/root/W/Views/vLayout/fbx_Switch.cfm
/cf-instance/root/W/Views/vListing/fbx_Switch.cfm
/cf-instance/root/W/Views/vLayout/masterLayout.cfm
/cf-instance/root/W/Views/vListing/dspPropertyCriteriaPP.cfm
/cf-instance/root/W/actSetApplication.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapPopulateStates.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlJumpTo.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlRegion.cfm
/cf-instance/root/CustomTags/resource/addScript.cfm
/cf-instance/root/CustomTags/setEnvironment.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlDragDraw.cfm
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getProxyServer() ]
from /cf-instance/root/W/CFC/process/Asset.cfc
/cf-instance/root/CustomTags/resource/addOnload.cfm
/cf-instance/root/CustomTags/resource/delStyle.cfm
/cf-instance/root/W/Application.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Switch.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlConstraintType.cfm
/cf-instance/root/W/Views/vGeography/fbx_Settings.cfm
/cf-instance/root/W/Views/vLayout/dspPP3Skin.cfm
/cf-instance/root/W/Views/vListing/dspMLSNum.cfm
/cf-instance/root/W/Views/vUtility/fbx_Switch.cfm
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getAsset
(asset.external.proxyServer, jubilee.windermere.com:8080) ]
from /cf-instance/root/W/CFC/process/Asset.cfc
/cf-instance/root/CustomTags/OpenHouseControl.cfm
/cf-instance/root/CustomTags/UtilitiesTrimWhiteSpace.cfm
/cf-instance/root/CustomTags/form/formMaxPrice.cfm
/cf-instance/root/CustomTags/form/formMinPrice.cfm
/cf-instance/root/CustomTags/form/formSelectState.cfm
/cf-instance/root/CustomTags/publicTopNav.cfm
/cf-instance/root/CustomTags/resource/addOnresize.cfm
/cf-instance/root/CustomTags/resource/addStyle.cfm
/cf-instance/root/CustomTags/resource/checkMobile.cfm
/cf-instance/root/CustomTags/resource/srcHelp.cfm
/cf-instance/root/CustomTags/resource/srcOnloads.cfm
/cf-instance/root/CustomTags/resource/srcOnresizes.cfm
/cf-instance/root/CustomTags/resource/srcScripts.cfm
/cf-instance/root/CustomTags/resource/srcStyles.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Layouts.cfm
/cf-instance/root/W/Controllers/Listing/fbx_Settings.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Layouts.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Settings.cfm
/cf-instance/root/W/Controllers/Utility/fbx_Switch.cfm
/cf-instance/root/W/Models/mGeography/fbx_Layouts.cfm
/cf-instance/root/W/Models/mGeography/fbx_Settings.cfm
/cf-instance/root/W/OnRequestEnd.cfm
/cf-instance/root/W/UDF/BitOrAll.cfm
/cf-instance/root/W/UDF/IncrCounter.cfm
/cf-instance/root/W/UDF/InitCounter.cfm
/cf-instance/root/W/UDF/IsEmail.cfm
/cf-instance/root/W/UDF/StructToQueryString.cfm
/cf-instance/root/W/UDF/isDefinedValue.cfm
/cf-instance/root/W/UDF/isLegitValue.cfm
/cf-instance/root/W/UDF/sumList.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlAutoZoom.cfm
/cf-instance/root/W/Views/vGeography/dspInteractiveMapControlListingPagination.cfm
/cf-instance/root/W/Views/vGeography/fbx_Layouts.cfm
/cf-instance/root/W/Views/vLayout/fbx_Layouts.cfm
/cf-instance/root/W/Views/vLayout/fbx_Settings.cfm
/cf-instance/root/W/Views/vListing/fbx_Layouts.cfm
/cf-instance/root/W/Views/vListing/fbx_Settings.cfm
/cf-instance/root/W/Views/vUtility/dspiFrameCheck.cfm
/cf-instance/root/W/Views/vUtility/fbx_Layouts.cfm
/cf-instance/root/W/Views/vUtility/fbx_Settings.cfm
/cf-instance/root/W/fbx_Circuits.cfm
/cf-instance/root/W/fbx_Layouts.cfm
/cf-instance/root/W/techspeditionFBcoremethods_CF50_v3_00_21.cfm
CFC[ /cf-instance/root/W/CFC/docType.cfc | getDocType
(THISFUSEACTION = listing.SearchLanding) ]
from /cf-instance/root/W/CFC/docType.cfc
CFC[ /cf-instance/root/W/CFC/process/Asset.cfc | getProperty
(asset.external.proxyServer, jubilee.windermere.com:8080) ]
from /cf-instance/root/W/CFC/process/Asset.cfc
CFC[ /cf-instance/root/W/CFC/security/Util.cfc | getClientAddress() ]
from /cf-instance/root/W/CFC/security/Util.cfc
/Style/refresh/lib.css /js/map/lib.js
  • Change from 10px to 12px

    #advanced_options * {
          font-size: 12px;
    }

The lib.css is added to the page through code and automatically sticks www-dist.windermere.com to the front of the path. So, you can't view CSS changes directly. You can, in firebug, change http://dist-www.windermere.com/Style/refresh/lib.css to /Style/refresh/lib.css and the preview will update.

 

Add hide jquery to /js/map/lib.js
function showTime(){
      $("#soldtimediv").slideDown("fast");
}
function hideTime(){
      $("#soldtimediv").slideUp("fast");
}

11/17/10 - got wireframes and see that radio buttons should be one checkbox.

function showTime(){
$("#soldtimediv").slideToggle();
}

Line 636 - I can add + FIX_ARRAY[i].statusdescription, but all i get is "undefined"

$("#mapControlLocationSearchDisambiguator").slideDown("slow");

11/19/10Completed

/Views/vListing/dspListView.cfm

  • Right above <!--- loop thru all listing data, including the active and appended sold listings --->
    <cfoutput query="selSearch_View" startrow="#attributes.startrow#" maxrows="#attributes.maxrows#">
    Bob had added an include to <cfinclude template="/W/RESTServices/restListingsAppendSold.cfm">
  • I moved it to the bottom of W/Query/sel/selSearch_View.cfm

/Query/sel/selSearch_View.cfm

  • Added PD.ld to select; else section of attributes.selectType
  • Added to the end of file, test query data to use to begin testing sold data if/then

    <cfset QueryAddRow( selsearch_View ) />
    <cfset temp = QuerySetCell(selsearch_View, "address", "123 Main Street")>
    <cfset temp = QuerySetCell(selsearch_View, "show_address", "0")>
    <cfset temp = QuerySetCell(selsearch_View, "cit", "Bangor")>
    <cfset temp = QuerySetCell(selsearch_View, "st", "MN")>
    <cfset temp = QuerySetCell(selsearch_View, "statusdescription", "Sold")>
    <cfset temp = QuerySetCell(selsearch_View, "br", "3")>
    <cfset temp = QuerySetCell(selsearch_View, "bth", "2")>
    <cfset temp = QuerySetCell(selsearch_View, "lp", "145687")>
    <cfset temp = QuerySetCell(selsearch_View, "sqft", "920")>
    <cfset temp = QuerySetCell(selsearch_View, "heading", "Hang out in Bangor!")>

    <cfset QueryAddRow( selsearch_View ) />
    <cfset temp = QuerySetCell(selsearch_View, "address", "639 Highline Avenue")>
    <cfset temp = QuerySetCell(selsearch_View, "show_address", "0")>
    <cfset temp = QuerySetCell(selsearch_View, "cit", "Tolouse")>
    <cfset temp = QuerySetCell(selsearch_View, "st", "WA")>
    <cfset temp = QuerySetCell(selsearch_View, "statusdescription", "Sold")>
    <cfset temp = QuerySetCell(selsearch_View, "br", "2")>
    <cfset temp = QuerySetCell(selsearch_View, "bth", "1")>
    <cfset temp = QuerySetCell(selsearch_View, "lp", "200000")>
    <cfset temp = QuerySetCell(selsearch_View, "sqft", "1300")>
    <cfset temp = QuerySetCell(selsearch_View, "heading", "Visit Toulouse!!!")>

/RESTServices/restListingsAppendSold.cfm

  • Right underneath <!--- loop thru all data columns in current sold listing ---> Bob had added a Switch statement to map the columns.
  • Then I swapped it to a Custom Tag that used cfscript CustomTags/mapColumns.cfm
  • Then George/Bob figured out a way to rebname the column names before we get them, so now it is:
    <cfset pgresColName = keysToStruct[j]>
    <cfif pgresColName EQ "SOLD_SOLDPRICE">
        <cfset colName = "LP">
    <cfelseif pgresColName EQ "SOLD_SOLDDATE">
        <cfset colName = "LD">
    <cfelse>
        <cfset colName = UCASE(Right(keysToStruct[j], Len(keysToStruct[j])-5))>
    </cfif>
11/22/10Data Map

index.cfm contains /Views/vAbout/dspHomePageMessage.cfm. Clicking submit or hitting Enter launches triggerSearch(document.hp_search_form) which is in /js/refresh/front_page.js.

$("#hp_search_box,#search_front_mls").keypress(function (e) {
    if (e.which == 13) {
        triggerSearch(document.hp_search_form);
    }
});

function triggerSearch( form ) {
    if ( form.search.value == "location" ) {
        if ( form.location.value != '' ) {
            LOCATION_GATEWAY.findLocation( form.location.value );
        } else {
            window.location = 'index.cfm?fuseaction=listing.SearchLanding';
        }
    } else if ( form.search.value == "mls" ) {
        LOCATION_GATEWAY.targetMls( form.mls_num.value );
    }
}

LOCATION_GATEWAY is defined in dspInteractiveMapControlLocationSearch.cfm

var LOCATION_GATEWAY = new LocationGateway( "mapControlLocationSearchService", "index.cfm?fuseaction=#attributes.XFA.ProcessSearch#", "#attributes.mapConnectionProductChoice#","#attributes.mapConnectionKey#","index.cfm?fuseaction=#attributes.XFA.ReportSearch#" );

LocationGateway is defined in /js/map/locationGateway.js
function LocationGateway( node, url, product, key, log ) {
    // LocationGateway attributes
    this.server = new LocationGatewayMsve( this );
    this.server = new LocationGatewayGmap( this );
    this.fixes = [ ];

    // LocationGateway methods
    this.findLocation = LocationGatewayFindLocation;
    this.targetMls = LocationGatewayTargetMls;
}

function LocationGatewayMsve() contains this.findLocation=LocationGatewayMSVEFindLocation. function LocationGatewayMSVEFindLocation() contains this.server.Find(...)
function LocationGatewayGmap() contains this.findLocation=LocationGatewayGmapFindLocation. function LocationGatewayGmapFindLocation() contains this.server.getLocations(...)

function LocationGatewayFindLocation() contains this.server.findLocations
function LocationGatewayTargetMls() jumps right to the Search landing page with a location.href=

Location Field

MLS Field

 

 
Map View List View Map View List View
       

Searching the site for selSearch_View.cfm returned

  • W/tiny.cfm
  • W/Controllers/Listing/actrCreateAENPublic.cfm
  • W/Views/vListing/dspListView.cfm

 

11/22/10/Query/sel/selSearch_View.cfm

Getting the checkboxes to work with the Location search - Added a query of queries to wipe out the Active results if the box was not checked, but Sold was. Need this query to establish the query name and the column names.

<!--- If Sold is checked, but Active is not, erase the data from the query, but keep the column names --->
<cfif NOT isDefined("attributes.statusActive") AND isDefined("attributes.statusSold") >
    <cfquery name="selSearch_View" dbtype="query">
        SELECT *
        FROM selSearch_View
        WHERE 1=2
    </cfquery>
</cfif>

Also wrapped the RESTful call into an if/then to only fire if Sold is selected.

<!--- get sold listings from postgres and add them to the selSearch, but only if "Sold" checkbox from first screen --->
<cfif attributes.selectType EQ "ALL" AND isDefined("attributes.statusSold") >
    <cfinclude template="/W/RESTServices/restListingsAppendSold.cfm">
</cfif>

 

11/24/10

  • Remove RESTFul call from bottom of selSearch_View and make it it's own thing.

Maybe add the blank query to the top of restListingsAppendSold.cfm and call that file from the Fusebox switch files.

  • Moved restListingsAppendSold.cfm from /RESTServices/ to /Query/sel/ and renamed it selRestListingsAppendSold.cfm
  • Added <cfset AddToQ('q.selRestListingsAppendSold')> to /Controllers/ListingSearch/fbx_switch.cfm - SearchPropertyMap case - line 237. Nothing
  • Added <cfset AddToQ('q.selRestListingsAppendSold')> to /Controllers/Listing/fbx_switch.cfm - SearchPropertyMapGetListingLocationXML case. broke Map view.
  • Added <cfset AddToQ('q.selRestListingsAppendSold')> to /Controllers/Listing/fbx_switch.cfm - SearchPropertyMapGetListingLocation case - line 1440. broke Map view.
  • Added <cfset AddToQ('q.selRestListingsAppendSold')> to /Models/mListing/fbx_switch.cfm - GetProperty case. broke List view.
11/29/10/Query/sel/selSearch_ViewGeo.cfm
  • Copied code from selSearch_View except attributes.selectType EQ "GEO"
  • Made sure that columns being pulled from REST also were in the selSearch_ViewGeo SQL query. (Many of them were missing)
  • Bob's hard-coded data had the lat/long's reversed.

Completed

  • Search for Kirkland. With Sold checked, a property by Magnusen Park on 75th shows up.

To do

  • Get address to show up - right now it says "Address not Disclosed" even though the address is sent through, and show address is 1. With live data, this item does not display this way anymore.
  • Turn Sold House Red.

Put if/then around column setting to eliminate POSTgres column if it does not exist in sql.
<cfif ListFindNoCase(selSearch_View.ColumnList, colname) NEQ 0 >
    <!--- add the sold listing's column data --->
    <cfset temp = QuerySetCell(selSearch_View, colName, soldListing[pgresColName])>
</cfif>

This, however created problems. Will try adding columns to SQL.

11/29/10How do the Icons get created?
Side note: /js/map/gmap.js and /js/map/listingMapXHR.js also contain references to icons and markers but were both last updated on 2010-09-16 17:36:05Z jgiven

In /js/map/msve.js below line 127, if you add anything to the background-image style string, it shows in the HTML.

  • Line 127
    The path to the image is contained in src which gets passed into:
    function ListingMSVEGetMarkerStyle( src, size, offset ) {
        var style = "";
        style = style + "background-image:url('" + src + "');";
    }
  • Line 53
    this.getMarkerStyle = ListingMSVEGetMarkerStyle;
  • Line 103
    function ListingMSVEGetMarkerHTML( iSrc, iSize, iOffset, sSrc, sSize ) {
        var html = "";
        // both the shadow, if it exists, and the icon live in a separate container
        if ( sSrc ) {
            html = html + '<div style="' + this.getMarkerStyle( sSrc, sSize ) + '" />';
        }
        html = html + '<div style="' + this.getMarkerStyle( iSrc, iSize ) + '" />';
        if ( sSrc ) {
            html = '<div style="' + this.getMarkerStyle( null, sSize, iOffset ) + '">' + html + '</div>';
        } else {
            html = '<div style="' + this.getMarkerStyle( null, iSize, iOffset ) + '">' + html + '</div>';
        }

        return html;
    }
  • Line 52
    this.getMarkerHTML = ListingMSVEGetMarkerHTML
  • Line 158
    function ListingMSVEInitializeIcons( ) {
        this.iconMap = new Array( );
        for ( var index in this.icons ) {
            this.iconMap[index] = new Object( );
            for ( var key in this.icons[index] ) {
                this.iconMap[index][key] = new VECustomIconSpecification( );
                this.iconMap[index][key].Image = this.icons[index][key].iSrc;
                this.iconMap[index][key].CustomHTML = this.getMarkerHTML( this.icons[index][key].iSrc, this.icons[index][key].iSize, new GeoPoint( 0, -Math.round( this.icons[index][key].iAnchor.y / 2 ) ), this.icons[index][key].sSrc, this.icons[index][key].sSize );
            }
        }
    }
  • Line 80
    this.initializeIcons = ListingMSVEInitializeIcons;
  • Line 358
    /**
    * initialize the ListingMapIF
    * @note called when plugin is activated, or
    * page is loaded or resized
    */
    function ListingMSVEInitialize( ) {
        // initialize the icons
        this.initializeIcons( );
    }
  • Line 60
    this.initialize = ListingMSVEInitialize;

In /js/map/listingMapRegistry.js this.icons is initialized

  • function ListingMapRegistry( form, node, mask ) {
        // icon array with ptyp index
        // object holds standard and open icons, in dark and light
        // light icons are for dark backgrounds, like aerial
        this.icons = new Array( );

        this.icons[1] = new Object( );

        this.icons[1].std_drk =
        new ListingMapIcon( basepath + "map/pin.png", new GeoPoint( 22, 34 ), new GeoPoint( 10, 33 ),
        basepath + "map/shadow.png", new GeoPoint( 41, 34 ) );
        this.icons[1].std_lt = new ListingMapIcon( this.icons[1].std_drk );
        this.icons[1].std_lt.iSrc = basepath + "map/pin_inverted.png";

        this.icons[1].open_drk =
        new ListingMapIcon( basepath + "map/pin-open2.png", new GeoPoint( 41, 49 ), new GeoPoint( 11, 48 ),
        basepath + "map/shadow-open.png", new GeoPoint( 41, 49 ) );
        this.icons[1].open_lt = new ListingMapIcon( this.icons[1].open_drk );
        this.icons[1].open_lt.iSrc = basepath + "map/pin-open-reversed2.png"

        this.icons[2] = new Object( );

        this.icons[2].std_drk =
        new ListingMapIcon( basepath + "map/pin_condo.png", new GeoPoint( 22, 34 ), new GeoPoint( 10, 33 ),
        basepath + "map/shadow-condo.png", new GeoPoint( 41, 36 ) );
        this.icons[2].std_lt = new ListingMapIcon( this.icons[2].std_drk );
        this.icons[2].std_lt.iSrc = basepath + "map/pin_condo_inverted.png";

        this.icons[2].open_drk =
        new ListingMapIcon( basepath + "map/pin-open-condo2.png", new GeoPoint( 41, 49 ), new GeoPoint( 11, 48 ),
        basepath + "map/shadow-open-condo.png", new GeoPoint( 41, 49 ) );
        this.icons[2].open_lt = new ListingMapIcon( this.icons[2].open_drk );
        this.icons[2].open_lt.iSrc = basepath + "map/pin-open-condo-reverse2.png";
    }
12/2/10More Icons

In file /js/map/msve.js, line 498, there is function ListingMSVESetMapCallouts( fixes ). it has these lines of code:

  • for ( key in fixes ) {
        var fix = fixes[key];
        var iconCollection = this.iconMap[fix.ptyp] ? this.iconMap[fix.ptyp] : this.iconMap[1];
        var iconType = fix.attributes.hasOpenHouse( ) ? "open_" + this.iconStyle : "std_" + this.iconStyle;
        var markerOptions = iconCollection[iconType];
        var marker = new VEShape( VEShapeType.Pushpin, new VELatLong( fix.earth.y, fix.earth.x ) );
        marker.SetCustomIcon( markerOptions );
        this.markerLayer.AddShape( marker );
    }

    * fix.pytp is coming across undefined, so all the icons are set to houses. If I add fix.ptyp=2, all the houses turn into Condos.

    added lines at 509:
    • if (fix.attributes.hasOpenHouse( )){
          var iconType = "open_" + this.iconStyle;
      } else {
          if (fix.statusDescription == 'Sold'){
              var iconType = "sold_" + this.iconStyle;
          } else {
              var iconType = "std_" + this.iconStyle;
          }
      }
  • Need to add function in js/listing/listingattribute.cfm for sold
  • Line 65: this.setMapCallouts = ListingMSVESetMapCallouts;
  • in /js/map/listingMapRegistry.js
    function setMapCallouts( ) {
        LISTING_MAP_REGISTRY.setMapCallouts( retrieveLocationFix( ) );
    }
  • in /js/map/map.js
    // retrieve the location fix
    function retrieveLocationFix( ) {
        return LOCATION_FIXES;
    }

in /js/map/map.js

  • function clearLocationFix( ) {
        LOCATION_FIXES = new Object( );
    }

    Line 728
    // method to add a LocationFix
    function addLocationFix( id,
    fixFound, fixScheme, fixProvider, fixPositionX, fixPositionY, fixLatitude, fixLongitude, locPid, locAddress, locBedBath,
    locPrice, locPtyp, locUrl, locFull, locThumb, locAttributes, locMls, locCompany ) {
        LOCATION_FIXES[ id ] = new LocationFix( id,
        fixFound, fixScheme, fixProvider, fixPositionX, fixPositionY, fixLatitude, fixLongitude, locPid, locAddress, locBedBath,
        locPrice, locPtyp, locUrl, locFull, locThumb, locAttributes, locMls, locCompany );
    }

    Line 552: LocationFix()

Is called from /js/map/listingMapXHR.js

  • function listingCollectionXHRStateChange( xhr ) {
        addLocationFix( id,
        fixFound, fixScheme, fixProvider, fixPositionX, fixPositionY, fixLatitude, fixLongitude, locPid, locAddress, locBedBath,
        locPrice, locPtyp, locUrl, locFull, locThumb, new ListingAttribute( locAttributes ), retrieveMLS( locMls ), locCompany );
    }

    * also in this function, the values being set are being pulled from "listing" which is an xml file built in /Models/mListing/actlistingCollectionThin.cfm
  • issues: locPtyp is not sending any value. locAttributes is where I might be able to set the sold question
  • Map.js line 552: function LocationFix() also has big list of fields
12/6/10Search Terms with Sold Data

Added to restListingsAppendSold.cfm:

<cfset variables.myPtyp = "">
<cfloop list="#attributes.ptyp#" index="i" >
    <cfif variables.myPtyp EQ "">
        <cfset variables.myPtyp = i>
    <cfelse>
        <cfset variables.myPtyp = variables.myPtyp & "|" & i>
    </cfif>
</cfloop>
<cfset mySearchString = "where=Sold_ptyp,IN:" & #variables.myPtyp# >
<cfif isDefined("attributes.zip") AND attributes.zip NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_zip:" & #attributes.zip# >
</cfif>

<cfif isDefined("attributes.minsqft") AND attributes.minsqft NEQ "" AND isDefined("attributes.maxsqft") AND attributes.maxsqft NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_sqft,IR:" & #attributes.minsqft# & "|" & #attributes.maxsqft# >
<cfelse>
    <cfif isDefined("attributes.minsqft") AND attributes.minsqft NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_sqft,GE:" & #attributes.minsqft# >
    </cfif>
    <cfif isDefined("attributes.maxsqft") AND attributes.maxsqft NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_sqft,LE:" & #attributes.maxsqft# >
    </cfif>
</cfif>

<cfif isDefined("attributes.minprice") AND attributes.minprice NEQ "" AND isDefined("attributes.maxprice") AND attributes.maxprice NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_soldprice,IR:" & #attributes.minprice# & "|" & #attributes.maxprice# >
<cfelse>
    <cfif isDefined("attributes.minprice") AND attributes.minprice NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_soldprice,GE:" & #attributes.minprice# >
    </cfif>
    <cfif isDefined("attributes.maxprice") AND attributes.maxprice NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_soldprice,LE:" & #attributes.maxprice# >
    </cfif>
</cfif>

<cfif isDefined("attributes.ybtmin") AND attributes.ybtmin NEQ "" AND isDefined("attributes.ybtmax") AND attributes.ybtmax NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_ybt,IR:" & #attributes.ybtmin# & "|" & #attributes.ybtmax# >
<cfelse>
    <cfif isDefined("attributes.ybtmin") AND attributes.ybtmin NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_ybt,GE:" & #attributes.ybtmin# >
    </cfif>
    <cfif isDefined("attributes.ybtmax") AND attributes.ybtmax NEQ "">
        <cfset mySearchString = mySearchString & "&and=Sold_ybt,LE:" & #attributes.ybtmax# >
    </cfif>
</cfif>

<cfif isDefined("attributes.br") AND attributes.br NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_Br,GE:" & #attributes.br# >
</cfif>
<cfif isDefined("attributes.bth") AND attributes.bth NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_Bth,GE:" & #attributes.bth# >
</cfif>
<cfif isDefined("attributes.st") AND attributes.st NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_st:" & #attributes.st# >
</cfif>
<cfif isDefined("attributes.cit") AND attributes.cit NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_cit:" & #attributes.cit# >
</cfif>

<cfif isDefined("attributes.water") AND attributes.water NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_wft:" & #javaCast("boolean",attributes.water)# >
</cfif>
<cfif isDefined("attributes.vew") AND attributes.vew NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_vws:" & #javaCast("boolean",attributes.vew)# >
</cfif>
<cfif isDefined("attributes.premier") AND attributes.premier NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_Premier:" & #javaCast("boolean",attributes.premier)# >
</cfif>
<cfif isDefined("attributes.nc") AND attributes.nc NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_new_con:" & #javaCast("boolean",attributes.nc)# >
</cfif>

<cfif isDefined("attributes.solddays") AND attributes.solddays NEQ "">
    <cfset mySearchString = mySearchString & "&and=Sold_solddate,GE:" & #DateFormat(DateAdd( "d", -solddays, now() ), "yyyy-mm-dd")# >
</cfif>

<cfset mySearchString = mySearchString & "&and=Sold_lat,IR:" & #attributes.extentSouth# & "|" & #attributes.extentNorth# >
<cfset mySearchString = mySearchString & "&and=Sold_long,IR:" & #attributes.extentWest# & "|" & #attributes.extentEast#>

12/7/10How Does Right-Column Detail Page Get Created?

From the Map View page, either from the list box, or the pop-up link, this gets called:

  • javascript:triggerPropertyDetails('http://172.20.0.74/index.cfm?fuseaction=listing.PP3ListingDetail&ListingID=67146731',true,'67146731');
  • in /js/map/lib.js there is (also in /js/refresh/listview.js)
    function triggerPropertyDetails( url, frame, pid ) {
        currentTab = 'tabProperty';
        if ( frame ) {
            LISTING_DETAIL_FRAME_LOADER.load( url );
            toggleTabs('Property');
        } else {
            updateListingDetailXHR( url );
        }
        CURRENT_PID = pid;
    }
  • in /Views/vListing/dspListView.cfm
    LISTING_DETAIL_FRAME_LOADER = new FrameLoaderSCS( "property", "contentPropertyFrame" );
  • function FrameLoaderSCS( name, id ) {
        // attributes
        // StateChangeListener objects.
        // require one method, stateChange( StateChangeSupport container )
        this.listeners = new Array( );
        this.name = name ? name : null;
        this.state = STATE_CHANGE_STATE_UNINITIALIZED;
        this.status = STATE_CHANGE_STATUS_OK;
        this.id = id;

        this.load = FrameLoaderSCSLoad;
        this.loaded = FrameLoaderSCSLoaded;
    }

In /Controllers/Listing/fbx_Switch.cfm

  • <cfcase value="PP3ListingDetail">
        <cfif isDefinedValue("attributes.listingID")>
            <cf_addstyle file="slideViewer/smallViewer.css">
            <cfset attributes.XFA.PropertyFlyer = "Listing.PropertyFlyer">
            <cfset attributes.XFA.PrintPhotoGallery = "viewGallery.PrintPhotos">
            <cfset attributes.XFA.EmailFriend = "Listing.ListingEmailPP">
            <cfset attributes.XFA.EmailAgent = "Listing.ListingEmailAgentPP">
            <cfset attributes.XFA.addFavorite = "account.actAddFavorite">
            <cfset attributes.XFA.removeFavorite = "account.actDeleteFavorite">
            <cfset attributes.XFA.EmailNoAgent = "Listing.ListingEmailNoAgentPP">
            <cfset attributes.XFA.LookupAgent = "agentOffice.LookupAgentResultsListingPP">
            <cfset attributes.XFA.listingDetail = "listing.listingDetailUpdated">
            <cfset attributes.XFA.photoViewer = "Listing.largePhotos">
            <cfset attributes.XFA.AgentDetail = "agentOffice.agentDetail">
            <cfset attributes.submitButton = "refresh/submit.png">
            <cfset AddToQ('mListing.GetListingDetail')>
            <cfset AddToQ('mListing.RetrievePhotoGallery')>
            <cfset AddToQ('agentOffice.agentContactDetailPP into agentInfo')>
            <cfset AddToQ('mListing.InitSlideViewer into photos')>
            <cfset AddToQ('vListing.SlideViewer into photos')>
            <cfset AddToQ('vListing.PP3ListingDetailLayout into blankLayoutFile')>
            <cfset AddToQ('vLayout.blankLayout AS Layout')>
        <cfelse>
            <cfset AddToQ('vListing.PP3noListingSelected into blankLayoutFile')>
            <cfset AddToQ('vLayout.blankLayout AS Layout')>
        </cfif>
    </cfcase>
  • /Models/mListing/fbx_Switch.cfm has:
    <cfcase value="GetListingDetail">
        <cfset AddToQ('q.selPub_View')>
    </cfcase>
  • /Views/vListing/fbx_Switch.cfm has
    <cfinclude template="dsp#fusebox.fuseaction#.cfm">, so dspPP3ListingDetailLayout.cfm

So, in theory, I could change the details lilnk to /index.cfm?fuseaction=listing.PP3SoldListingDetail, add a case in the controller, and basically copy the attributes and addtoq's but substitute PP3SoldListingDetailLayout. Where is the sold data? Is it in attributes already?

12/8/10 SOLVED:

  • in /Controllers/Listing/fbx_Switch.cfm I copied the PP3ListingDetail case (Switch) to SoldListingDetail.
    • Changed AddToQ('mListing.GetListingDetail') to AddToQ('mListing.GetSoldListingDetail')
    • Changed AddToQ('vListing.PP3ListingDetailLayout into blankLayoutFile') to AddToQ('vListing.SoldListingDetailLayout into blankLayoutFile')
  • in /Models/mListing/fbx_Switch.cfm I copied the GetListingDetail case (Switch) to GetSoldListingDetail
    • Changed AddToQ('q.selPub_View') to AddToQ('q.selSoldPub_View')
  • in /Query/sel created selSoldPub_View.cfm by copying selPub_View.cfm, commenting out the query, then copying the POSTGRES stuff from /RESTServices/restListingsAppendSold.cfm
    • Built an empty query named selPub_View
    • Set the http request json query string to ?where=Sold_id:#attributes.ListingID#
    • Removed the outer loop of the append since this result will only return one result.
12/10/10How Do Images Show up on the Detail Page for Solds?

From the Map View page, either from the list box, or the pop-up link, this gets called: javascript:triggerPropertyDetails('http://172.20.0.74/index.cfm?fuseaction=listing.SoldListingDetail&ListingID=6839610',true,'6839610');

In /Controllers/Listing/fbx_Switch.cfm

  • <cfcase value="SoldListingDetail">
    <cfset AddToQ('mListing.GetSoldListingDetail')>
    <cfset AddToQ('mListing.RetrievePhotoGallery')>
    <cfset AddToQ('mListing.InitSlideViewer into photos')>
    <cfset AddToQ('vListing.SlideViewer into photos')>
  • /Models/mListing/actInitSlideViewer.cfm

    var GALLERY = new Gallery( "Listing_#attributes.listingid#" );

    And Listing_6839610 comes from ?

 

12/10/10The More Details Button (Flyer)

From the Map View page, details page in right-column, a new page gets called with: http://172.20.0.74/index.cfm?fuseaction=listing.SoldlistingDetailUpdated&listingID=11851&paginate=true

In /Controllers/Listing/fbx_Switch.cfm

  • <cfcase value="SoldListingDetailUpdated">
    <cfparam name="contactAgent" default="">
    <cfset attributes.pagetitle = "Listing Detail | Windermere Real Estate">
    <cfset attributes.XFA.LookupAgent = "agentOffice.LookupAgentResultsListingPP">
    <cfset attributes.XFA.listingDetail = "listing.ListingDetailUpdated">
    <cfset attributes.XFA.addFavorite = "account.actAddFavorite">
    <cfset attributes.ppVersion = "gmap">
    <cfset attributes.mapConnectionProductChoice = "gmap">
    <cfparam name="zillow_graph" default="">
    <cfparam name="agentInfo" default="">
    <cfparam name="attributes.paginate" default="false" />
    <cf_addstyle file="slideViewer/smallViewer.css">
    <cf_addscript file="map/email.js">
    <cfset attributes.submitButton = "refresh/submit.png">
    <cfset attributes.method = "get">
    <cfparam name="attributes.ListingID" default="0">
    <cfset attributes.ListingID = #Left(REReplaceNoCase(attributes.ListingID,"[^0-9^]","","ALL"), 9)#>
    <cfset attributes.currentListingID = attributes.ListingID>
    <cfset AddToQ('vAgentOffice.ContactAgent into contactAgent')>
    <cfset AddToQ('mGeography.InitInteractiveMapDefaults')>
    <cfset AddToQ('mListing.GetListingDetail')>
    <cfset AddToQ('mListing.RetrievePhotoGallery')>
    <cfset AddToQ('listing.setListingAgents')>
    <cfset AddToQ('mListing.InitSlideViewer into photos')>
    <cfset AddToQ('vListing.SlideViewer into photos')>
    <cfset AddToQ('Listing.actResultValueList')>
    <cfset AddToQ('vMortgage.MortgageCalcRedux into mortgageCalc')>
    <cfif attributes.paginate>
    <cfset AddToQ('vGeography.InteractiveMapControlListingDetailPagination into pagination')>
    </cfif>
    <cfset AddToQ('vListing.SoldListingDetailPublicUpdated into col2')>
    <cfset AddToQ('vLayout.#request.page.skin# AS Layout')>
    <cfset AddToQ('vLayout.masterLayout AS Layout')>
    </cfcase>

 

12/15/10How Do the Pop-Up Boxes on the Map Work?

/Views/vGeography/dspPP3MapLayout.cfm - contains a section for <!--- START: New Listing Pop Up ---> which contains

<!--- START: New Listing Pop Up --->
<table id="popUpContainer" cellpadding="0" cellspacing="0" border="0" width="131">
    <tr>
        <td valign="middle" width="12">
            <img src="#request.appImages#/map/pointerLeft.gif" id="pp3pointerLeft">
        </td>
        <td width="107" align="center">
            <img src="#request.appImages#/map/popUpTop.gif"><br>
            <div id="pp3poMeta"></div>
            <img src="#request.appImages#/map/popUpBottom.gif"></td>
        <td valign="middle" width="12">
            <img src="#request.appImages#/map/pointerRight.gif" id="pp3pointerRight">
        </td>
    </tr>
</table>
<!--- END: New Listing Pop Up --->

/js/map/lib.js, line 452, function displayLayer(tempX,tempY,showHide,thumb)

  • There is an if/then to decide if the pin is on the left or right side of the map, which detrmnines whether or not to show the Pop-up on the left or right side of the pin.
  • tempX is the offset of the div layer. +13 to the right, or - 143 to the left.
  • tempY is the up/down offset. Currently set to 30
    This changes where the box pops up when the listing on the right table is rolled over, or when the pin is rolled over
  • There is also a -30 on the Y value in function listingDropDown(), line 313
    positionevent = new PositionChangeEvent( fixOrPosition.position, fixOrPosition.earth, new GeoPoint( fixOrPosition.screen.x, fixOrPosition.screen.y - 30 ) );
    This changes where the box pops up JUST when the listing on the right table is rolled over
  • There is also an if/then at the bottom to set the offset again depending on whether it is mouseover or not. The mouseover call comes from function displayThumbNail( pid, terse ) if terse is true.
    • In function buildSummary() //where the right-side boxes get built
      var summary = document.getElementById("summary-container");
      listingHolder.onmouseover = function( ) { displayThumbNail( this.pid ); return true; };
      summary.appendChild( listingHolder );
    • Setting an if/then around the Show function call on line 392 does prevent the box from floating with the mouse, but it also does not re-set when mouseovering the list boxes.

In /js/map/listingMapRegistry.js, when the icons are built, they also have a x,y value [ new GeoPoint( 0, 0 ) ] that gets passed as iAnchor or iOffset in other functions.

displayLayer(positionevent.screen.x, positionevent.screen.y, 1) show and hide call functions are in function listingDropDown( fixOrPosition ) line 305 of /js/map/lib.js

12/21/10Nearby Comparable Solds

Added Nearby Comparable Solds. The URL feeds the Search Form which then performs the Query. If a value comes in that the Form can't handle, the value gets ignored.

<cfif right(selPub_view.bth,3) EQ ".25">
<cfset selPub_view.bth -= .25>
</cfif>

<cfset variables.priceValues = "10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000, 125000, 150000, 175000, 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, 400000, 425000, 450000, 475000, 500000, 550000, 600000, 650000, 700000, 750000, 800000, 850000, 900000, 950000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000">

<cfparam name="variables.priceValuesMin" default="0">
<cfparam name="variables.priceValuesMax" default="10000000">

<cfloop list="#variables.priceValues#" index="i">
    <cfif i GT selPub_view.lp >
        <cfset variables.priceValuesMax = i>
        <cfbreak>
    </cfif>
    <cfif selPub_view.lp GTE i>
        <cfset variables.priceValuesMin = i>
    </cfif>
</cfloop>


<a href="http://172.20.0.74/index.cfm?fuseaction=listing.SearchLanding&mapExtentNorth=#selPub_view.lat+0.03#&mapExtentSouth=#selPub_view.lat-0.03#
&mapExtentEast=#selPub_view.long+0.064#&mapExtentWest=#selPub_view.long-0.064#&mapCenterLatitude=#selPub_view.lat#&mapCenterLongitude=#selPub_view.long#
&scheme=8&search=location&searchType=1&origLP=#selPub_view.lp#&minPrice=#variables.priceValuesMin#&MaxPrice=#variables.priceValuesMax#&br=#selPub_view.br#
&origBR=#variables.origBR#&bth=#selPub_view.bth#&origBTH=#variables.origBTH#&origsqft=#selPub_view.sqft#&minsqft=#ROUND(selPub_view.sqft*.8)#
&maxsqft=#ROUND(selPub_view.sqft*1.2)#&ptyp=#selPub_view.ptyp#&statusSold=1&origSoldDate=#selPub_view.ld#&solddays=730&boundaryState=OFF
&soldNearby=1" target="_blank" title="Using Map Boundaries, Bed, Bath, +/-Square Feet, +/-Sold Price, Last 6 Months.">Nearby Comparable Solds</a>

12/21/10Features to Detail (left column and flyer)

Features is being sent as a struct with members. Some of the members have arrays (flooring can be carpet and tile).

  1. So I loop over the structure I am sent "structKeyList(selPub_View.features)"
  2. then determine if the final detail is an array
  3. If it is an array, convert it to a list
  4. Camel Case the Results
  5. Use the Struct name as the label (So the Actives and the Solds will have slightly different labels. Floors/Flooring, etc...
  • <cfloop list="#structKeyList(selPub_View.features)#" index="i">
        <cfif isArray(selPub_View.features[i]['detail'])>
            <cfset UpperDetail = ArrayToList(selPub_View.features[i]['detail'],", ")>
        <cfelse>
            <cfif Len(trim(selPub_View.features[i]['detail']))>
                <cfset UpperDetail = trim(selPub_View.features[i]['detail'])>
            </cfif>
        </cfif>

        <cfset UpperLowerDetail = REReplace(LCase(UpperDetail), "(^[[:alpha:]]|[[:blank:]][[:alpha:]])", "\U\1\E", "ALL")>
        <dt>#i#:</dt><dd>#UpperLowerDetail#</dd>
    </cfloop>

If a feature doesn't get sent, I have to do an isDefined around the version of the code above in the Flyer view. But isDefined('selPub_View.features["Garage"]') complained that the variable was not valid (wasn't I using lowercase 'garage' originally? Anyway, solved that one with: <cfif ListFind(#structKeyList(selPub_View.features)#,"Garage")> Right-column view only shows the data sent, so this line was not needed there.

Also, some properties have no Features at all, so I added an empty struct if feaures is empty to selSoldPub_View.cfm

  • <cfif NOT ListFind(#structKeyList(soldListing)#,"Features")>
        <cfset soldListing['Features'] = structNew()>
    </cfif>.
12/22/10Image Thumbnails on Map View - (Pop-up and right column list)

 

Pop-up

Right-Column List

in /js/map/lib.js (Pop-up)

  • function listingDropDown(){
        objInnerHTML += '<td class="pp3poMetaTd" align="center" style="background-image:url(' + pointLocation.thumb +'); background-repeat: no-repeat; background-position: center top' + bkclr + '">
        var pointLocation = retrieveLocationFix(matches[i]);
    }

in /js/map/lib.js (

  • function buildSummary()
    listingImage.innerHTML = "<img src=\"" + FIX_ARRAY[i].thumb + "\" width=\"75\" height=\"55\" border=\"0\"><\/a>";
  • for ( key in fixes ) {
        var pointLocation = retrieveLocationFix(key);
        FIX_ARRAY[fix_array_loopcount] = pointLocation;
    }

in /js/map/map.js

  • function retrieveLocationFix( id ) {
        if ( id ) {
            return LOCATION_FIXES[ id ];
        } else {
            return LOCATION_FIXES;
        }
    }
  • Line 728
    // method to add a LocationFix
    function addLocationFix( id,
    fixFound, fixScheme, fixProvider, fixPositionX, fixPositionY, fixLatitude, fixLongitude, locPid, locAddress, locBedBath,
    locPrice, locPtyp, locUrl, locFull, locThumb, locAttributes, locMls, locCompany ) {
        LOCATION_FIXES[ id ] = new LocationFix( id,
        fixFound, fixScheme, fixProvider, fixPositionX, fixPositionY, fixLatitude, fixLongitude, locPid, locAddress, locBedBath,
        locPrice, locPtyp, locUrl, locFull, locThumb, locAttributes, locMls, locCompany );
    }
  • function LocationFix(){
        this.thumb = locThumb;
    }

in /js/map/listingMapXHR.js

  • function listingCollectionXHRStateChange( xhr ) {
        var xml = xhr.responseXML( );
        var images = listings[i].getElementsByTagName( "image" );
        if ( images.length > 0 ) {
            // process the first image only
            locThumb = XHRFirstElementsValueByName( images[0], "thumbUrl", "" );
            locFull = XHRFirstElementsValueByName( images[0], "fullUrl", "" );
        }
    }

in /Models/mListing/actListingCollectionThin.cfm

  • <cfsavecontent variable="responseXml">
    <listingCollection>
    <listing>
        <cfset variables.fullSrc = variables.feed.escapeContent( variables.images["fullSrc"][selSearch_View.currentrow] )>
        <cfset variables.thumbSrc = variables.feed.escapeContent( variables.images["thumbSrc"][selSearch_View.currentrow] )>
        <image>
            <fullUrl>#variables.fullSrc#</fullUrl>
            <thumbUrl>#variables.thumbSrc#</thumbUrl>
        </image>
    </listing>
    </listingCollection>

Where does "images" come from?

<cfset variables.images = QueryNew( "fullSrc,thumbSrc" )> can be found in /Models/mListing/actGetMainListingImages.cfm

<cfset AddToQ('mListing.GetMainListingImages')> is found in only one place: /W/Controllers/Listing/fbx_Switch.cfm case: SearchPropertyMapGetListingLocation


Images on detail (right column and flyer page)

  • <cfscript>
        imageObj = createObject("component","/W/CFC/image/listingImage");
        imgStr = imageObj.getMainListingImage('#trim(ID)#','#selPub_View.PG#','#trim(selPub_View.hasgif)#','#selPub_View.mls#','#trim(selPub_View.ln)#','394','297','f5f5f5');
    </cfscript>
    #imgStr.imgTagString#
  • <cfx_showlistingimage
        mls="#arguments.mls#"
        listingNumber="#trim(arguments.ln)#"
        thumbWidth="100"
        thumbHeight="70"
        fullWidth="#arguments.imageWidth#"
        fullHeight="#arguments.imageHeight#"
        prefix="MLS"
        thumbBgColor="#arguments.thumbBgColor#"
        fullBgColor="#arguments.fullBgColor#">
  • /CustomTags/java/classes/windermere.jar - /com/windermere/cfx/imagestore/ShowListingImage.class

(1-7-11) SOLVED: Added CFC/image/listingImage call that was already in Detail pages and added it to restListingsAppendSold.cfm. Had to add
<cfset imgStruct.imgStore = "#TX_imageStore#"> and
<cfset imgStruct.imgID = "#TX_imageID#">
to each section of CFC so that it returned from Call.

12/27/10Nearby Solds

Added soldNearby to end of URL link on detail page.

  • Problem: attributes.soldNearby does not exist in restListingsAppendSold.cfm. It does exist in the switch.
  • Solution: Add soldNearby as a hidden input field on dspPropertyCriteriaPP.cfm.
  • Reason: The search doesn't come from the URL. The URL populates the form, and then the form is submitted to perfom the search.

Added to the link on dspSoldlistingDetailPublicUpdated.cfm

  • &origLP=#selPub_view.lp# &origBR=#variables.origBR# &origBTH=#variables.origBTH# &origsqft=#selPub_view.sqft# &origSoldDate=#selPub_view.ld# &soldNearby=1

Added to dspPropertyCriteria.cfm

<cfparam name="attributes.soldNearby" default="0">
<cfparam name="attributes.origLP" default="0">
<cfparam name="attributes.origBR" default="0">
<cfparam name="attributes.origBTH" default="0">
<cfparam name="attributes.origsqft" default="0">
<cfparam name="attributes.origSoldDate" default="0">
and <input type="hidden" name="soldNearby" value="#attributes.soldNearby#">
<input type="hidden" name="origLP" value="#attributes.origLP#">
<input type="hidden" name="origBR" value="#attributes.origBR#">
<input type="hidden" name="origBTH" value="#attributes.origBTH#">
<input type="hidden" name="origsqft" value="#attributes.origsqft#">
<input type="hidden" name="origSoldDate" value="#attributes.origSoldDate#">

Added to restListingsAppendSold.cfm

  • <cfif attributes.soldNearby EQ "1" AND attributes.statusActive NEQ "1">
        <cfset nearbyDiff = 0>
        <cfset nearbyDiff += ABS(attributes.origLP-soldListing['SOLD_SOLDPRICE']) / attributes.origLP * 300 >
        <cfset nearbyDiff += ABS(attributes.origBR-soldListing['SOLD_BR']) * 100 >
        <cfset nearbyDiff += ABS(attributes.origBTH-soldListing['SOLD_BTH']) * 200 >
        <cfset nearbyDiff += ABS(attributes.origsqft-soldListing['SOLD_sqft']) / 2 >
        <cfset nearbyDiff += ABS(attributes.mapcenterlongitude-soldListing['SOLD_long']) * 2000 >
        <cfset nearbyDiff += ABS(attributes.mapcenterlatitude-soldListing['SOLD_lat']) * 2000 >
        <cfset nearbyDiff += ABS(dateDiff('d',attributes.origSoldDate, soldListing['SOLD_SOLDDATE'] )) >

        <cfset temp = QuerySetCell(selSearch_View, "nearbyRank", nearbyDiff)>
        <cfset attributes.sortOrder = 99 >
    </cfif>
  • ORDER BY
    <cfelseif attributes.sortOrder eq "99">
        nearbyRank asc
12/16/10Fixing the Next/Previous Buttons on the List Page

When the search form is submitted, "searchString" is defined with mapExtendNorth, S, E, W, lat, long, state, zip, scheme, and display. The rest of the form is sent to the URL because the Form Submission is a Get.

The Next button uses the variable "searchString" which is only some of the search terms, but not nmost of the form options.

Solution: add <cfset AddToQ('mListing.CreateSearchString')> to the PropertyListView switch (case statement) in /Controllers/Listing/fbx_Switch.cfm

However, this adds ptyp and zip and state in there twice.

How does the original URL get created?

ANSWER:

  • Search Button >> triggerSearch() [/js/refresh/front_page.js] has a call in it to LOCATION_GATEWAY.
  • Which finds its way to [/js/map/locationGateway.js] function LocationGateway().
  • Which has a method, this.getLocationUrl = LocationGatewayGetLocationUrl;
  • This file also has function LocationGatewayGetLocationURL() which builds the URL string and includes mapExtendNorth, S, E, W, lat, long, state, zip, scheme, and display.
12/28/10Next/Previous Buttons on the List Page - Sold Pagination

The selSearch_View.cfm SQL statement does not restrict TOP row returns. It gets them all.

In dspListView.cfm,

  • <cfparam name="attributes.startrow" default="1">
    <cfparam name="attributes.maxrows" default="10">
  • <cfif attributes.listingRecordCount LTE 5000>
        <cfoutput query="selSearch_View" startrow="#attributes.startrow#" maxrows="#attributes.maxrows#">...
    <cfelse>
        Your search returned too many results...

SOLUTION: Ask REST to return a page of 4999 records, and do not use REST paging.

12/20/10Fixing the Next/Previous Buttons on the Map Page (and the Now Showing 1 through 100 of 100)

Search for 98107, only residential: get 63. Only condo: get 69. search for both: get 100. Add solds, 30 days: get 122. Only solds: 22.

Buttons
<td id="pp3Next" width="30" style="display: block;"> <img height="30" border="0" width="30" style="cursor: pointer;" onclick="listingPagination(1,'next')" src="http://172.20.0.74/images/refresh/map_paginate_next.png"/> </td>

Now Showing 1 through 100 of 100
<td id="nowShowing" style="display: block;"> Now showing <span style="font-size: 20px;">1</span> through <span style="font-size: 20px;">68</span> of </td>
<td id="countHolder" style=""> <span style="font-size: 20px;">68</span> Matches </td>

document.getElementById("nowShowing").innerHTML = 'Now showing <span style="font-size: 20px;">' + P_START + '</span> through <span style="font-size: 20px;">' + ofCOunt + '</span> of&nbsp;';

in /js/map/lib.js

  • function listingPagination( paginate,way )
        var pCount = eval(P_START + 99);
        var lCount = getListingCollectionXHRCount();
        var ofCOunt equals pCount or lCount, whichever is greater.
        if getListingCollectionXHRCount() is greater than 5000, display error message.
  • function updateCount( count ) {
        document.getElementById('countHolder').innerHTML = '<span style="font-size: 20px;">' + dollarFormat( count, false ) + '</span> Matches';
        setOpacity( 'countHolder', 0, 100, 750 );
    }

in /Views/vGeography/dspInteractiveMapPP3.cfm

  • function setGlobalCount(xhr) {
        var count = getListingCollectionXHRCount( );
        updateCount( count );

in /js/map/listingMapXHR.js

  • function getListingCollectionXHRCount( ) {
        return LISTING_COLLECTION_COUNT;
    }
  • function listingCollectionXHRStateChange( xhr ) {
        var xml = xhr.responseXML( );
        LISTING_COLLECTION_COUNT = XHRFirstElementsValueByName( xml, "listingCount", null, true );
    }

in /js/xhr/xhr.js

  • function XHRFirstElementsValueByName( xml, name, def, numeric, empty )

in /Models/mListing/actListingCollectionThin.cfm

  • <cfsavecontent variable="responseXml">
    <listingCount>#attributes.listingRecordCount#</listingCount>

And attributes.listingRecordCount is what we set at the bottom of selSearch_View.cfm and selSearch_ViewGeo.cfm

SOLVED: I had added at the bottom: <cfset attributes.listingRecordCount = "#selSearch_View.recordCount#"> I deleted that line and now the numbers are correct and the next/prev arrows work.

12/28/10Next/Previous Buttons on the Map Page - Sold Pagination

The only attribute that changes from first page to second is pStart. From 1 to 101

Added to dspPropertyCriteria.cfm

  • <cfif attributes.statusActive EQ "1" AND attributes.statusSold EQ "1" >
        <cfset attributes.PageSize = "50">
    <cfelse>
        <cfset attributes.PageSize = "100">
    </cfif>
  • (on the next and previous buttons) onclick="listingPagination(1,'next',<cfoutput>#attributes.PageSize#</cfoutput>)

lib.js

  • function listingPagination ( paginate,way,pagesize ) {
        if ((way == 'next') && (pCount < lCount)) {
            P_START = P_START + pagesize;
            document.searchListingForm.pStart.value = parseInt(document.searchListingForm.pStart.value) + pagesize;
            document.searchListingForm.RESTPage.value = parseInt(document.searchListingForm.RESTPage.value) + 1; //added 12-28-10
            updateListingCollectionXHR( );
        } else if ((way == 'prev') && (P_START > pagesize)) {
            P_START = P_START - pagesize;
            document.searchListingForm.pStart.value = parseInt(document.searchListingForm.pStart.value) - pagesize;
            document.searchListingForm.RESTPage.value = parseInt(document.searchListingForm.RESTPage.value) + 1; //added 12-28-10
            updateListingCollectionXHR( );
        }
    }

/js/map/listingMapXHR.js

  • var LISTING_COLLECTION_XHR = new XHR( "search" );
  • function updateListingCollectionXHR( ) {
        LISTING_COLLECTION_XHR.setAction( LISTING_COLLECTION_URL + queryStringFromForm( LISTING_COLLECTION_FORM, AMPERSAND_DELIM, true ) )
        LISTING_COLLECTION_XHR.run( null );

/js/xhr/xhr.js

  • function XHR( name ) {
        this.run = XHRRun;

***** SOLUTION for map view REST Pagination ******

  • Problem: Button actions are javascript, but how does restListingsAppendSold query (which is CFM) know about javascript values from the page before?
  • Hints: The search function is a submit of the form on dspPropertyCriteria.cfm.
  • Solution: Add a hidden form field for REST page number. The javascript button can then target and change that value in lib.js function listingPagination():
    document.searchListingForm.RESTPage.value = document.searchListingForm.RESTPage.value + 1
12/29/10Limit Number of Records from SQL Table

In selSearch_ViewGeo.cfm

  • <cfparam name="attributes.pStart" default="1">
    <cfparam name="attributes.paginate" default="100">

    <cfif attributes.statusActive EQ "1" AND attributes.statusSold EQ "1" >
        <cfset attributes.paginate = "50">
    <cfelseif attributes.statusActive EQ "0" AND attributes.statusSold EQ "1" >
        <cfset attributes.paginate = "1">
    <cfelse>
        <cfset attributes.paginate = "100">
    </cfif>

    <cfset attributes.thisStop = attributes.paginate - 1>
    <cfset attributes.pStop = attributes.pStart + attributes.thisStop>
  • SELECT TOP #attributes.paginate# * FROM (
        SELECT ROW_NUMBER() OVER (ORDER BY PD.lp desc) AS RowNumber, [ ... other columns ... ]
        FROM pub_data PD with (NOLOCK)
        WHERE   [...bunch of conditional stuff...]
    )
    WHERE RowNumber between #attributes.pStart# and #attributes.pStop#
1/5/11Zoom Level

In /js/map/map.js

function Map( mapID, mapExtent, mapCenter, mapScreen, mapZoomLevel )

  • I added a console.log(mapZoomLevel) inside the Map function. On initial load of zip 98107, I get 12 values of 6, and undefined, and 4 values of 15.
  • Zoom out and I get 4 values of 14
  • Zip 98133 gives me 4 values of 13
  • Seattle gives me 4 values of 11

So, Map() is being called 4 times.

function ListingMapRegistrySetExtentView() launches right before the Undefined result

function addMap() launches before every "6" value.

function ListingMSVEGetMap() launches before all 4 of the 11-14 values.

If mapCenterLatitude and mapCenterLongtitude and zoomLevel are sent, but the 4 sides are left out, the zoom takes over. Using /js/map/listingMapRegistry.js - ListingMapRegistrySetZoomView() and clued in from the comments at the top of /Models/mGeography/actMapListingRegionResolver.cfm


1/28/11REST Service Throws an Error and Gives 0 Sold Results

in restListingsSoldAppendCount.cfm

Set the default value of total solds to -1 to see where it comes out. Discover that it ends up in actListingCollectionThin.

<cfparam name="restfulSoldData['@ofCount']" default="-1">

in selSearch_View.cfm

Then, @ofCount gets set to listingRecordCountSold right after the include to restListingsSoldAppendCount. So, if the query returns nothing to change it, it gets the default.

<cfset attributes.listingRecordCountSold = restfulSoldData['@ofCount'] >

in actListingCollectionThin.cfm

<soldListingCount>#attributes.listingRecordCountSold#</soldListingCount>


2/4/11How does the detail pane magically appear in Map View when there is only 1 result and the ListingID is defined?
attributes.XFA.listingDetailPermaLink

In /Views/vGeography/dspInteractiveMapPP3.cfm

  • <!--- preload a listing --->
    <cfif isDefinedValue( 'attributes.listingid' )>
        <cf_addOnload handler="triggerPropertyDetails('#request.thisRequestNoUrlVars#?fuseaction=#attributes.XFA.listingDetailPermaLink#&ListingID=#attributes.listingid#',true,'#attributes.listingid#');">
    <cfelse>
        <cf_addOnload handler="toggleTabs('Search');">
    </cfif>

In /js/map/lib.js

  • /**
    * load the property details.
    * this method chooses the correct conduit, either ajax or frame.
    * @param url to load
    * @param mechanism for loading detail. if true,
    * utilizes frame, otherwise uses ajax ( default )
    * @param pid of this detail, sets the current pid to this.
    */
    function triggerPropertyDetails( url, frame, pid ) {
        currentTab = 'tabProperty';
        if ( frame ) {
            LISTING_DETAIL_FRAME_LOADER.load( url );
            toggleTabs('Property');
        } else {
            updateListingDetailXHR( url );
        }
        CURRENT_PID = pid;
    }

    /**
    * load the property details after xhr response
    * @param xhr object
    */
    function loadPropertyDetailsXHR( xhr ) {
        if ( xhr.success( ) ) {
            document.getElementById("contentProperty").innerHTML = xhr.responseText( );
            toggleTabs('Property');
        }
    }


 

 


Stephen Lloyd 03/01/2011