Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function getIntersect() {
  2. var drawnLine = draw.getAll();
  3. var layerFeatures = turf.featureCollection(SELECTED_LAYER_JSON.features);
  4. var intersectingFeatures = turf.lineIntersect(drawnLine, layerFeatures);
  5. interArray = [];
  6. for (var i = 0; i < intersectingFeatures.features.length; i++) {
  7. interArray.push(intersectingFeatures.features[i].geometry.coordinates)
  8. }
  9.  
  10. mapB.on('render', interHeights);
  11. mapB.resize();
  12. }
  13.  
  14. function interHeights() {
  15. mapB.off('render', interHeights)
  16. var selectFeatures = [];
  17. interArray.forEach(coords => {
  18. pixelCoords = mapB.project(coords);
  19. var bbox = [[pixelCoords.x - 10, pixelCoords.y - 10], [pixelCoords.x + 10, pixelCoords.y + 10]];
  20. selectFeatures.push(mapB.queryRenderedFeatures(pixelCoords, {layers: [SELECTED_LAYER_ID]}));
  21. });
  22. }
Add Comment
Please, Sign In to add comment