require(["esri/dijit/HomeButton"], function(HomeButton) { /* code goes here */ });
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
CSS
esri/dijit/HomeButton | Download source
home | Class for the home button. |
homeContainer | Containing class for the widget's node. |
loading | Class put onto the home button while home extent is loading. |
Properties
Methods
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
home | {
error: <Object >,
extent: <Extent >
} | Fires when the home method has been called. |
load | | Fires when the widget has been loaded. |
Constructor Details
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 HomeButton({
theme: "HomeButton",
map: map,
extent: null,
visible: true
}, "<dom_id>");
homeButton.startup();
Property Details
The extent used to zoom to when clicked. If null
, it will use starting extent.
Default value: null
Whether the widget has been loaded.
Known values: true | false
Map object that this dijit is associated with.
Class used for styling the widget.
Whether the widget is visible by default.
Known values: true | false
Default value: true
Method Details
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 ]
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. |
Fires when the widget has been loaded.