From d4d39b90019a4233e63340541b7dfcafcbd28eba Mon Sep 17 00:00:00 2001 From: David Date: Sun, 5 Apr 2020 09:28:51 +1000 Subject: [PATCH] polygon colours for #287 --- DESCRIPTION | 4 ++-- NEWS.md | 2 ++ R/map_layer_polygon.R | 6 +++++- cran-comments.md | 4 ++-- src/polygon.cpp | 3 ++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index eba51b20..164dd5d1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: mapdeck Type: Package Title: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl' -Version: 0.3.1001 -Date: 2020-03-23 +Version: 0.3.2 +Date: 2020-04-05 Authors@R: c( person("David", "Cooley", ,"dcooley@symbolix.com.au", role = c("aut", "cre")) ) diff --git a/NEWS.md b/NEWS.md index 011c69bb..5a247b39 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # v0.3.2 +* better handling of polygon colours [issue287](https://github.com/SymbolixAU/mapdeck/issues/287) +* bug fixed when clearing a layer [issue286](https://github.com/SymbolixAU/mapdeck/issues/286) * layers can repeat at low zoom levels [issue282](https://github.com/SymbolixAU/mapdeck/issues/282) * mapbox dependencies udpated to 1.9.0 * tooltip for binary layers fixed [issue280](https://github.com/SymbolixAU/mapdeck/issues/280) diff --git a/R/map_layer_polygon.R b/R/map_layer_polygon.R index 266d24bb..f04c9361 100644 --- a/R/map_layer_polygon.R +++ b/R/map_layer_polygon.R @@ -162,7 +162,11 @@ add_polygon <- function( focus_layer <- force( focus_layer ) elevation_scale <- force( elevation_scale ) - is_extruded <- TRUE + is_extruded <- FALSE + ## issue 287 + if( !is.null( elevation ) ) { + is_extruded <- TRUE + } if( !is.null( l[["stroke_width"]] ) | !is.null( l[["stroke_colour"]] ) ) { is_extruded <- FALSE if( !is.null( elevation ) ) { diff --git a/cran-comments.md b/cran-comments.md index dba3d416..5b0c8a19 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,7 @@ ## Comments -* Updates v0.3.0 to v0.3.1 -* one bug fix found in v0.3.0 +* Updates v0.3.1 to v0.3.2 +* two bug fixes ## Tests diff --git a/src/polygon.cpp b/src/polygon.cpp index 87cecd46..f5a5c9c5 100644 --- a/src/polygon.cpp +++ b/src/polygon.cpp @@ -8,7 +8,8 @@ Rcpp::List polygon_defaults(int n) { return Rcpp::List::create( _["elevation"] = mapdeck::defaults::default_elevation(n), _["fill_colour"] = mapdeck::defaults::default_fill_colour(n), - _["stroke_colour"] = mapdeck::defaults::default_stroke_colour(n) + _["stroke_colour"] = mapdeck::defaults::default_stroke_colour(n), + _["stroke_width"] = mapdeck::defaults::default_stroke_width(n) ); }