searchExtent for  Geocoder of arcgis api javascript  do not work for me

1887
3
10-22-2014 07:17 AM
DIALLOAbdoulaye
New Contributor II

Hello every one ,

Is it possible restrict an address search to a specific map extent or a place  with dijit Geocoder ?

i have the following code but can not work

 

var geocoder =  new Geocoder({

        arcgisGeocoder: {

        placeholder: "Entrer Votre Adreesse"

        },

        autoComplete: true,

        maxLocations:10,

        map: map,

        searchExtent:initialExtent     // The extent of my study area (Casablanca in my Case).

        }, dom.byId("search"));

 

thanks in adavnce for any help

0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Diallo,

You will need to place the searchExtent within the arcgisGeocoder object.  Ex:

var geocoder =  new Geocoder({

    arcgisGeocoder: {

        placeholder: "Entrer Votre Adreesse",

        searchExtent:initialExtent

    },

    autoComplete: true,

    maxLocations:10,

    map: map

}, dom.byId("search"));

0 Kudos
DIALLOAbdoulaye
New Contributor II

Hi Jake

thanks

that is exactly i want, it work well

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Great, glad this is working.  If you get a chance, please mark this thread as answered to help other users in the community.