ramnathv / rMaps

Interactive Maps from R
http://rmaps.github.io
388 stars 194 forks source link

How to save leaflet as a htmlwidget #112

Closed kezhan closed 8 years ago

kezhan commented 8 years ago

I try to save a leaflet map created with rMaps into a html file, with the following code:

L2 <- Leaflet$new()
L2$setView(c(29.7632836,  -95.3632715), 10)
L2$tileLayer(provider = "MapQuestOpen.OSM")
L2
library(htmlwidgets)

saveWidget(L2,"t.html")

But I got an error:

Error in envRefInferField(x, what, getClass(class(x)), selfEnv) : 
  ‘width’ is not a valid field or method name for reference class “Leaflet”

Could you please help?

ramnathv commented 8 years ago

Please use the leaflet package which is based on htmlwidgets and is actively under development.