I am trying to use the searching feature layers option for geocoder (Searching feature layers | Esri Leaflet ), but my feature layer is private. Looking at the documentation, I thought if I used the token property for the arcgisonline provider that that would work, but it doesn't seem to be working. Does anyone know if I am doing something wrong? I'm including my code sample.
i took a quick look at this and it looks like we're currently ignoring tokens passed to arcgisOnlineProvider entirely.
the way i envision this working is that 'token' should be a universally understood provider constructor option and that it should be up to the developer to pass an appropriate token to any provider that requires one.
i don't know exactly what i screwed up, but i was wrong earlier today. tokens are definitely already passed through when they are specified as an option for any of the various providers.
if you update the static token in the jsbin below and perform a search for a US state, the network traffic confirms that the token is passed along in the corresponding requests.
i'll make a point of updating the documentation.