I am trying to get a map in the Dutch Rijksdriehoekstelsel coordinates in a Leaflet map in R that is going in a Shiny app later. I am going to have to add polygons later, and changing their X and Y coordinates into the WGS84 would be horrible. I stole the proj4def and resolutions from the example posted at the bottom. However, I just get a grey screen with the zoom in and out buttons. Either I have screwed up the leafletOptions or the tileLayer.
library(leaflet)
leaflet(
options =
leafletOptions(
crs=leafletCRS(
crsClass="L.Proj.CRS.TMS",
code='EPSG:28992',
proj4def='+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.8703473836068,4.0812 +no_defs',
c(-285401.92, 22598.08, 595401.9199999999, 903401.9199999999),
resolutions = c(3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420),
)
)) %>%
addTiles(urlTemplate='http://geodata.nationaalgeoregister.nl/tms/1.0.0/brtachtergrondkaart/{z}/{x}/{y}.png',
tileOptions(minZoom=3,maxZoom=13,tms=TRUE,continuousWorld=TRUE) ) %>%
setView(52,5.1,13)
This is an example in Javascript that has done the same thing: http://bl.ocks.org/webmappergists/raw/1ceac1353920b3810486/