Hello,Right now I am currently working in another country trying to set up a web application that can search addresses. I have looked through the samples and attempted to manipulate them so that they work with me, but I was unable to. Along with that, I am not able to access the database that supplies the information for one of the samples (links are at the bottom) and so I am not able to see the fields that are in that database. I am able to tell that there is at least a score and locatorName field, neither of which I have. I have an Adres field where the address is stored, and a Point section where the X and Y coordinates are stored. But that is about it. Below is a copy of the JS I have. So I was wondering how I would go about building this with the amount of information I have. I am not the most fluent in JS, but any help would be greatly appreciated. <script> dojo.require("esri.map"); dojo.require("esri.tasks.locator"); dojo.require("dojo.number"); dojo.require("dijit.form.Button"); dojo.require("dijit.form.Textarea"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.layers.FeatureLayer"); var map; function init() { map = new esri.Map("map", { basemap: "topo", center: [-68.95921478269354, 12.201009750494986], zoom: 11 }); var opLayer1 = new esri.layers.ArcGISDynamicMapServiceLayer( "ihavetherightlinkbutcannotputithere/rest/services/FeatureServer", { opacity:0.4, basemap:"topo" }); map.addLayer(opLayer1); var locator = new esri.tasks.Locator("http://ihavetherightlinkbutcannotputithere/rest/services/FeatureServer"); dojo.connect(locator, "onAddressToLocationsComplete", showResults); map.infoWindow.resize(200,125); } function locate() { map.graphics.clear(); var address = {"SingleLine":dojo.byId("Adres").value}; locator.outSpatialReference= map.spatialReference; var Adres = { address:Adres, } locator.addressToLocations(Adres); } function showResults(candidates) { var candidate; var symbol = new esri.symbol.SimpleMarkerSymbol(); var infoTemplate = new esri.InfoTemplate( "Address: ${Adres}"); symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE); symbol.setColor(new dojo.Color([153,0,51,0.75])); var geom; dojo.every(candidates,function(candidate){ console.log(candidate.Adres); var attributes = { address: candidate.Adres }; geom = candidate.Adres; var graphic = new esri.Graphic(geom, symbol, attributes, infoTemplate); //add a graphic to the map at the geocoded location map.graphics.add(graphic); //add a text symbol to the map listing the location of the matched address. var displayText = candidate.Adres; var font = new esri.symbol.Font("16pt",esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,"Helvetica"); var textSymbol = new esri.symbol.TextSymbol(displayText,font,new dojo.Color("#666633")); textSymbol.setOffset(0,8); map.graphics.add(new esri.Graphic(geom, textSymbol)); return false; //break out of loop after one candidate with score greater than 80 is found. }); if(geom !== undefined){ map.centerAndZoom(geom,12); } } dojo.ready(init); </script>
The sample I've been working with:https://developers.arcgis.com/en/javascript/jssamples/locator_address.htmlAnd the link that is disabled:http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServerAlso, here is a list of the fields I have available: OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID) Buurten (EN:Neighborhood) (Type: esriFieldTypeString, Alias: Buurten, Length: 250 ) B_STATUS (Type: esriFieldTypeString, Alias: B_STATUS, Length: 255 ) FUNCTIE (EN:Type of building) (Type: esriFieldTypeString, Alias: FUNCTIE, Length: 255 ) Straatnaam_conc (En:Streetname) (Type: esriFieldTypeString, Alias: Straatnaam_conc, Length: 250 ) Adres (EN:Address) (Type: esriFieldTypeString, Alias: Adres, Length: 100 ) Shape (Type: esriFieldTypeGeometry, Alias: Shape) Point: X: ##.### Y: ##.###Thank you,Ryan