# HG changeset patch # User Bernhard Reiter # Date 1537534112 -7200 # Node ID 22159077b5647514929b771d0bc3ac40175a81d5 # Parent 23b68cd4bed348050e178f65aa4ab58e550cedec client: add step to intersect with fairways * Add comfort function getLayerByName() so that we do not spread the number of the layer around in the code too much * Add code the get the right vectorSource and the call that could be used in the comment to prepare an intersection with the profile linestring. diff -r 23b68cd4bed3 -r 22159077b564 client/src/map/Maplayer.vue --- a/client/src/map/Maplayer.vue Fri Sep 21 13:57:40 2018 +0200 +++ b/client/src/map/Maplayer.vue Fri Sep 21 14:48:32 2018 +0200 @@ -98,7 +98,14 @@ var gStr = new GeoJSON({ geometryName: "geometry" }).writeFeature( feature ); - console.log("Ready to start profile view with: ", gStr); + console.log("Ready to start profile view with: ", feature, gStr); + + // FIXME: assuming that we have the fairway dimensions loaded + var vectorSource = this.getLayerByName( + "Fairway Dimensions" + ).data.getSource(); + console.log(vectorSource); + // vectorSource.forEachFeatureIntersectingExtent() } } }, @@ -149,6 +156,13 @@ }); }; return loader; + }, + getLayerByName(name) { + for (let layer of this.layers) { + if (layer.name === name) { + return layer; + } + } } }, watch: { diff -r 23b68cd4bed3 -r 22159077b564 client/src/map/store.js --- a/client/src/map/store.js Fri Sep 21 13:57:40 2018 +0200 +++ b/client/src/map/store.js Fri Sep 21 14:48:32 2018 +0200 @@ -30,7 +30,7 @@ isVisible: true }, { - name: "Fairways Dimensions", + name: "Fairway Dimensions", data: new VectorLayer({ source: new VectorSource(), style: function(feature) {