diff --git a/R/map_layer_h3.R b/R/map_layer_h3.R index db079e5c..6b9d33aa 100644 --- a/R/map_layer_h3.R +++ b/R/map_layer_h3.R @@ -158,7 +158,7 @@ add_h3 <- function( 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") + shape <- rcpp_point_polyline( data, l, geometry_column, "h3") jsfunc <- "add_h3_hexagon" @@ -185,5 +185,5 @@ add_h3 <- function( #' @export clear_h3_hexagon <- function( map, layer_id = NULL, update_view = TRUE, clear_legend = TRUE) { layer_id <- layerId(layer_id, "h3") - invoke_method(map, "md_layer_clear", map_type( map ), layer_id, "h3_hexagon", update_view, clear_legend ) + invoke_method(map, "md_layer_clear", map_type( map ), layer_id, "h3", update_view, clear_legend ) } diff --git a/inst/htmlwidgets/lib/h3/h3.js b/inst/htmlwidgets/lib/h3/h3.js index 6c1be0a8..cc559020 100644 --- a/inst/htmlwidgets/lib/h3/h3.js +++ b/inst/htmlwidgets/lib/h3/h3.js @@ -5,7 +5,7 @@ function add_h3_hexagon( map_id, map_type, h3_hexagon_data, layer_id, light_sett const h3Layer = new deck.H3HexagonLayer({ map_id: map_id, - id: 'h3_hexagon-'+layer_id, + id: 'h3-'+layer_id, data: h3_hexagon_data, pickable: true, stroked: true, @@ -23,14 +23,14 @@ function add_h3_hexagon( map_id, map_type, h3_hexagon_data, layer_id, light_sett autoHighlight: auto_highlight, highlightColor: md_hexToRGBA( highlight_colour ), onHover: md_update_tooltip, - onClick: info => md_layer_click( map_id, "h3_hexagon", info ), + onClick: info => md_layer_click( map_id, "h3", info ), transitions: js_transition || {} }); if( map_type == "google_map") { - md_update_overlay( map_id, 'h3_hexagon-'+layer_id, h3Layer ); + md_update_overlay( map_id, 'h3-'+layer_id, h3Layer ); } else { - md_update_layer( map_id, 'h3_hexagon-'+layer_id, h3Layer ); + md_update_layer( map_id, 'h3-'+layer_id, h3Layer ); } if (legend !== false) { diff --git a/src/point.cpp b/src/point.cpp index 8e149ece..659e0418 100644 --- a/src/point.cpp +++ b/src/point.cpp @@ -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" || layer_name == "h3_hexagon") { + if( layer_name == "column" || layer_name == "scatterplot" || layer_name == "h3") { point_legend = mapdeck::layer_colours::fill_stroke_legend; } else if ( layer_name == "pointcloud" ) { point_legend = mapdeck::layer_colours::fill_legend; @@ -70,7 +70,7 @@ std::unordered_map< std::string, std::string > get_point_colours( std::string la std::unordered_map< std::string, std::string > point_colours; - if( layer_name == "column" || layer_name == "scatterplot" || layer_name == "h3_hexagon" ) { + if( layer_name == "column" || layer_name == "scatterplot" || layer_name == "h3" ) { point_colours = mapdeck::layer_colours::fill_stroke_colours; } else if ( layer_name == "pointcloud" ) { point_colours = mapdeck::layer_colours::fill_colours;