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" - +"
" - +"" - +"" - +"" - )*/ }); 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" - +"" - +"" - +"" - +"" - )*/ + }); + 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 = "| 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, "--")+" |
| 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), "--")+" |
| Bcat: | Row:1 | ||
| Vacancy Rate: | Row:1 | ||
| Effective Tax Rate: | Row:1 | ||
| Header 1 | Low | Median | High |
|---|---|---|---|
| Income | Row:4 Cell:2 | Row:4 Cell:3 | Row:4 Cell:4 |
| Expense | Row:5 Cell:2 | Row:5 Cell:3 | Row:5 Cell:4 |
| Expense Ratio | Row:6 Cell:2 | Row:6 Cell:3 | Row:6 Cell:4 |
| Cap Rate | Row:7 Cell:2 | Row:7 Cell:3 | Row:7 Cell:4 |
| Approximate Market Value Range | Row:8 Cell:2 | Row:8 Cell:3 | Row:8 Cell:4 |
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("| 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, "--")+" |
| 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), "--")+" |
| Bcat: | Row:1 | ||
| Vacancy Rate: | Row:1 | ||
| Effective Tax Rate: | Row:1 | ||
| Header 1 | Low | Median | High |
|---|---|---|---|
| Income | Row:4 Cell:2 | Row:4 Cell:3 | Row:4 Cell:4 |
| Expense | Row:5 Cell:2 | Row:5 Cell:3 | Row:5 Cell:4 |
| Expense Ratio | Row:6 Cell:2 | Row:6 Cell:3 | Row:6 Cell:4 |
| Cap Rate | Row:7 Cell:2 | Row:7 Cell:3 | Row:7 Cell:4 |
| Approximate Market Value Range | Row:8 Cell:2 | Row:8 Cell:3 | Row:8 Cell:4 |
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 @@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 +