简体   繁体   中英

Layer control and geojson loading

How do make one geojson layer the default layer? I have multiple geojson for different point data. I am using leaflet layer control with radio buttons (so only one dataset is displayed at a time). I am also using the markercluster support plugin, which works great. The problem is when the map loads all of the geojson data is available at the same time until I start switching layers on the control. I am using Objoverlays and baseoverlay in my L.control

Add only the default layer to the map before you add the layer control. Don't add the other layers.

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