简体   繁体   中英

Search for markers in a markercluster group Leaflet-MarkerCluster

I am using Leaflet.markercluster to cluster my markers in my Mapbox Map . The markers are to be populated using a json file. All I need is a search feature which can popup the requisite marker based on search string. I got to know about Leaflet-search , but am unable to integrate it with my code. How should I go about this?

只需遍历您的图层组(如您的标记集群组),例如使用eachLayer(fn) ,针对标记属性进行测试,如果您找到目标标记,请使用标记zoomToShowLayer(targetMarker)方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM