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.
-
we're in the middle of retooling the website and have removed the sample (for reasons you mention and others) thanks for the report.john gravois– john gravois2015年12月15日 22:44:13 +00:00Commented Dec 15, 2015 at 22:44
1 Answer 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
-
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.Abijah– Abijah2015年12月13日 13:49:35 +00:00Commented 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.Abijah– Abijah2015年12月14日 01:45:27 +00:00Commented 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 datatoms– toms2015年12月14日 15:57:39 +00:00Commented Dec 14, 2015 at 15:57