Skip to content

Commit

Permalink
close #199
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Jun 14, 2019
1 parent 136f762 commit 754a36c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/map_layer_trips.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mapdeckTripsDependency <- function() {
#' \donttest{
#'
#'
#' library(gpxsf)
#' library(gpx)
#' gpx <- system.file("gpx/city_trail.gpx", package = "gpx")
#' sf <- gpx::gpx_sf( gpx, time = "counter" )
#'
Expand Down
6 changes: 6 additions & 0 deletions inst/htmlwidgets/lib/greatcircle/greatcircle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ function add_greatcircle_geo( map_id, map_type, greatcircle_data, layer_id, auto
id: 'greatcircle-'+layer_id,
data: greatcircle_data,
pickable: true,
parameters: {
depthTest: false
},
getWidth: d => d.properties.stroke_width,
getSourcePosition: d => md_get_origin_coordinates( d ),
getTargetPosition: d => md_get_destination_coordinates( d ),
Expand Down Expand Up @@ -39,6 +42,9 @@ function add_greatcircle_polyline( map_id, map_type, greatcircle_data, layer_id,
id: 'greatcircle-'+layer_id,
data: greatcircle_data,
pickable: true,
parameters: {
depthTest: false
},
getWidth: d => d.stroke_width,
getSourcePosition: d => md_decode_points( d.origin ),
getTargetPosition: d => md_decode_points( d.destination ),
Expand Down
6 changes: 6 additions & 0 deletions inst/htmlwidgets/lib/line/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function add_line_geo( map_id, map_type, line_data, layer_id, auto_highlight, hi
id: 'line-'+layer_id,
data: line_data,
pickable: true,
parameters: {
depthTest: false
},
getWidth: d => d.properties.stroke_width,
getSourcePosition: d => md_get_origin_coordinates( d ),
getTargetPosition: d => md_get_destination_coordinates( d ),
Expand Down Expand Up @@ -37,6 +40,9 @@ function add_line_polyline( map_id, map_type, line_data, layer_id, auto_highligh
id: 'line-'+layer_id,
data: line_data,
pickable: true,
parameters: {
depthTest: false
},
getWidth: d => d.stroke_width,
getSourcePosition: d => md_decode_points( d.origin ),
getTargetPosition: d => md_decode_points( d.destination ),
Expand Down
Empty file.
6 changes: 6 additions & 0 deletions inst/htmlwidgets/lib/scatterplot/scatterplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ function add_scatterplot_geo( map_id, map_type, scatter_data, layer_id, auto_hig
lineWidthMinPixels: 0,
stroked: true, // TODO( make conditional IFF stroke provided?)
filled: true,
parameters: {
depthTest: false
},
getRadius: d => d.properties.radius,
getPosition: d => md_get_point_coordinates( d ),
getFillColor: d => md_hexToRGBA( d.properties.fill_colour ),
Expand Down Expand Up @@ -53,6 +56,9 @@ function add_scatterplot_polyline( map_id, map_type, scatter_data, layer_id, aut
lineWidthMinPixels: 0,
stroked: true,
filled: true,
parameters: {
depthTest: false
},
getRadius: d => d.radius,
getPosition: d => md_decode_points( d.polyline ),
getFillColor: d => md_hexToRGBA( d.fill_colour ),
Expand Down
3 changes: 3 additions & 0 deletions inst/htmlwidgets/lib/scatterplot_brush/scatterplot_brush.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ function add_scatterplot_brush_geo( map_id, map_type, scatter_data, layer_id, au
radiusMaxPixels: radius_max_pixels || Number.MAX_SAFE_INTEGER,
stroked: true, // TODO( make conditional IFF stroke provided?)
filled: true,
parameters: {
depthTest: false
},
getRadius: d => d.properties.radius,
getPosition: d => md_get_point_coordinates( d ),
getFillColor: d => md_hexToRGBA( d.properties.fill_colour ),
Expand Down
7 changes: 7 additions & 0 deletions inst/htmlwidgets/lib/text/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function add_text_geo( map_id, map_type, text_data, layer_id, auto_highlight, hi
id: 'text-'+layer_id,
data: text_data,
pickable: true,
parameters: {
depthTest: false
},

getPosition: d => md_get_point_coordinates( d ),
getColor: d => md_hexToRGBA( d.properties.fill_colour ),
Expand Down Expand Up @@ -46,6 +49,10 @@ function add_text_polyline( map_id, map_type, text_data, layer_id, auto_highligh
id: 'text-'+layer_id,
data: text_data,
pickable: true,
parameters: {
depthTest: false
},

getPosition: d => md_decode_points( d.polyline ),
getColor: d => md_hexToRGBA( d.fill_colour ),
getText: d => d.text,
Expand Down
8 changes: 8 additions & 0 deletions inst/htmlwidgets/lib/trips/trips.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ trail_length, start_time, end_time, animation_speed, legend ) {
var tripsLayer = new TripsLayer({
id: 'trips-'+layer_id,
data: trips_data,
parameters: {
depthTest: false
},

getPath: d => md_trip_coordinates( d.geometry.geometry.coordinates ),
getTimestamps: d => md_trip_timestamp( d.geometry.geometry.coordinates, start_time ),
getColor: d => md_hexToRGBA( d.properties.stroke_colour ),
Expand Down Expand Up @@ -46,6 +50,10 @@ trail_length, start_time, end_time, animation_speed, legend ) {
var tripsLayer = new TripsLayer({
id: 'trips-'+layer_id,
data: trips_data,
parameters: {
depthTest: false
},

getPath: d => md_trip_coordinates( d.geometry.geometry.coordinates ),
getTimestamps: d => md_trip_timestamp( d.geometry.geometry.coordinates, start_time ),
getColor: d => md_hexToRGBA( d.properties.stroke_colour ),
Expand Down
2 changes: 1 addition & 1 deletion man/add_trips.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 754a36c

Please sign in to comment.