简体   繁体   中英

Side Loading Features into ol.source.XYZ

Is there a way when using the ol.source.XYZ to sideload features?

The use case would be a map and a search feature external to OpenLayers which when a result is selected (maybe in an area not yet loaded by the XYZ source loader) it can push a GeoJSON feature into the same layer.

Yes.

You can save references to your features in your javascript. Use this reference, maybe an Array, to interact with your DOM and creating inputs, divs or whatever you want to create using your feature properties. You can construct a searchbox to search these DOM elements, and do what you want in the map.

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