{"id":28423562,"url":"https://github.com/ptv-logistics/leaflet-ptv-developer","last_synced_at":"2025-06-25T11:31:04.077Z","repository":{"id":40415191,"uuid":"474891741","full_name":"ptv-logistics/leaflet-ptv-developer","owner":"ptv-logistics","description":"Leaflet classes for extended PTV Developer Maps functionalities","archived":false,"fork":false,"pushed_at":"2024-05-15T10:55:58.000Z","size":353,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-25T19:44:12.436Z","etag":null,"topics":["leaflet","maplibre-gl-js","ptv-developer"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ptv-logistics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-28T07:27:07.000Z","updated_at":"2025-04-16T07:02:13.000Z","dependencies_parsed_at":"2024-05-15T23:05:22.533Z","dependency_job_id":null,"html_url":"https://github.com/ptv-logistics/leaflet-ptv-developer","commit_stats":{"total_commits":76,"total_committers":7,"mean_commits":"10.857142857142858","dds":0.4078947368421053,"last_synced_commit":"523cf75bddb415adcab0b9682a4ccf91c0353775"},"previous_names":["ptv-group/leaflet-ptv-developer"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptv-logistics%2Fleaflet-ptv-developer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptv-logistics%2Fleaflet-ptv-developer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptv-logistics%2Fleaflet-ptv-developer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptv-logistics%2Fleaflet-ptv-developer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ptv-logistics","download_url":"https://codeload.github.com/ptv-logistics/leaflet-ptv-developer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptv-logistics%2Fleaflet-ptv-developer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258190194,"owners_count":22662443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["leaflet","maplibre-gl-js","ptv-developer"],"created_at":"2025-06-05T09:08:55.413Z","updated_at":"2025-06-25T11:31:03.551Z","avatar_url":"https://github.com/ptv-logistics.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Leaflet compatible!](https://img.shields.io/badge/Leaflet-1.x-blue.svg?style=flat)\n\n## Purpose\n\nleaflet-ptv-developer provides classes to add [PTV Developer](https://developer.myptv.com/) specific features to Leaflet.\n\n## Components\n\n* [L.TileLayer.PtvDeveloper](#tilelayerptvdeveloper)\n\n## How to build\n\n```npm install``` \n\nor use the latest build at https://unpkg.com/leaflet-ptv-developer/dist/\n\n\u003ca name=\"tilelayerptvdeveloper\"\u003e\u003c/a\u003e\n### L.TileLayer.PtvDeveloper\n\nThe Layer class `L.TileLayer.PtvDeveloper` can be used to make PTV Developer [`data-tiles`](https://developer.myptv.com/Documentation/Raster%20Maps%20API/Code%20Samples/Data%20Tiles.htm) elements clickable or request tiles with specific parameters.\n\n#### Additional options\n\n* *disableMouseEvents* - disables all mouse click and hover events. Default: ```false```\n\n\n#### Integration as single raster map\n\nThe easiest way to add a clickable layer is to use the class `L.TileLayer.PtvDeveloper`, append a clickable `data-tiles` layer (e.g. `restrictions` or `trafficIncidents`) to the profile and set the api key. The icons of the layer can now be clicked to display the object information. The options are the same as for `L.TileLayer`\n\n```javascript\nvar map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);\n\nvar interactiveTileLayer =  L.tileLayer.ptvDeveloper(\n            'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +\n            '?apiKey={token}\u0026layers={layers}', {\n                attribution: '\u0026copy; ' + new Date().getFullYear() + ' PTV Group, HERE',\n                layers: 'background,transport,labels,restrictions',\n                token: window.apiKey,\n                maxZoom: 22,\n                pane: 'tilePane'\n            }).addTo(map);\n\n```\n\n#### Integration as layered raster map\n\nIt's also possible to split the PTV Developer raster tiles into separate Leaflet layers. This sample creates a [`image-tiles`](https://developer.myptv.com/Documentation/Raster%20Maps%20API/Code%20Samples/Image%20Tiles.htm) base map layer and a clickable restrictions `data-tiles` overlay.\n\n```javascript\nvar map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);\n\nmap.createPane('clickableTiles');\nmap.getPane('clickableTiles').style.zIndex = 500;\n\nvar basemapLayer = L.tileLayer(\n    'https://api.myptv.com/rastermaps/v1/image-tiles/{z}/{x}/{y}' +\n    '?apiKey={token}\u0026layers={layers}', {\n        attribution: '\u0026copy; ' + new Date().getFullYear() + ' PTV Group, HERE',\n        layers: 'background,transport',\n        token: window.apiKey,\n        maxZoom: 22,\n        pane: 'tilePane'\n    }).addTo(map);\n\nvar restrictionsLayer = L.tileLayer.ptvDeveloper(\n    'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +\n    '?apiKey={token}\u0026layers={layers}', {\n        layers: 'restrictions,labels',\n        token: window.apiKey,\n        maxZoom: 22,\n        pane: 'clickableTiles'\n    }).addTo(map);\n\n```\n\n####  Integration as a layered vector map\n\nAnother possiblity is to mashup a clickable `data-tiles` layer with a [`vector-tiles`](https://developer.myptv.com/Documentation/Vector%20Maps%20API/QuickStart.htm) base map layer. \n\n```javascript\nvar map = L.map('map').setView(new L.LatLng(49.012, 8.4044), 17);\n\nvar vectorLayer = L.maplibreGL({\n        attribution: '\u0026copy; ' + new Date().getFullYear() + ' PTV Group, HERE',\n        interactive:false,\n        style: 'https://vectormaps-resources.myptv.com/styles/latest/standard.json',\n        transformRequest: (url, resourceType) =\u003e {\n        if (resourceType === 'Tile' \u0026\u0026 url.startsWith('https://api.myptv.com')) {\n            return {\n            url: url + '?apiKey=' + window.apiKey\n            }\n        }\n        }\n    }).addTo(map);\n    \nmap.createPane('clickableTiles');\nmap.getPane('clickableTiles').style.zIndex = 500;\n\nvar restrictionsLayer = L.tileLayer.ptvDeveloper(\n    'https://api.myptv.com/rastermaps/v1/data-tiles/{z}/{x}/{y}' +\n    '?apiKey={token}\u0026layers={layers}', {\n        layers: 'restrictions',\n        token: window.apiKey,\n        maxZoom: 22,\n        pane: 'clickableTiles'\n    }).addTo(map);\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptv-logistics%2Fleaflet-ptv-developer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fptv-logistics%2Fleaflet-ptv-developer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptv-logistics%2Fleaflet-ptv-developer/lists"}