Popup overlays on draw (measure) with Openlayers 3

المشرف العام

Administrator
طاقم الإدارة
Using the Openlayers Measure exemple (http://openlayers.org/en/v3.10.1/examples/measure.html), I'm trying to have only a single measure active at a time.

http://jsfiddle.net/Sinnel/yfdejpre/1/

However, the static measure results appear in a overlay and I have not been able to limit/delete old measures from staying on the map. I have tried different approaches for quite some time, the one giving the "best" results being :

if (map.getOverlays().getArray().length >= 2) {map.getOverlays().clear()};

However, the result is quite inconsistent...How should I approach this?

Thanks for the help!



أكثر...
 
أعلى