1

Following the ESRI API, I added the placeholder parameter to the geocoder widget to add some informative text would instruct the user what the search box was for. For some reason it is not displaying anything on my page - any clues?

Geocoder Widget Code:

geocoder = new Geocoder({
                map: map,
                placeholder: "Locate by address"
            }, "search");
            geocoder.startup();

and then the simple "search div" is loaded in a content page (not main map window):

<div id="search"></div>

1 Answer 1

1

because the widget supports incorporating search results from more than one locator, you actually don't set the placeholder property on the widget itself.

as per the documentation, you could specify some custom text for the default Esri World Geocoding service like this:

var myGeocoder = {
    url: "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
    name: "World Geocoder",
    placeholder: "search for an address..."
};

geocoder = new Geocoder({ 
    map: map,
    arcgisGeocoder: myGeocoder          
}, "search");
geocoder.startup();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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