1

There's an example in the Leaflet-ESRI documentation here: https://esri.github.io/esri-leaflet/examples/finding-features.html But the code doesn't seem to actually work, neither on the example page nor when I cut and paste it into jsbin.

I'm trying to create a search/find box for a user to provide text and then find features that include that text in their attributes. I'd love to see examples of this Find task in working action.

EDITED TO ADD: When I load the above page as http:// instead of https://, that does allow the features to be added to the map. However, the Find box still appears not to function properly. I'd like to see an example of the Find tool working properly.

asked Dec 13, 2015 at 5:28
1
  • we're in the middle of retooling the website and have removed the sample (for reasons you mention and others) thanks for the report. Commented Dec 15, 2015 at 22:44

1 Answer 1

1

The example works, just don't load the github.io page via https, use http instead: http://esri.github.io/esri-leaflet/examples/finding-features.html

Using https, in most browswers, you will get a mixed content error, as the govUnits data is served from non-encrypted http. More on mixed content from MDN

answered Dec 13, 2015 at 5:51
3
  • That got the features on the screen! But the actual search box still doesn't seem to work -- unless I'm misunderstanding its function. When I type in words that do appear in the names of the federal properties (that are the features of the Map Layer), e.g. "Drum", "Allegheny", "Sequoia", etc., the system gives no response. Commented Dec 13, 2015 at 13:49
  • I still don't know why the given example doesn't work (including with state names "Wisconsin," "Colorado", etc.) BUT once I started working with the code and substituted my own Map Layer, it worked just fine, highlighting the found polygons read. So all around the problems seem to have been with the example federal gov Map Layer. Thanks, toms, for your help. Commented Dec 14, 2015 at 1:45
  • it is slow, but it does work for me ("colorado", "wisconsin")... anyway glad you were able to get it to work on your own data Commented Dec 14, 2015 at 15:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.