Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: HomeButton

dojo.require("esri.dijit.HomeButton");

Description

(Added at v3.7)
HomeButton provides a simple button to return to the map's default starting extent.

Samples

Search for samples that use this class.

Constructors

NameSummary
new esri.dijit.HomeButton(params, srcNodeRef)Creates a new HomeButton dijit using the given DOM node.

CSS

esri/dijit/HomeButton | Download source

NameDescription
homeClass for the home button.
homeContainerContaining class for the widget's node.
loadingClass put onto the home button while home extent is loading.

Properties

NameTypeSummary
extentExtentThe extent used to zoom to when clicked.
loadedBooleanWhether the widget has been loaded.
mapMapMap object that this dijit is associated with.
themeStringClass used for styling the widget.
visibleBooleanWhether the widget is visible by default.

Methods

NameReturn typeSummary
destroy()NoneDestroys the widget.
hide()NoneHides the widget.
home()PromiseGoes to the home extent.
show()NoneShows the widget.
startup()NoneFinalizes the creation of this dijit.

Events

[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.

Events

NameEvent ObjectSummary
home
{
  error: <Object>,
  extent: <Extent>
}
Fires when the home method has been called.
loadFires when the widget has been loaded.
Constructor Details

new esri.dijit.HomeButton(params, srcNodeRef)

Creates a new HomeButton dijit using the given DOM node.
Parameters:
<Object> params Required Various parameters to configure this dijit. See the list below for details.
<Node | String> srcNodeRef Required Reference or id of a HTML element that this dijit is rendered into.
params properties:
<Extent> extent Optional The extent used to zoom to when clicked. If null will use starting extent. Default value is null.
<Map> map Required Map object that this dijit is associated with. Required.
<String> theme Optional Class used for styling the widget.
<Boolean> visible Optional Whether the widget is visible by default. Default value is true.
Sample:
var homeButton = new esri.dijit.HomeButton({
  theme: "HomeButton",
  map: map,
  extent: null,
  visible: true
}, "<dom_id>");
homeButton.startup();
Property Details

<Extent> extent

The extent used to zoom to when clicked. If null, it will use starting extent.
Default value: null 

<Boolean> loaded

Whether the widget has been loaded.
Known values: true | false

<Map> map

Map object that this dijit is associated with.

<String> theme

Class used for styling the widget.

<Boolean> visible

Whether the widget is visible by default.
Known values: true | false
Default value: true
Method Details

destroy()

Destroys the widget.

hide()

Hides the widget.

home()

Goes to the home extent.
Return type: Promise

show()

Shows the widget.

startup()

Finalizes the creation of this dijit. This method should be called after the constructor for this dijit is called and before letting the users interact with it.
Event Details
[ On Style Events | Connect Style Event ]

home

Fires when the home method has been called.
Event Object Properties:
<Object> error An error objection. Returned if an error has occurred.
<Extent> extent The extent being navigated to.

load

Fires when the widget has been loaded.
Show Modal