Closed neerajlk closed 5 years ago
Hi,
It's easy. You code should look something like:
L.Control.BrowserPrint.Utils.registerLayer(
L.GridLayer.GeoJson,
"L.GridLayer.GeoJson",
function(layer, utils) {
// We need to clone options to properly handle multiple renderers.
return L.gridLayer.geoJson(/*layer.data (you need to put here geogson data)*/, utils.cloneOptions(layer.options));
}
);
More information you can find in README.
Regards, Igor
Hi @Igor-Vladyka , Thanks for the quick reply. I tried your example and also referred to the guide but the layer doesn't get seen on the map preview. (neither any error is shown in console).
my geojson data is stored in variable name say 'geoJsonData'
L.Control.BrowserPrint.Utils.registerLayer( L.GridLayer.GeoJson, "L.GridLayer.GeoJson", function(layer, utils) { // We need to clone options to properly handle multiple renderers. return L.gridLayer.geoJson(geoJsonData, utils.cloneOptions(layer.options)); } );
Am I doing it properly? can't figure out the error though. Thanks
The idea here is to recreate layer. Your code looks good. Please create an jsbin or so to reproduce it. Also, I'm not familiar with this layer, where you took it? It's possible that whyle it's not oficially supported by leaflet - the logic behin it is a bit different and need other adjustments to make it work.
@Igor-Vladyka , It uses L.GridLayer.extend from here Leaflet doc for GridLayer .
I am using this to convert my big geoJson data to TIleLayer so that the map doesn't break due to heavy data.
Please provide an jsbin example to debug it.
Hi, first of all a great work, getting map print to an ease, much appreciation.
Would request to add support for layer of type L.gridLayer.geoJson , since it isn't supported for print currently. I'm a newbie at Leaflet,If it's simple or if I can do it externally then please do guide me for the same.
Thanks.