Select to view content in your preferred language

Locate Button not showing up

897
3
Jump to solution
06-09-2014 12:49 PM
asinha_ppc
Emerging Contributor
This is my first JavaScript app, and it is fairly straigh forward. I have used the code samples to get to where I'm at. There are 2 layers in the map. User can identify features by clicking on them or by drawing a polygon. All that seems to work exactly as required. All I'm trying to add now is a Locate Button, but can't for the life of me figure out what I'm doing wrong. Very new to JavaScript so it might be a very simple issue...

[see attachment]

Any suggestions would be greatly appreciated!

Thanks,
Alok
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
The aliases in your function need to be in the same order as the modules in your require statement.

require([
     "esri/InfoTemplate",
     "esri/map",
     "esri/layers/FeatureLayer",
     "esri/symbols/SimpleFillSymbol",
     "esri/symbols/SimpleLineSymbol",
     "esri/tasks/query",
     "esri/toolbars/draw",
     "dojo/dom",
     "dojo/on",
     "dojo/parser",
     "dojo/_base/array",
     "esri/Color",
     "esri/dijit/LocateButton",
     "esri/SpatialReference",
     "dijit/form/Button",
     "dojo/domReady!"
 ],
 function (
 InfoTemplate, Map, FeatureLayer, SimpleFillSymbol, SimpleLineSymbol, 
Query, Draw, dom, on, parser, arrayUtil, Color, LocateButton
 ) {


Take a look at this blog for more information.

View solution in original post

0 Kudos
3 Replies
KenBuja
MVP Esteemed Contributor
The aliases in your function need to be in the same order as the modules in your require statement.

require([
     "esri/InfoTemplate",
     "esri/map",
     "esri/layers/FeatureLayer",
     "esri/symbols/SimpleFillSymbol",
     "esri/symbols/SimpleLineSymbol",
     "esri/tasks/query",
     "esri/toolbars/draw",
     "dojo/dom",
     "dojo/on",
     "dojo/parser",
     "dojo/_base/array",
     "esri/Color",
     "esri/dijit/LocateButton",
     "esri/SpatialReference",
     "dijit/form/Button",
     "dojo/domReady!"
 ],
 function (
 InfoTemplate, Map, FeatureLayer, SimpleFillSymbol, SimpleLineSymbol, 
Query, Draw, dom, on, parser, arrayUtil, Color, LocateButton
 ) {


Take a look at this blog for more information.
0 Kudos
asinha_ppc
Emerging Contributor
Thats it?!? Thanks!!!
0 Kudos
KenBuja
MVP Esteemed Contributor
Glad to help.

Please remember to click the check mark to signify your question was answered. This will help others when they search for this issue in the future. See this page for more information.
0 Kudos