You could modify the basic viewer template to accept an address as a url parameter. There are a few ways to accomplish this but here's one. Open layout.js and replace the createSearchTool function with this one.
function createSearchTool(){
//add the toolbar section that holds the search tool
var wrapperDiv = dojo.create('div',{
id:'searchWrapper'
},dojo.byId('webmap-toolbar-right'));
dojo.addClass('searchWrapper','searchwrapper');
var searchInput = dojo.create('input',{
id:'searchField',
type:'text',
placeholder: i18n.tools.search.title,
onkeydown: function(e) {
if(e.keyCode === 13){
findLocation();
}
}
},wrapperDiv);
dojo.addClass(dojo.byId('searchField'),'searchbox');
dojo.create('input',{
type:'image',
id:'blankImage',
src:'images/blank.gif'
},wrapperDiv);
dojo.connect(dojo.byId('blankImage'),'onclick',function(){
findLocation();
});
dojo.addClass(dojo.byId('blankImage'),'searchbutton');
//add placeholder for browsers that don't support (IE)
if (!supportsPlaceholder()) {
var search = dojo.byId("searchField");
var text_content = i18n.tools.search.title;
search.style.color = "gray";
search.value = text_content;
search.onfocus = function () {
if (this.style.color === "gray") {
this.value = "";
this.style.color = "black";
}
};
search.onblur = function () {
if (this.value === "") {
this.style.color = "gray";
this.value = text_content;
}
};
}
//if there were url params zoom to them
if(urlObject.query && urlObject.query.address){
dojo.byId('searchField').value = urlObject.query.address;
findLocation();
}
}
Then you can add an address to the url and the app should zoom to that location. You may have to modify the code if your locator doesn't accept single address input:http://localhost/Template/test/basicviewer/index.html?address=380 new York st Redlands CA