r-spatial / mapview

Interactive viewing of spatial data in R
https://r-spatial.github.io/mapview/
GNU General Public License v3.0
519 stars 90 forks source link

request #42

Closed angelini75 closed 7 years ago

angelini75 commented 8 years ago

Dear @tim-salabim Would be nice to add the option to plot a grid of coordinates in the map as well as a (graphical) interactive control of transparency of the layers.

Excellent tool! Cheers, Marcos

tim-salabim commented 8 years ago

With 'grid of coordinates' do you mean a graticule? If so, that will be available in leaflet soon. I will look into the interactive transparency options out there

angelini75 commented 8 years ago

Yes! then it is one of the easiest tools to plot a study area. Perhaps a function mapview::studyarea() whith graticulate, north symbol and scale would be great!

tim-salabim commented 8 years ago

North is always up! scaleBar is already there and you can use addExtent() to add a rectangle representing your study area

tim-salabim commented 8 years ago

honestly, I don't see the additional value of a studyArea() function. The scope of mapview is to quickly visualise data during the workflow. What you suggests sounds more like a final presentation grade map.

angelini75 commented 8 years ago

It is fine, mine was just a suggestion. I think the tool is great as it is anyway. However, I think this can be the best tool to plot final maps. There are not too many alternatives to this tool. Maybe ggmap can do something like this (http://rgraphgallery.blogspot.nl/2013/04/rg68-get-google-map-and-plot-data-in-it.html) but look at this error from ggmap: Error: ggplot2 doesn't know how to deal with data of class SpatialPointsDataFrame. Mapview does! Mapview can also plot objects from sp, raster and satellite packages at the same time (?). So, I think it could be a useful tool to plot final presentation grade map.

mdsumner commented 8 years ago

Sp must be fortify-ied for ggplot2, it is well supported but not well explained, and not reversible (though see spbabel). sf just hit CRAN so it's more important to target using those classes ultimately. At any rate, I am happy to help with this generally

tim-salabim commented 8 years ago

I agree, sf integration is of higher priority

tim-salabim commented 8 years ago

See this

http://stackoverflow.com/questions/40662029/add-opacity-slider-in-r-leaflet

for an opacity slider option w leaflet map. I think it is on the radar to be implemented in leaflet.extras.