This is how QGIS writes the proj-string and WKT with +towgs84-parameter:
+proj=longlat +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +no_defs
GEOGCS["DHDN",DATUM["Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[598.1,73.7,418.2,0.202,0.045,-2.455,6.7],AUTHORITY["EPSG","6314"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4314"]]
But keep in mind that there is no overall value for converting any Bessel-1841-Data to WGS84.
For Germany, there were a lot of parametres published, until a NADgrid for the whole country was created. This applies the correct shift for every point inside Germany.
Other surveying authorities have done similar conversions, but with other values.
EDIT
There is a forum entry in Russian http://gis-lab.info/forum/viewtopic.php?t=9386
giving the following proj parameters:
+proj=tmerc +lat_0=55.6666666667 +lon_0=37.5 +x_0=0 +y_0=0 +k_0=1. +a=6377397 +rf=299.15 +towgs84=396,165,557.7,-0.05,0.04,0.01,0 +no_defs
Maybe you get lucky with those values.
Try the Map
class's eachLayer()
method:
var layers = [];
map.eachLayer(function(layer) {
if( layer instanceof L.TileLayer )
layers.push(layer);
});
For complex cases you would end up writing your own layer switcher, and I don't see anything wrong with that. The Leaflet library aims to provide a minimum of core functions for an interactive map. If you need a bigger, all-in-one solution, try OpenLayers.
Best Answer
You can get all layers from your map, and remove them from the map. To avoid removing the tile layer (background), filter with
if(layer.options.pane === "tooltipPane")
.Fiddle: https://jsfiddle.net/3v7hd2vx/392/