diff --git a/TestMult.html b/TestMult.html index 88ef501..d2746ab 100644 --- a/TestMult.html +++ b/TestMult.html @@ -9,7 +9,7 @@ @@ -132,6 +192,7 @@ "dojo/number", "dojo/dom-style", "dojo/parser", + "dojo/number", "dijit/TooltipDialog", "dijit/popup", "dijit/TitlePane", @@ -140,13 +201,36 @@ "dijit/layout/ContentPane", "dijit/form/ToggleButton", "dojo/domReady!" - ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer, Color, Graphic, esriLang,number, domStyle, parser,TooltipDialog,dijitPopup, TitlePane,registry, + ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer, Color, Graphic, esriLang,number, domStyle, parser,localeNumber,TooltipDialog,dijitPopup, TitlePane,registry, ToggleButton) { parser.parse(); - + var curCDkey, curCDkey_s, curCDunit; + + /* + registry.byId("searchValue").on("click", doSearchValue); + function doSearchValue() { + + //highlight symbol + var sms = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 12, + new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, + new Color([255, 0, 0]), 0.8), + new Color([0, 0, 0, 0.35])); + + //label text symbol + var ls = new TextSymbol().setColor(new Color([0, 0, 0, 0.9])).setFont(new Font("16px", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLD, "Arial")).setOffset(15, -5).setAlign(TextSymbol.ALIGN_START); + + s.sources[0].highlightSymbol = sms; //set the symbol for the highlighted symbol + s.sources[0].labelSymbol = ls; //set the text symbol for the label + + //If multiple results are found, it will default and select the first. + s.search("New York"); + } + */ + + var map = new Map("map", { basemap: "streets", center: [-74.005941, 40.712784], // lon, lat @@ -159,19 +243,6 @@ maxScale:500, minScale:5000, id:'noncd' - /*infoTemplate: new InfoTemplate("Parcel: ${BORO}/${BLOCK}/${LOT}", - "
DOF Value 2016 Tentative: $${fmv:NumberFormat}
" - +"
Adress:${Street_Num}, ${Street_Nam}, New York, NY
" - +"
Total Units:${resunit}
" - +"
Gross SQFT:${ttlsqft} SQFT
" - +"
Stories:${story:NumberFormat}
" - +"
Year Built:${AYB}
" - +"
Residential SQFT:${ressqft} SQFT

" - +"
View Property Tax Bills
" - +"
Exemptions and Abatements
" - +"
Request Data Correction
" - +"

Search on Google Map
" - )*/ }); layer.maxScale=500; layer.minScale=5000; @@ -185,14 +256,12 @@ maxScale:500, minScale:5000, id:'cd' - /*infoTemplate: new InfoTemplate("Parcel: ${Boro}/${Block}/${Lot}", - "
Adress:${Street_Num}, ${Street_Nam}, New York, NY
" - +"
View Property Tax Bills
" - +"
Exemptions and Abatements
" - +"
Request Data Correction
" - +"

Search on Google Map
" - )*/ + }); + layercdm.maxScale=500; + layercdm.minScale=5000; + var renderer = new SimpleRenderer(symbol1); + layercdm.setRenderer(renderer); //Add layers to map map.addLayers([layer,layercdm]); @@ -215,6 +284,8 @@ //Info Window: set size map.infoWindow.resize(245,300); + + //4.a. Hover popup window set up dialog = new TooltipDialog({ id: "tooltipDialog", @@ -285,17 +356,23 @@ //map.graphics.clear(); if (hovergraph){ hovergraph.clear(); + //graphicsLayer1.clear(); + //map.graphicsLayer.clear(); } + map.setMapCursor("default"); //set mouse pointer back dijitPopup.close(dialog); } + //Clear: set mouse pointer back to default after move-out; + hovergraph.on("mouse-out", closeDialog); //Search - var s = new Search({ + var searchvar = new Search({ enableButtonMode: false, //this enables the search widget to display as a single button - enableLabel: true, + enableLabel: false, enableInfoWindow: true, showInfoWindowOnSelect: true, + /*hasButtonMode: false,*/ zoomScale: 1000, allPlaceholder: "Choose search type", activeSourceIndex:'cd', @@ -338,8 +415,8 @@ sources.push({ featureLayer: new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdmain/FeatureServer/0"), - searchFields: ["bl_sp"], - displayField: "bl_sp", + searchFields: ["CONDO_KEY"], + displayField: "CONDO_KEY", exactMatch: true, name: "Search on Condo main", outFields: ["*"], @@ -362,36 +439,78 @@ }); //Set the sources above to the search widget - s.set("sources", sources); - s.set("activeSourceIndex", 1); + searchvar.set("sources", sources); + searchvar.set("activeSourceIndex", 1); var searchcd; - s.on("search-results", function (e) { + searchvar.on("search-results", function (e) { var rs, h; rs = e.results; h = ""; + if (rs == null){ + document.getElementById("alerttext").innerHTML = "BBL cannot be find\nPlease enter a valid block and lot."; + return; + } if (rs[1] == null){ if( rs[0]==null){ h = "
rs is null
"; return; }else{//NON CONDO ([0]) var resultItems = []; - - /*if (titlePane11){ - var ch=1; - titlePane11.destroyRecursive(); - }; - var widgets = dijit.findWidgets("toolsPane"); - dojo.forEach(widgets, function(w) { - w.destroyRecursive(false); - });*/ dijit.byId("toolsPane").destroyDescendants(false); domConstruct.empty("toolsPane"); var containerNode = dojo.byId("toolsPane"); var featureAttributes = rs[0][0].feature.attributes; - for (var attr in featureAttributes) { + /*for (var attr in featureAttributes) { resultItems.push("" + attr + ": " + featureAttributes[attr] + "
"); + }*/ + resultItems.push("

Building Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"
Address: "+setNullValue(featureAttributes.Street_Num,"--") + " " + + setNullValue(featureAttributes.Street_Nam,"--") +"
Neighborhood: "+setNullValue(featureAttributes.NBHD, "--")+"
Property Type: "+setNullValue(featureAttributes.Structure, "--")+"
Total Gross SQFT: "+setNullValue(localeNumber.format(featureAttributes.ttlsqft), "--")+"
Residential SQFT: "+setNullValue(localeNumber.format(featureAttributes.ressqft), "--")+"
Commercial SQFT: "+setNullValue(localeNumber.format(featureAttributes.comsqft), "--")+"
Total Units: "+setNullValue(featureAttributes.ttlunit, "--")+"
Residential Units: "+setNullValue(featureAttributes.resunit, "--")+"
Commercial Units: "+setNullValue(featureAttributes.comunit, "--")+"
Total Story: "+setNullValue(featureAttributes.story, "--")+"
Year Built: "+setNullValue(featureAttributes.AYB, "--")+"
Zoning: "+setNullValue(featureAttributes.Zone_1, "--")+"
"); + resultItems.push("

"); + + resultItems.push("

Tax Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"
fmv: $"+setNullValue(localeNumber.format(featureAttributes.fmv), "--")+"
Agi_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Agi_Pgsf), "--")+"
Exp_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Exp_Pgsf), "--")+"
Noi_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Noi_Pgsf), "--")+"
"); + resultItems.push("

Guideline Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"
Bcat:Row:1
Vacancy Rate:Row:1
Effective Tax Rate:Row:1
Header 1LowMedianHigh
IncomeRow:4 Cell:2Row:4 Cell:3Row:4 Cell:4
ExpenseRow:5 Cell:2Row:5 Cell:3Row:5 Cell:4
Expense RatioRow:6 Cell:2Row:6 Cell:3Row:6 Cell:4
Cap RateRow:7 Cell:2Row:7 Cell:3Row:7 Cell:4
Approximate Market Value RangeRow:8 Cell:2Row:8 Cell:3Row:8 Cell:4
"); + + resultItems.push("

Income= Gross Income per sq.ft.

Expense= Total Expense per sq.ft.

"); + + function setNullValue(value, defaultValue){ + if (value == 0 || value ==""||value == "0" ||value == "$0") { + return defaultValue + } + else { + return value; + } } resultItems.push("
"); var titlePane1 = new TitlePane({ @@ -410,10 +529,61 @@ }); - s.startup(); + searchvar.startup(); + + //Search NonCD + on(dom.byId("execute3"), "click", dosearchtest); + function dosearchtest() { + document.getElementById("alerttext").innerHTML=""; + document.getElementById("execute").disabled = true; + //If multiple results are found, it will default and select the first. + searchvar.set("activeSourceIndex", 0); + var search_block = dom.byId("searchtext_Block").value; + var search_lot = dom.byId("searchtext_Lot").value; + var searchx = search_block + "/" + search_lot; + //var searchx= dom.byId("searchtext").value; + //queryunit.where = "bl_sp = '"+searchx+"'"; + searchvar.search(searchx); + } + //Query--condounit + //Initiate Query + var queryTaskunit = new QueryTask("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/tc2MH_unitlist1_12212015/FeatureServer/0"); + var queryunit = new Query(); + queryunit.returnGeometry = false; + queryunit.outFields = ["*"] + //Execute Query + on(dom.byId("execute2"), "click", executeunit); + function executeunit () { + dijit.byId("toolsPane").destroyDescendants(false); + domConstruct.empty("toolsPane"); + document.getElementById("alerttext").innerHTML=""; + var search_block = dom.byId("searchtext_Block").value; + var search_lot = dom.byId("searchtext_Lot").value; + var searchx = search_block + "/" + search_lot; + //var searchx= dom.byId("searchtext").value; + queryunit.where = "bl_sp = '"+searchx+"'"; + queryTaskunit.execute(queryunit, GetResultsUnit,function(error){console.log(error);}); + document.getElementById("execute").disabled = false; + } + function GetResultsUnit (results) { + var resultItems = []; + var resultCount = results.features.length; + if (resultCount==1){ + var featureAttributes = results.features[0].attributes; + curCDkey = featureAttributes.CONDO_KEY; + curCDunit = featureAttributes.unit; + searchvar.set("activeSourceIndex", 1); + curCDkey_s = curCDkey.toString(); + searchvar.set("value", curCDkey_s); + searchvar.search(); + }else{ + document.getElementById("alerttext").innerHTML = "BBL cannot be find\nPlease enter a valid block and lot for Condominium Unit."; + return; + }; - - //Query1216 + }; + + //Query--Get detail for Condo //Initiate Query var queryTask = new QueryTask("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdsuffix/FeatureServer/0"); var query = new Query(); @@ -422,25 +592,64 @@ //Execute Query on(dom.byId("execute"), "click", execute); function execute () { - //dojo.empty("toolsPane"); - query.where = "CONDO_KEY = "+searchcd ; + query.where = "CONDO_KEY = "+searchcd +" and Unit='"+curCDunit+"'"; queryTask.execute(query, showResults,function(error){console.log(error);}); } function showResults (results) { var resultItems = []; var resultCount = results.features.length; dijit.byId("toolsPane").destroyDescendants(false); - //domConstruct.empty("toolsPane"); var containerNode = dojo.byId("toolsPane"); for (var i = 0; i < resultCount; i++) { var featureAttributes = results.features[i].attributes; - for (var attr in featureAttributes) { - resultItems.push("
"+attr +":
"+featureAttributes[attr]+"
"); - //resultItems.push("" + attr + ": " + featureAttributes[attr] + "
"); - } - - resultItems.push("
"); + resultItems.push("

Building Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"
Address: "+setNullValue(featureAttributes.Street_Number,"--") + " " + + setNullValue(featureAttributes.Street_Name,"--") +"
Neighborhood: "+setNullValue(featureAttributes.NBHD, "--")+"
Property Type: "+setNullValue(featureAttributes.Structure, "--")+"
Total Gross SQFT: "+setNullValue(localeNumber.format(featureAttributes.ttlsqft), "--")+"
Residential SQFT: "+setNullValue(localeNumber.format(featureAttributes.ressqft), "--")+"
Commercial SQFT: "+setNullValue(localeNumber.format(featureAttributes.comsqft), "--")+"
Total Units: "+setNullValue(featureAttributes.ttlunit, "--")+"
Residential Units: "+setNullValue(featureAttributes.resunit, "--")+"
Commercial Units: "+setNullValue(featureAttributes.comunit, "--")+"
Total Story: "+setNullValue(featureAttributes.story, "--")+"
Year Built: "+setNullValue(featureAttributes.AYB, "--")+"
Zoning: "+setNullValue(featureAttributes.Zone_1, "--")+"
"); + resultItems.push("

"); + + resultItems.push("

Tax Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"
fmv: $"+setNullValue(localeNumber.format(featureAttributes.fmv), "--")+"
Agi_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Agi_Pgsf), "--")+"
Exp_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Exp_Pgsf), "--")+"
Noi_Pgsf: $"+setNullValue(localeNumber.format(featureAttributes.Noi_Pgsf), "--")+"
"); + resultItems.push("

Guideline Information

"); + resultItems.push("" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"" + +"
Bcat:Row:1
Vacancy Rate:Row:1
Effective Tax Rate:Row:1
Header 1LowMedianHigh
IncomeRow:4 Cell:2Row:4 Cell:3Row:4 Cell:4
ExpenseRow:5 Cell:2Row:5 Cell:3Row:5 Cell:4
Expense RatioRow:6 Cell:2Row:6 Cell:3Row:6 Cell:4
Cap RateRow:7 Cell:2Row:7 Cell:3Row:7 Cell:4
Approximate Market Value RangeRow:8 Cell:2Row:8 Cell:3Row:8 Cell:4
"); + + resultItems.push("

Income= Gross Income per sq.ft.

Expense= Total Expense per sq.ft.

"); + + function setNullValue(value, defaultValue){ + if (value == 0 || value ==""||value == "0" ||value == "$0") { + return defaultValue + } + else { + return value; + } + } if (i==0){ var titlePane1 = new TitlePane({ id: "titlePane"+i, @@ -456,26 +665,14 @@ content: resultItems }, domConstruct.create('div', {}, containerNode)); } - //"titlePane"+i); - /*var titlePane1= new dijit.TitlePane({ - title:"This is a title pane", - content: new ContentPane({ - content:resultItems, - }) - }, domConstruct.create('div', {}, containerNode));*/ + } /*dom.byId("toolsPane").innerHTML = "
"*/ }; + - /*var layerList = new LayerList({ - map: map, - showLegend: true, - showOpacitySlider: true, - showSublayers: true - }, "layerList"); - layerList.startup();*/ - + }); @@ -496,22 +693,44 @@
-

Search for a property to display details
+
+

This is an interactive map for Tax Class 2 Properties in New York City.

+

You are currently in the Borough Map of Manhattan.

+

Enter a Block and Lot number in the box and click "Get Non Condo" to search for rental buildings or Coop buildings .

+

Or click "Get Condo Unit" to search for units in Condominium Buidlings or Development .

+

Then click on "Get Condo Suffix Details" for information on the Condominium Buidlings or Development.

+
Search for a property to display details +
-
+ + +
- Loading... -
+