From ded25a9484222b5af9a4a48dc6b2a327a136fa85 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Fri, 21 Jul 2017 12:06:02 -0700 Subject: [PATCH 1/2] Implement property functions for line-join --- src/data/bucket/line_bucket.js | 2 +- src/style-spec/reference/v8.json | 5 +- .../property-function-dasharray/expected.png | Bin 0 -> 2050 bytes .../property-function-dasharray/style.json | 144 ++++++++++++++++++ .../line-join/property-function/expected.png | Bin 0 -> 1134 bytes .../line-join/property-function/style.json | 143 +++++++++++++++++ 6 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 test/integration/render-tests/line-join/property-function-dasharray/expected.png create mode 100644 test/integration/render-tests/line-join/property-function-dasharray/style.json create mode 100644 test/integration/render-tests/line-join/property-function/expected.png create mode 100644 test/integration/render-tests/line-join/property-function/style.json diff --git a/src/data/bucket/line_bucket.js b/src/data/bucket/line_bucket.js index 22e9c512702..da216ebaa5f 100644 --- a/src/data/bucket/line_bucket.js +++ b/src/data/bucket/line_bucket.js @@ -96,7 +96,7 @@ class LineBucket extends Bucket { addFeature(feature: VectorTileFeature) { const layout = this.layers[0].layout; - const join = layout['line-join']; + const join = this.layers[0].getLayoutValue('line-join', {zoom: this.zoom}, feature.properties); const cap = layout['line-cap']; const miterLimit = layout['line-miter-limit']; const roundLimit = layout['line-round-limit']; diff --git a/src/style-spec/reference/v8.json b/src/style-spec/reference/v8.json index fb6940e09dd..b82f6688009 100644 --- a/src/style-spec/reference/v8.json +++ b/src/style-spec/reference/v8.json @@ -564,6 +564,7 @@ "type": "enum", "function": "piecewise-constant", "zoom-function": true, + "property-function": true, "values": { "bevel": { "doc": "A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width." @@ -584,7 +585,9 @@ "ios": "2.0.0", "macos": "0.1.0" }, - "data-driven styling": {} + "data-driven styling": { + "js": "0.39.0" + } } }, "line-miter-limit": { diff --git a/test/integration/render-tests/line-join/property-function-dasharray/expected.png b/test/integration/render-tests/line-join/property-function-dasharray/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..fef23ec06f1b1b2fc978a0dc2ee26d2780e942a8 GIT binary patch literal 2050 zcmV+d2>thoP)_wgICm^si~={*(oJ;y*|=f<(EJmdZG?JuwB>cg%;7ep*QLfphacvf)>%bqc?hBy8@+j zy@xSYe)X7+2GmKr5try%Kf-j`^}w%ivb1JAk6UrK${34>WH%VU!zgKun5h6MmC+)% zdQ3+H>Qs+07_VJ-9EGD$kDJ763Px%-L)uK86o_9vrlSFMsz(o;j^47n7<-D(V4Q|P zM>8-}Ck5hFkLhSYo$4|M<3-yG`-{&MjFjCB%+v`f`3=Jo(f*0a3RjQmXh5Cforrm& z-H*!@rUy<(Z@KLzziaSa(SD3O6lO3^Lm=7=JcyU&kdj|_3>9sg!qsCs8c-)wi?lZR z^}-O*>J@Gb#w(Bh7$RC9g`0wr${-~kQ_+ArnO0+|wB_P)I(n;Kry)=VDP3=?Oxw|n zX7tl;H4fLVS=akerUbU&Q`kkkT4d^tE$F92DP3=(O!F}x)389=Y79rHvS!M3va~yK zrc9xBPD*TF&v@lwHb49 zGq$NdYte|i(53(>rP+kX6>k%UBUHTi@v2Ns_!pKaUK6gy&Df?m@8VUNHe(H*QM~oI z5qF_Y5fbv-6EkIc2M^#yw2DtZ43=pl{)bk@>yBon8H9S7-o|@qQ@j9eN|2CWfF3e6 zsi~={sreX7h~HO5dlPHKD=AtVLh(w9)`n0HDe)SEd7}LqH;B&!OcHGoR*28#*juz& zSSN>+(hb5pigO@Fi1wu7b;oYl1*;Y3B%CSQb6BA`J+V7l@P^`?ii1U4h;?#EDNZ*W zh7&Lplf|bW221OU{V*KEu@9caRPh;vdT9eO48t)Ddt*Ls5tEeslISU|2ad&wI2wKN zvUnYXInoBA4-(ovD_&>g3?#5Sdg>@8Mk)F2fjQEK;XnkcM;{DTy#`>YDwUF7f1IM` z6Dd%$Q%i|gh){J4MGM6*RDzV!r7#%l748{aA=*l%8=!di;_srppmakNZvh61_O?7y zir0pJV+Dp`y~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Ddu|0+iD>iMrH`#x9M vmLzG{!*=heVvOeMxvroLt8@Av{~zwFe*4;w3kW9y3lIiRS3j3^P6 Date: Mon, 24 Jul 2017 15:17:26 -0700 Subject: [PATCH 2/2] Rebase + update --- src/style-spec/reference/v8.json | 2 +- .../property-function-dasharray/style.json | 18 ++---------------- .../line-join/property-function/style.json | 18 ++---------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/style-spec/reference/v8.json b/src/style-spec/reference/v8.json index b82f6688009..7062b240902 100644 --- a/src/style-spec/reference/v8.json +++ b/src/style-spec/reference/v8.json @@ -586,7 +586,7 @@ "macos": "0.1.0" }, "data-driven styling": { - "js": "0.39.0" + "js": "0.40.0" } } }, diff --git a/test/integration/render-tests/line-join/property-function-dasharray/style.json b/test/integration/render-tests/line-join/property-function-dasharray/style.json index 7d2804ce3c2..e1cfe7a60a1 100644 --- a/test/integration/render-tests/line-join/property-function-dasharray/style.json +++ b/test/integration/render-tests/line-join/property-function-dasharray/style.json @@ -117,22 +117,8 @@ "source": "geojson", "layout": { "line-join": { - "type": "categorical", - "property": "join", - "stops": [ - [ - "miter", - "miter" - ], - [ - "round", - "round" - ], - [ - "bevel", - "bevel" - ] - ] + "type": "identity", + "property": "join" } }, "paint": { diff --git a/test/integration/render-tests/line-join/property-function/style.json b/test/integration/render-tests/line-join/property-function/style.json index ceda727e423..d73fcb76747 100644 --- a/test/integration/render-tests/line-join/property-function/style.json +++ b/test/integration/render-tests/line-join/property-function/style.json @@ -117,22 +117,8 @@ "source": "geojson", "layout": { "line-join": { - "type": "categorical", - "property": "join", - "stops": [ - [ - "miter", - "miter" - ], - [ - "round", - "round" - ], - [ - "bevel", - "bevel" - ] - ] + "type": "identity", + "property": "join" } }, "paint": {