Commit f166875d authored by Peter Knoop's avatar Peter Knoop
Browse files

Added Home widget to reset map view

parent 514c483b
...@@ -7,6 +7,7 @@ require([ ...@@ -7,6 +7,7 @@ require([
"esri/layers/FeatureLayer", "esri/layers/FeatureLayer",
"esri/widgets/Slider", "esri/widgets/Slider",
"esri/widgets/Legend", "esri/widgets/Legend",
"esri/widgets/Home",
"esri/renderers/smartMapping/creators/relationship", "esri/renderers/smartMapping/creators/relationship",
"dojo/dom-style", "dojo/dom-style",
"dojo/dom-attr", "dojo/dom-attr",
...@@ -21,6 +22,7 @@ require([ ...@@ -21,6 +22,7 @@ require([
FeatureLayer, FeatureLayer,
Slider, Slider,
Legend, Legend,
Home,
relationshipRendererCreator, relationshipRendererCreator,
domStyle, domStyle,
domAttr, domAttr,
...@@ -89,8 +91,8 @@ require([ ...@@ -89,8 +91,8 @@ require([
label: "Believe global warming is happening" label: "Believe global warming is happening"
}, },
{ {
fieldName: "happeningOppose", fieldName: "FL",
label: "Do not believe global warming is happening" label: "Flood Warnings"
} }
] ]
} }
...@@ -219,10 +221,16 @@ require([ ...@@ -219,10 +221,16 @@ require([
} }
] ]
}); });
// Add widget to the bottom right corner of the view // Add widget to the bottom right corner of the view
mainView.ui.add(legend, "top-right"); mainView.ui.add(legend, "top-right");
// Add Home button to mainView.
var homeButton = new Home({
view: mainView
});
// Add the home button to the top left corner of the view
mainView.ui.add(homeButton, "top-left");
mainView mainView
.when(maintainFixedExtent) .when(maintainFixedExtent)
// .then(disableNavigation) // .then(disableNavigation)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment