In Order to add a poligon (such as a circle) you should:
- Go to the location of the html page of the actual map (you should see the location in the browser) and open it, with right click, preferable with notepad ++
look for :
var map = L.map(spec.dom, {
fullscreenControl: true
}).setView(spec.center, spec.zoom);
if (spec.provider){
L.tileLayer.provider(spec.provider).addTo(map)
} else {
L.tileLayer(spec.urlTemplate, spec.layerOpts).addTo(map)
}
and right after that you can add a nice circle with the following code, (dont forget to save the file):
L.circle([29.7601927,-95.3693896],7200,{color:'red'}).addTo(map).bindPopup('some thing').addTo(map)
for more info, just see the leaflet API in http://leafletjs.com/reference.html
btw, rmaps is just an interface for R and leaflet, if you want to create real crazy stuff, you should get used to open the html file and add java script code from the leaflet API, people created amazing plugins, much more that just adding polygons, for cool examples see:
http://leafletjs.com/plugins.html
i also really like this one:
http://threatwiki.thesentinelproject.org/iranvisualization
Just to add some additional info of how rMaps works(that's also true for rCharts)
All that rMaps does, is to create the javascript code, the build of the map is done by your web browsr, which means that if you will go to the library that rmaps is installed and copy it to another computer without R, the html file will run perfectly, so that means you can create a rMap, and then add any other elements from the leaflet API that are not supported by rMaps, manually, in the html file, just as i explained (i showed how to do it for "circle").
For shiny apps, you cant add thing manually, so you'll have to make sure that the elements from the API are supported in rmaps. in order to know which elements of the API are supported, first create a map:
map <- Leaflet$new()
and then look in all of the elements of "map", and compare it to the leaflet API.
for instance the marker creation command that you can find in the API:
http://leafletjs.com/reference.html#marker (from the leaflet API), which is created by:
L.marker([51.5, -0.09]).bindPopup('Hi. I am a popup').addTo(map);
has an equivalent in rMaps:
map$marker(
c(51.5, -0.09),
bindPopup = 'Hi. I am a popup'
)
Just go step by step for each element in leaflet API you are interested in, if it doesn't exist, then you can ask ramnath in Github to add it https://github.com/ramnathv/rMaps/pulls ,
or create by your own a function that does that in the R code.