@@ -68,37 +68,39 @@ providerTileOptions <- function(errorTileUrl = "", noWrap = FALSE,
68
68
# ' @format A list of characters
69
69
# ' @source \url{https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js}
70
70
# '
71
- # ' @export
71
+ # ' @name providers
72
+ # ' @export providers
72
73
# ' @rdname providers
73
- makeActiveBinding( " providers " , function () {
74
- leaflet.providers :: loaded_providers() $ providers
75
- }, env = environment())
74
+ NULL
75
+ # Active binding added in zzz.R
76
+ " providers "
76
77
77
- # ' @export
78
+ # ' @name providers.details
79
+ # ' @export providers.details
78
80
# ' @rdname providers
79
- makeActiveBinding( " providers.details " , function () {
80
- leaflet.providers :: loaded_providers() $ providers.details
81
- }, env = environment())
81
+ NULL
82
+ # Active binding added in zzz.R
83
+ " providers.details "
82
84
83
- makeActiveBinding(" providers.version_num" , function () {
84
- leaflet.providers :: loaded_providers()$ version_num
85
- }, env = environment())
85
+ # Active binding added in zzz.R
86
+ " providers.version_num"
86
87
87
- makeActiveBinding(" html_src" , function () {
88
- leaflet.providers :: loaded_providers()$ html_dependency
89
- }, env = environment())
88
+ # Active binding added in zzz.R
89
+ " providers.src"
90
90
91
91
get_providers_html_dependency <- function () {
92
- tmpfile <- file.path(tempdir(), paste0(" leaflet-providers_" , version_num , " .js" ))
92
+ tmpfile <- file.path(tempdir(), paste0(" leaflet-providers_" , providers. version_num , " .js" ))
93
93
94
94
if (! file.exists(tmpfile )) {
95
- src <- html_src
95
+ src <- providers.src
96
96
writeLines(src , tmpfile )
97
97
}
98
98
99
- html_dependency <- htmltools :: htmlDependency(
99
+ htmltools :: htmlDependency(
100
100
" leaflet-providers" ,
101
101
providers.version_num ,
102
- src = tmpfile
102
+ src = dirname(tmpfile ),
103
+ script = basename(tmpfile ),
104
+ all_files = FALSE
103
105
)
104
106
}
0 commit comments