1

Can I explicitly set map.types to NULL? This does not work as expected. Basically, I don't want the base maps to render.

library(mapview)
mapView(breweries, map.types = NULL)

I don't want to eliminate the associated CRS. I just want to eliminate the base maps that automatically render.

  • What is it exactly that you want to do? Do you want to view your data in the native crs (if different from 4326) or do you just want to have a blank map canvas and still have on-the-fly reprojection to 4326? If the former, you can set `native.crs = TRUE`. If the latter, please open a feature request on github. – TimSalabim Apr 11 '20 at 08:08
  • 1
    The latest github version of mapview allows to set `map.types = NULL` to have a blank map canvas in standard webmercator projection – TimSalabim Apr 18 '20 at 11:14

2 Answers2

0

You can plot on a blank background after removing the CRS of the shapefile by setting it to NA.

library(mapview)
mapview(st_set_crs(breweries, NA))

Your comment indicates that you do not want to remove the crs from your shapefiles. I wanted to point out that the above function does not remove the crs from your shapefile permanently.

enter image description here

mrhellmann
  • 5,069
  • 11
  • 38
  • Clever, but I'll cautiously say that I don't think this is what I want. I have vectorized data of a country's boundaries, which has a CRS associated with it. I actually want that CRS data in there...but I don't want the basemaps that automatically get rendered. – user2438292 Apr 10 '20 at 21:50
  • That might be tough then, as mapview's github page explicitly states "mapview - view (multiple) spatial objects on a set of background maps". – mrhellmann Apr 11 '20 at 01:22
  • But on the https://cran.r-project.org/web/packages/mapview/mapview.pdf "visualisations of spatial data with or without background maps." – M. Beausoleil Mar 05 '21 at 04:24
0

As of this post, the current development version (2.8.1) of mapview from Github has the desired functionality. Just set map.types = NULL. Thanks to TimSalabim for the heads up.