From 333e7f368cb32dff8ffd7dac245489300b140bc9 Mon Sep 17 00:00:00 2001 From: conemint Date: Wed, 16 Dec 2015 17:58:28 -0500 Subject: [PATCH 1/8] Update TestMult.html --- TestMult.html | 211 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 126 insertions(+), 85 deletions(-) diff --git a/TestMult.html b/TestMult.html index e05de3a..ab4ed8f 100644 --- a/TestMult.html +++ b/TestMult.html @@ -8,41 +8,48 @@ @@ -72,14 +73,23 @@ "dojo/dom", "dojo/on", "esri/tasks/query", "esri/tasks/QueryTask", + "esri/symbols/SimpleLineSymbol", + "esri/symbols/SimpleFillSymbol", + "esri/Color", + "esri/graphic", + "esri/lang", + "dojo/number", + "dojo/dom-style", "dojo/parser", + "dijit/TooltipDialog", + "dijit/popup", "dijit/TitlePane", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/form/ToggleButton", "dojo/domReady!" - ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, parser, TitlePane,registry, + ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, SimpleLineSymbol, SimpleFillSymbol, Color, Graphic, esriLang,number, domStyle, parser,TooltipDialog,dijitPopup, TitlePane,registry, ToggleButton) { "esri/map","esri/dijit/BasemapToggle", @@ -95,9 +105,9 @@ //ArcGIS Online feature service showing Mahattan Tc2 lots var layer = new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/TC2_MH_noncd122015/FeatureServer/0", { outFields: ["*"], - maxScale:1000, + maxScale:500, minScale:5000, - id:'noncd', + id:'noncd' /*infoTemplate: new InfoTemplate("Parcel: ${BORO}/${BLOCK}/${LOT}", "
DOF Value 2016 Tentative: $${fmv:NumberFormat}
" +"
Adress:${Street_Num}, ${Street_Nam}, New York, NY
" @@ -110,18 +120,33 @@ +"
Exemptions and Abatements
" +"
Request Data Correction
" +"

Search on Google Map
" - ),*/ + )*/ }); //Condo Suffix layer var layercdm = new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdmain/FeatureServer/0", { outFields: ["*"], - maxScale:1000, + 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
" + )*/ }); //Add layers to map map.addLayers([layer,layercdm]); + //close the dialog when the mouse leaves the highlight graphic + map.on("load", function(){ + map.graphics.enableMouseEvents(); + map.graphics.on("mouse-out", closeDialog); + + }); + + //SET UP BASEMAP TOGGLE var toggle = new BasemapToggle({ map: map, @@ -129,6 +154,74 @@ }, "BasemapToggle"); toggle.startup(); + + + //Info Window: set size + map.infoWindow.resize(245,300); + //4.a. Hover popup window set up + dialog = new TooltipDialog({ + id: "tooltipDialog", + + style: "position: absolute; width: 200px; font: normal normal normal 10pt Tahoma;z-index:100" + }); + dialog.startup(); + + dojo.style(dialog.domNode, "opacity", 0.75); + + var highlightSymbol = new SimpleFillSymbol( + SimpleFillSymbol.STYLE_SOLID, + new SimpleLineSymbol( + SimpleLineSymbol.STYLE_SOLID, + new Color([0,50,255]), 3 + ), + new Color([125,125,125,0.35]) + ); + ///4.b. HOVER FUNCTION + //listen for when the onMouseOver event fires on the layer + //when fired, create a new graphic with the geometry from the event.graphic and add it to the maps graphics layer + layer.on("mouse-over", function(evt){ + closeDialog(); + var t = "${BORO}/${BLOCK}/${LOT}
Adress:${Street_Num}, ${Street_Nam}, New York, NY
DOF Value 2017 Tentative: $${fmv:NumberFormat}
"; + var content = esriLang.substitute(evt.graphic.attributes,t); + var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); + map.graphics.add(highlightGraphic); + + dialog.setContent(content); + + domStyle.set(dialog.domNode, "opacity", 0.85); + dijitPopup.open({ + popup: dialog, + x: evt.pageX, + y: evt.pageY + }); + var t2 = "${BORO}/${BLOCK}/${LOT}"; //add for search on click + curBBL = esriLang.substitute(evt.graphic.attributes, t2);//add for search on click(4.b) + map.setMapCursor("pointer"); //Add mouse change at hover + }); + layercdm.on("mouse-over", function(evt){ + closeDialog(); + var t = "${Boro}/${Block}/${Lot}
Adress:${Street_Num}, ${Street_Nam}, New York, NY
"; + var content = esriLang.substitute(evt.graphic.attributes,t); + var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); + map.graphics.add(highlightGraphic); + dialog.setContent(content); + domStyle.set(dialog.domNode, "opacity", 0.65); + dijitPopup.open({ + popup: dialog, + x: evt.pageX, + y: evt.pageY + }); + var t2 = "{Boro}/${Block}/${Lot}"; //add for search on click + curBBL = esriLang.substitute(evt.graphic.attributes, t2);//add for search on click(4.b) + map.setMapCursor("pointer"); //Add mouse change at hover + }); + function closeDialog() { + map.graphics.clear(); + map.setMapCursor("default"); //set mouse pointer back + dijitPopup.close(dialog); + } + + //Search var s = new Search({ enableButtonMode: false, //this enables the search widget to display as a single button @@ -158,7 +251,7 @@ maxSuggestions: 3, //Create an InfoTemplate and include three fields - infoTemplate: new InfoTemplate("Parcel: ${BORO}/${BLOCK}/${LOT}", + infoTemplate: new InfoTemplate("Parcel: ${BORO}/${BLOCK}/${LOT}", "
DOF Value 2016 Tentative: $${fmv:NumberFormat}
" +"
Adress:${Street_Num}, ${Street_Nam}, New York, NY
" +"
Total Units:${resunit}
" @@ -177,8 +270,8 @@ sources.push({ featureLayer: new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdmain/FeatureServer/0"), - searchFields: ["bbl_sp"], - displayField: "bbl_sp", + searchFields: ["bl_sp"], + displayField: "bl_sp", exactMatch: true, name: "Search on Condo main", outFields: ["*"], @@ -188,14 +281,13 @@ //Create an InfoTemplate - infoTemplate: new InfoTemplate("Parcel: ${bbl_sp}", - "

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

Search on Google Map
" - +"

Google Street View
" - - ), + 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
" + ), enableSuggestions: true, minCharacters: 0 @@ -272,6 +364,8 @@ showSublayers: true }, "layerList"); layerList.startup();*/ + + }); @@ -284,7 +378,7 @@
- +
Search for a property to display details
From 76217d630fb5cebc5cb5d743d94edc7829c9bab1 Mon Sep 17 00:00:00 2001 From: conemint Date: Fri, 18 Dec 2015 13:09:15 -0500 Subject: [PATCH 4/8] Add search display in toolspane for nonCDs --- TestMult.html | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/TestMult.html b/TestMult.html index 7df4c1b..48ac377 100644 --- a/TestMult.html +++ b/TestMult.html @@ -92,7 +92,7 @@ ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, SimpleLineSymbol, SimpleFillSymbol, Color, Graphic, esriLang,number, domStyle, parser,TooltipDialog,dijitPopup, TitlePane,registry, ToggleButton) { - "esri/map","esri/dijit/BasemapToggle", + parser.parse(); @@ -103,7 +103,7 @@ }); //ArcGIS Online feature service showing Mahattan Tc2 lots - var layer = new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/TC2_MH_noncd122015/FeatureServer/0", { + var layer = new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/TC2_MH_noncd1210/FeatureServer/0", { outFields: ["*"], maxScale:500, minScale:5000, @@ -303,12 +303,32 @@ rs = e.results; h = ""; if (rs[1] == null){ - h = "
rs is null
"; - return; + if( rs[0]==null){ + h = "
rs is null
"; + return; + }else{ + var resultItems = []; + domConstruct.empty("toolsPane"); + var containerNode = dojo.byId("toolsPane"); + + var featureAttributes = rs[0][0].feature.attributes; + for (var attr in featureAttributes) { + resultItems.push("" + attr + ": " + featureAttributes[attr] + "
"); + } + resultItems.push("
"); + var titlePane1 = new TitlePane({ + id: "titlePane11", + open: false, + title: featureAttributes.bbl_sp, + content: resultItems + }, domConstruct.create('div', {}, containerNode)); + }; + }else{ + //h = inspect(rs[0][0].feature.attributes, 5, 0); + var attrs = rs[1][0].feature.attributes; + searchcd=attrs.CONDO_KEY; }; - //h = inspect(rs[0][0].feature.attributes, 5, 0); - var attrs = rs[1][0].feature.attributes; - searchcd=attrs.CONDO_KEY; + }); From d9973ac2418cd8b4e47f9cb367eca34624b3b4e4 Mon Sep 17 00:00:00 2001 From: conemint Date: Fri, 18 Dec 2015 17:37:52 -0500 Subject: [PATCH 5/8] Update TestMult.html styled --- TestMult.html | 75 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/TestMult.html b/TestMult.html index 48ac377..35ebd18 100644 --- a/TestMult.html +++ b/TestMult.html @@ -43,12 +43,32 @@ display: none; } + #search { - position: absolute; - z-index: 1; - right: 0; - top: 0; - } + display: block; + position: absolute; + z-index: 40; + top: 90px; + left: 100px; + } + #infobox { + top: 31px; + color: #444; + height: auto; + font-family: arial; + font-weight: bold; + font-size: 12px; + left: 60px; + margin: 5px; + padding: 10px; + position: absolute; + width: 200px; + z-index: 40; + border: solid 1px #001B33; + border-radius: 4px; + background-color: #EBF0F5; + } + #BasemapToggle { position: absolute; bottom: 20px; @@ -56,6 +76,25 @@ z-index: 45; } .esriPopup .action.zoomTo { display: none; } + #headtable { + border: 0px solid #0052A3; + background-color: #0052A3; + width: 100%; + } + .claro .dijitContentPane { + padding: 0; + } + #toolsPane{ + background-color: #f2f2f2; + } + .leading, .center { + border: 0px solid #0052A3; + background-color: #0052A3; + font-family: arial; + font-weight: bold; + color: white; + } + @@ -75,6 +114,7 @@ "esri/tasks/QueryTask", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", + "esri/renderers/SimpleRenderer", "esri/Color", "esri/graphic", "esri/lang", @@ -89,7 +129,7 @@ "dijit/layout/ContentPane", "dijit/form/ToggleButton", "dojo/domReady!" - ], function(Map, BasemapToggle, FeatureLayer, FeatureTable, LayerList, Search,InfoTemplate,domConstruct, dom, on, Query, QueryTask, SimpleLineSymbol, SimpleFillSymbol, 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,TooltipDialog,dijitPopup, TitlePane,registry, ToggleButton) { @@ -122,6 +162,12 @@ +"

Search on Google Map
" )*/ }); + layer.maxScale=500; + layer.minScale=5000; + var symbol1 = new SimpleFillSymbol().setColor(new Color([0,108,108,0.15])); + symbol1.setOutline(new SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new Color([0,100,156]), 1)); + var renderer = new SimpleRenderer(symbol1); + layer.setRenderer(renderer); //Condo Suffix layer var layercdm = new FeatureLayer("//services3.arcgis.com/aD88pT4hjL80xq0F/arcgis/rest/services/MHcdmain/FeatureServer/0", { outFields: ["*"], @@ -318,7 +364,7 @@ resultItems.push("
"); var titlePane1 = new TitlePane({ id: "titlePane11", - open: false, + open: true, title: featureAttributes.bbl_sp, content: resultItems }, domConstruct.create('div', {}, containerNode)); @@ -394,17 +440,26 @@
- Header + + + + + + +
| Tax Class 2 Property Search Map: Manhattan
-
Search for a property to display details
+

Search for a property to display details
- +
+
Enter your Block/Lot to search.
+
For Example: 135/11
+
From fdd55415d2081538ba24ab1975ea3fe6fe33b469 Mon Sep 17 00:00:00 2001 From: conemint Date: Mon, 21 Dec 2015 11:09:08 -0500 Subject: [PATCH 6/8] fix after first search destroyDescendants --- TestMult.html | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/TestMult.html b/TestMult.html index 35ebd18..6ca8759 100644 --- a/TestMult.html +++ b/TestMult.html @@ -48,8 +48,8 @@ display: block; position: absolute; z-index: 40; - top: 90px; - left: 100px; + top: 110px; + left: 65px; } #infobox { top: 31px; @@ -62,7 +62,7 @@ margin: 5px; padding: 10px; position: absolute; - width: 200px; + width: 300px; z-index: 40; border: solid 1px #001B33; border-radius: 4px; @@ -354,6 +354,16 @@ return; }else{ 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"); @@ -390,14 +400,15 @@ //Execute Query on(dom.byId("execute"), "click", execute); function execute () { - dojo.empty("toolsPane"); + //dojo.empty("toolsPane"); query.where = "CONDO_KEY = "+searchcd ; queryTask.execute(query, showResults,function(error){console.log(error);}); } function showResults (results) { var resultItems = []; var resultCount = results.features.length; - domConstruct.empty("toolsPane"); + 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; @@ -457,8 +468,9 @@
-
Enter your Block/Lot to search.
-
For Example: 135/11
+
Select property type to search.(Default is condo)
+
Then enter Block/Lot in box.
+
For Example: 1845/7501
From 7b8179442e565cc1a704a0b439d8633ffd8b3782 Mon Sep 17 00:00:00 2001 From: conemint Date: Mon, 21 Dec 2015 11:15:01 -0500 Subject: [PATCH 7/8] Open first search result on condo --- TestMult.html | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/TestMult.html b/TestMult.html index 6ca8759..c76d233 100644 --- a/TestMult.html +++ b/TestMult.html @@ -416,12 +416,21 @@ resultItems.push("" + attr + ": " + featureAttributes[attr] + "
"); } resultItems.push("
"); - var titlePane1 = new TitlePane({ - id: "titlePane"+i, - open: false, - title: featureAttributes.bblu_sp, - content: resultItems - }, domConstruct.create('div', {}, containerNode)); + if (i==0){ + var titlePane1 = new TitlePane({ + id: "titlePane"+i, + open: true, + title: featureAttributes.bblu_sp, + content: resultItems + }, domConstruct.create('div', {}, containerNode)); + }else{ + var titlePane1 = new TitlePane({ + id: "titlePane"+i, + open: false, + title: featureAttributes.bblu_sp, + content: resultItems + }, domConstruct.create('div', {}, containerNode)); + } //"titlePane"+i); /*var titlePane1= new dijit.TitlePane({ title:"This is a title pane", From 5fc7395fa28c65d0cb792e8d7bf61affef87280b Mon Sep 17 00:00:00 2001 From: conemint Date: Mon, 21 Dec 2015 13:21:17 -0500 Subject: [PATCH 8/8] Update TestMult.html hover highlight. Bug to fix: mouse out--clear graphic; --- TestMult.html | 56 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/TestMult.html b/TestMult.html index c76d233..88ef501 100644 --- a/TestMult.html +++ b/TestMult.html @@ -48,7 +48,7 @@ display: block; position: absolute; z-index: 40; - top: 110px; + top: 100px; left: 65px; } #infobox { @@ -62,11 +62,11 @@ margin: 5px; padding: 10px; position: absolute; - width: 300px; + width: 400px; z-index: 40; border: solid 1px #001B33; border-radius: 4px; - background-color: #EBF0F5; + background-color: #f2f2f2; } #BasemapToggle { @@ -87,14 +87,25 @@ #toolsPane{ background-color: #f2f2f2; } - .leading, .center { + .leading, .center, .tailing { border: 0px solid #0052A3; background-color: #0052A3; font-family: arial; font-weight: bold; color: white; } + a:link { + text-decoration: none; + } + + a:visited { + text-decoration: none; + } + a:hover { + text-decoration: none; + color: #ff6600; + } @@ -225,13 +236,16 @@ ///4.b. HOVER FUNCTION //listen for when the onMouseOver event fires on the layer //when fired, create a new graphic with the geometry from the event.graphic and add it to the maps graphics layer + var hovergraph = new esri.layers.GraphicsLayer(); layer.on("mouse-over", function(evt){ closeDialog(); var t = "${BORO}/${BLOCK}/${LOT}
Adress:${Street_Num}, ${Street_Nam}, New York, NY
DOF Value 2017 Tentative: $${fmv:NumberFormat}
"; var content = esriLang.substitute(evt.graphic.attributes,t); - var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); - map.graphics.add(highlightGraphic); - + //var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); + //map.graphics.add(highlightGraphic); + map.addLayer(hovergraph); + var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); + hovergraph.add(highlightGraphic); dialog.setContent(content); domStyle.set(dialog.domNode, "opacity", 0.85); @@ -248,8 +262,14 @@ closeDialog(); var t = "${Boro}/${Block}/${Lot}
Adress:${Street_Num}, ${Street_Nam}, New York, NY
"; var content = esriLang.substitute(evt.graphic.attributes,t); - var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); - map.graphics.add(highlightGraphic); + //var symbol = new esri.symbol.SimpleFillSymbol(); + //symbol.setColor(new dojo.Color([150,150,150,0.5])); + map.addLayer(hovergraph); + //var feature = evt.graphic.geometry; + //hovergraph.add(feature); + var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol); + //map.graphics.add(highlightGraphic); + hovergraph.add(highlightGraphic); dialog.setContent(content); domStyle.set(dialog.domNode, "opacity", 0.65); dijitPopup.open({ @@ -262,12 +282,14 @@ map.setMapCursor("pointer"); //Add mouse change at hover }); function closeDialog() { - map.graphics.clear(); + //map.graphics.clear(); + if (hovergraph){ + hovergraph.clear(); + } map.setMapCursor("default"); //set mouse pointer back dijitPopup.close(dialog); } - //Search var s = new Search({ enableButtonMode: false, //this enables the search widget to display as a single button @@ -352,7 +374,7 @@ if( rs[0]==null){ h = "
rs is null
"; return; - }else{ + }else{//NON CONDO ([0]) var resultItems = []; /*if (titlePane11){ @@ -379,7 +401,7 @@ content: resultItems }, domConstruct.create('div', {}, containerNode)); }; - }else{ + }else{//CONDO ([1]) //h = inspect(rs[0][0].feature.attributes, 5, 0); var attrs = rs[1][0].feature.attributes; searchcd=attrs.CONDO_KEY; @@ -413,9 +435,12 @@ 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("" + attr + ": " + featureAttributes[attr] + "
"); } + resultItems.push("
"); + if (i==0){ var titlePane1 = new TitlePane({ id: "titlePane"+i, @@ -465,6 +490,7 @@
| Tax Class 2 Property Search Map: Manhattan
+ | Home
@@ -477,7 +503,7 @@
-
Select property type to search.(Default is condo)
+
Click on the Arrow and select property type to search.(Default: condo)
Then enter Block/Lot in box.
For Example: 1845/7501