{"_id":"@datapunt/leaflet-geojson-bbox-layer","_rev":"26-6095c987bffb64cd12e184fdddc645a8","name":"@datapunt/leaflet-geojson-bbox-layer","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@datapunt/leaflet-geojson-bbox-layer","version":"0.1.0","description":"Leaflet GeoJSON layer with bounding box feature retrieval","license":"MPL-2.0","author":{"name":"Datapunt Amsterdam"},"main":"dist/library/leaflet-geojson-bbox-layer.js","homepage":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer#readme","repository":{"type":"git","url":"git+https://github.com/Amsterdam/leaflet-geojson-bbox-layer.git"},"scripts":{"start":"webpack-dev-server --hot --inline","build":"npm run build:example && npm run build:library","build:example":"webpack -p && cp example/index.html dist/example/","build:library":"webpack -p --config webpack.library.config.js","test":"jest","test:watch":"jest --watch","lint":"esw webpack.config.* src --color","lint:watch":"npm run lint -- --watch"},"keywords":["leaflet","geojson"],"peerDependencies":{"leaflet":"1.x"},"devDependencies":{"@babel/core":"7.4.5","@babel/preset-env":"7.4.5","babel-loader":"8.0.6","css-loader":"2.1.1","eslint":"5.16.0","eslint-watch":"5.1.2","file-loader":"3.0.1","jest":"24.8.0","leaflet":"1.x","style-loader":"0.23.1","webpack":"4.32.2","webpack-cli":"3.3.2","webpack-dev-server":"3.5.1"},"gitHead":"b57a1932fa311e8de76e5d17902b04f8d696ec71","bugs":{"url":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer/issues"},"_id":"@datapunt/leaflet-geojson-bbox-layer@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"datapunt","email":"datapunt@amsterdam.nl"},"dist":{"integrity":"sha512-feD1OwYUlIYk/xt5Y9MZ7yBwFI+0IkMDdgy5hpxpXUM9xp3Rzy6+KEKamI9c3RMWNT1nZbyyEGUhTsHsYWvGcg==","shasum":"32bafada097562c01a289c4abf301c5210c19ae5","tarball":"https://registry.npmjs.org/@datapunt/leaflet-geojson-bbox-layer/-/leaflet-geojson-bbox-layer-0.1.0.tgz","fileCount":5,"unpackedSize":16826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+QLTCRA9TVsSAnZWagAAk+EP/2ulPVOy/lKmvQnNV1r2\nFJn6b25sxekRo8m4fQMp3GiWUTHGLP6NU1dSABomZyQKROQJn4DAEpXjFkkt\ndfFhInSsJMwwx9KCH+UiOR50ZiEgtBMjJp7iDuhHX5gs93EBpDgGpFzhR8zI\nmBuY6/WJGutJ9iuANcgKjiBfeUBFl3OpB16XZUKzKHbqUuYc303K4hoBBb9k\nHTvIjp2+1tEvSpympDZyIPsRB2yPmAKyPAeUvFdeLfFwVp9xkVmQ/3nQljAd\nqZxWJU2F4SMnjLsfe2QOSEhHuQmMTNcOb5YpkidF3lx0pYuJyTLOdspxDC9l\nTPb5sMbKdwcROlBzQJjUWlXDC0fXoWRzZ6poakBlv2MPfEE/HWfDl7LwfwaQ\nMGmQ18Ehs2P3+LTriaHrq1Hl9J22ucSXCNZkyxzMnJeoDq4wGB3CHWt6y5Dd\n5I7m9bEwJGmRaq7FBj4Xcz5xy7G0Hi8HZDkX1aODgTf7CgsEiGtjZ7HuCEum\nyMgoppJMwCxLXo1U1hkyHNX9lnIiHCZWdmUl/24bKaFMw2x1XgHq9RFnquui\n9+mO2McFemi5AUWW/ZrR0sKMo8Ntwhu5aymW1UCeC9+T+OSHeWgISdVaWVW/\nD6XlsVKs+Yc7cOV0TY3zFuflME/dTRUkP3c8H+xkcgyLEek1LC+oDgsiyyIU\narOz\r\n=BBa2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJWUbmL2sLYF4YJiZuWSwQwfHeCC1C8SebCGdUSZU7UwIgLdERQmrXw1Fd2kpSryFBtmE/1eR9S0SrlWo/8+CDnQ8="}]},"maintainers":[{"name":"datapunt","email":"datapunt@amsterdam.nl"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/leaflet-geojson-bbox-layer_0.1.0_1559823059103_0.317467715915839"},"_hasShrinkwrap":false},"0.1.1":{"name":"@datapunt/leaflet-geojson-bbox-layer","version":"0.1.1","description":"Leaflet GeoJSON layer with bounding box feature retrieval","license":"MPL-2.0","author":{"name":"Datapunt Amsterdam"},"main":"dist/library/leaflet-geojson-bbox-layer.js","homepage":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer#readme","repository":{"type":"git","url":"git+https://github.com/Amsterdam/leaflet-geojson-bbox-layer.git"},"scripts":{"start":"webpack-dev-server --hot --inline","build":"npm run build:example && npm run build:library","build:example":"webpack -p && cp example/index.html dist/example/","build:library":"webpack -p --config webpack.library.config.js","test":"jest","test:watch":"jest --watch","lint":"esw webpack.config.* src --color","lint:watch":"npm run lint -- --watch"},"keywords":["leaflet","geojson"],"peerDependencies":{"leaflet":"1.x"},"devDependencies":{"@babel/core":"7.4.5","@babel/preset-env":"7.4.5","babel-loader":"8.0.6","css-loader":"2.1.1","eslint":"5.16.0","eslint-watch":"5.1.2","file-loader":"3.0.1","jest":"24.8.0","leaflet":"1.x","style-loader":"0.23.1","webpack":"4.32.2","webpack-cli":"3.3.2","webpack-dev-server":"3.5.1"},"gitHead":"b5eb5e492f90c9a797ad29fe57e3c6c8c7f27981","bugs":{"url":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer/issues"},"_id":"@datapunt/leaflet-geojson-bbox-layer@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"datapunt","email":"datapunt@amsterdam.nl"},"dist":{"integrity":"sha512-a8nkd6hX1VN+EtDgVyr9mcBnxKFCCCp3d6ohz4b+2/4fq2XoD0ZugunG7au0iF0ELOJbkjOjziOGmFcIjLu48g==","shasum":"5cfd38115ea20edd36f35d2e826c59ba46dc8ca6","tarball":"https://registry.npmjs.org/@datapunt/leaflet-geojson-bbox-layer/-/leaflet-geojson-bbox-layer-0.1.1.tgz","fileCount":5,"unpackedSize":17081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+QcLCRA9TVsSAnZWagAAobgP/Aq59rbtJM+F4juYyQ/i\nE4kOIhERqY9a4dhoOsxUAeGULqwItlL/T73j8KHEbDxEzYk/gWWZsNHf20XE\nsGqK705hBB07/ylYL1Q6q8Mj7qEaG/z+Q66EEJewcVucSwhnTRA4A1ztAjCa\nyV5LJj8/3EvZ/JFjfiGdXdwl6wSOOayXaN94zhYJ/vY5kDw287xJ99Tw4ldG\nNb/UlUhallYIAtpwl1qV6bdRz8PPVLSqC2KoxfhXI8OCKwHiwPxYUWAGRuPX\naJNbsx37iZUIvM+5pa23uuftdmVWunwuCKO4R9dh03ETHJqF+bh2MpGxNNSt\nqzpgKABJoqxvnLb2nX9XlpBRYElB2xBdORG9aEjRRtue6Mm3eCoosNKDenPQ\nbEZuhDes0nWVB8BUThR6Z5bOknlCGHkqJfZka2HByO+qdhn3JR0St82pHolH\nYgTvUGxKvG0MUiSDzutnqRVn169Xo+cHgfR64iQ6SHp7t8faxXK/DX2tCQ+C\nt+CxDmUXzuD/CYIPPGVp8tT6jO7XGcMd/NyRVxQTK/+VfdxVCciTFYnUtujx\npBqjR6WIxKLBuWveiC62E0iqC72Sm6/Z4v5Py85hdvRwlW8+61V28geGjKOI\nqWpmBs2iP1HZtGVstyBZ7jETc9zvV6EyGBtxVd1hC4lcc0pG9cW+OOj6SkNo\nbU2X\r\n=W4SM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIED00K6oQLccWMxLt2kio1f7vvjI2xq0g/dWL32PpjBtAiAQfRgASNWpU9U9DpjYBiuRSosLOwXbdhagZUGPTytiWQ=="}]},"maintainers":[{"name":"datapunt","email":"datapunt@amsterdam.nl"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/leaflet-geojson-bbox-layer_0.1.1_1559824138716_0.6152810894839045"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-06T12:10:59.075Z","0.1.0":"2019-06-06T12:10:59.530Z","modified":"2023-06-29T09:08:57.827Z","0.1.1":"2019-06-06T12:28:58.823Z"},"maintainers":[{"email":"datapunt@amsterdam.nl","name":"datapunt-admin"}],"description":"Leaflet GeoJSON layer with bounding box feature retrieval","homepage":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer#readme","keywords":["leaflet","geojson"],"repository":{"type":"git","url":"git+https://github.com/Amsterdam/leaflet-geojson-bbox-layer.git"},"author":{"name":"Datapunt Amsterdam"},"bugs":{"url":"https://github.com/Amsterdam/leaflet-geojson-bbox-layer/issues"},"license":"MPL-2.0","readme":"# Leaflet Geojson bbox layer\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/c2e0da1e-9aa0-4fd3-a498-16a32dc981bc/deploy-status)](https://app.netlify.com/sites/leaflet-geojson-bbox-layer/deploys)\n\nLeaflet layer for drawing GeoJSON data based on the current view bounding box.\nThis allows for easy interactive elements (e.g. click handlers) even with (very) large feature sets.\n\nLayer is an extension of Leaflet's own GeoJSON layer \n([doc](https://leafletjs.com/reference-1.5.0.html#geojson) and [example](https://leafletjs.com/examples/geojson/)).\n\nThis new layer will handle calling the user provided `fetchRequest` function with a bounding box.\nThe string is of the form: `4.89,52.37,4.91,52.38` or `west,south,east,north` in the WGS84 coordinate system (latitude, longitude).\nThis function should return a GeoJSON object. \n\nThe main benefit of this layer is that only a subset of the data is displayed because the whole is to much of a performance hit.\nAt a certain zoom level however the current bounding box will encompass to many features.\nIf you set a value `zoomMin` value on the GeoJSON layer this value will both hide the layer and pause fetching new data.\n\nSee example: https://leaflet-geojson-bbox-layer.netlify.com/\n\n# Usage\n\n```javascript\nimport L from 'leaflet';\nimport geojsonBboxLayer from '@datapunt/leaflet-geojson-bbox-layer';\n\nconst url = 'https://map.data.amsterdam.nl/maps/meetbouten?Typename=meetbouten_status&REQUEST=GetFeature&SERVICE=wfs&OUTPUTFORMAT=application/json;%20subtype=geojson;%20charset=utf-8&version=1.1.0&srsname=urn:ogc:def:crs:EPSG::4326';\nconst fetchRequest = (bbox_str) => fetch(`${url}&bbox=${bbox_str}`).then(response => response.json());\n\n// Options specific to bbox geojson layer\nconst bboxLayerOptions = {\n    fetchRequest, // function that returns GeoJSON feature list for a given bounding box string\n};\n\n// Leaflet GeoJSON layer options, see: https://leafletjs.com/reference-1.5.0.html#geojson-pointtolayer\nconst geojsonLayerOptions = {\n    zoomMin: 16,\n\n    // Use pointToLayer to create your own marker: https://leafletjs.com/reference-1.5.0.html#geojson-pointtolayer\n    // See example code how to use feature to style marker\n\n\n    // Use onEachFeature if you need a event listener: onEachFeature\n    // See example how to add a click listener\n};\n\nconst myLayer = geojsonBboxLayer(bboxLayerOptions, geojsonLayerOptions);\n\nconst mapContainer = document.querySelector('#map');\nconst map = L.map(mapContainer);\nmap.setView([52.3724724, 4.9006668], 18);\nL.tileLayer('https://t1.data.amsterdam.nl/topo_wm/{z}/{x}/{y}.png', { minZoom: 1, maxZoom: 20, maxNativeZoom: 18 })\n    .addTo(map);\nmyLayer.addTo(map);\n```\n\n# Development\n\n## Install\n```bash\nnpm install\n```\n\n## Run\n\nThe example can be build with:\n\n```bash\nnpm start\n```\n\nSite available at http://localhost:8080.\n\nBuild the library and example distribution using:\n\n```bash\nnpm run build\n```\n\n## Test\n\n```bash\nnpm test\n```\n\nand\n\n```bash\nnpm run lint\n```\n\n## Linking\n\nIf you wish to make changes to this package and see the results directly in another package you can use `npm link` or `npm pack`.\n\nThe `npm pack` workflow works as follows, for each change you want to test in the external project:\n\n* In this package:\n  * run: `npm build:library`\n  * and run: `npm pack`\n* In the project using this library:\n  * run `npm install <path_to_library>/leaflet-geojson-bbox-layer-<version>.tgz`\n  \n\n## Publish\n\nAfter making changes:\n```\nnpm version major/minor/patch\n```\n\nTo actually publish package you'll need to login:\n```\nnpm login\n```\nUser/pass is in Datapunt password vault. \n\nThen publish the package\n```\nnpm publish --access public\n```\n","readmeFilename":"README.md"}