Skip to content

Commit

Permalink
h3 legend
Browse files Browse the repository at this point in the history
dcooley committed Jan 18, 2024
1 parent a677fed commit bc8f7ca
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions R/map_layer_h3.R
Original file line number Diff line number Diff line change
@@ -102,7 +102,6 @@ add_h3 <- function(
legend_format = NULL,
update_view = TRUE,
focus_layer = FALSE,
digits = 6,
transitions = NULL
) {

@@ -146,11 +145,6 @@ add_h3 <- function(
l[["data"]] <- NULL
}

# if( !is.null(l[["bbox"]] ) ) {
# bbox <- l[["bbox"]]
# l[["bbox"]] <- NULL
# }

checkHexAlpha(highlight_colour)
layer_id <- layerId(layer_id, "h3")

@@ -162,9 +156,11 @@ add_h3 <- function(
jsfunc <- "add_h3_hexagon_geo"

geometry_column <- "hexagon"

## use 'polyline' method because we have strings (cells), not lat/lon coordinates
shape <- rcpp_point_polyline( data, l, geometry_column, "h3_hexagon")

#return(shape)
# return(shape)

jsfunc <- "add_h3_hexagon"

2 changes: 1 addition & 1 deletion src/point.cpp
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ Rcpp::StringVector get_point_legend_colours( std::string layer_name ) {

Rcpp::StringVector point_legend;

if( layer_name == "column" || layer_name == "scatterplot" ) {
if( layer_name == "column" || layer_name == "scatterplot" || layer_name == "h3_hexagon") {
point_legend = mapdeck::layer_colours::fill_stroke_legend;
} else if ( layer_name == "pointcloud" ) {
point_legend = mapdeck::layer_colours::fill_legend;

0 comments on commit bc8f7ca

Please sign in to comment.