0

I am new and just exploring ArcGIS API

Wondering how to overwrite the default "ArcGIS Online World Geocoding service" each time i search it calls that service.

I wanted to call our own geocoding service. to add up. I can't also call my MapServer query using the sandbox using the search widget, but the sample 'Query' sandbox can call our MapServer.

Is there any important thing i missed like set-up on our ArcGIS server for the search functionalities to function?

  • What "ArcGIS API" are you using? – PolyGeo Dec 1 '16 at 6:46
1

Assuming you're using the JS API, you can override the locator used in the search widget/dijit by specifying a search source. There is a a sample in the online docs at https://developers.arcgis.com/javascript/3/jssamples/search_customlocator.html, but the pertinent info is

    var search = new Search({
    sources: [{
        //Pass in the custom locator to the sources
        locator: new Locator(locatorUrl),
        singleLineFieldName: "AssetID",
        outFields: ["Match_addr"],
        name: "HBR_Asset",
        placeholder: "H-L-N-EW-090-GLO-001-403-OWT",
        highlightSymbol: new PictureMarkerSymbol("https://js.arcgis.com/3.18/esri/dijit/Search/images/search-pointer.png", 36, 36).setOffset(9, 18),
        //Create an InfoTemplate
        infoTemplate: new InfoTemplate("Asset ID", "ID: ${Match_addr}")
    }],
    map: map,
    enableSearchingAll: false,
    autoComplete: true,
    value: "H-L-N-EW-090-GLO-001-403-OWT"
}, "search");

search.startup();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.