{"id":13784489,"url":"https://github.com/techjb/Vector-Tiles-Google-Maps","last_synced_at":"2025-05-11T19:33:17.261Z","repository":{"id":44454673,"uuid":"355250577","full_name":"techjb/Vector-Tiles-Google-Maps","owner":"techjb","description":"JavaScript library to render vector tiles in Google Maps.","archived":false,"fork":false,"pushed_at":"2023-08-16T09:26:03.000Z","size":2204,"stargazers_count":38,"open_issues_count":2,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T19:08:48.421Z","etag":null,"topics":["google-maps","google-maps-api","mapbox","mbtiles","mvt","pbf","vector-tiles"],"latest_commit_sha":null,"homepage":"https://github.com/techjb/Vector-Tiles-Google-Maps","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techjb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-06T16:04:44.000Z","updated_at":"2024-03-01T08:30:50.000Z","dependencies_parsed_at":"2024-01-17T03:13:58.570Z","dependency_job_id":"e6465df8-c21a-4cb3-82c0-b6e00375046f","html_url":"https://github.com/techjb/Vector-Tiles-Google-Maps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjb%2FVector-Tiles-Google-Maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjb%2FVector-Tiles-Google-Maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjb%2FVector-Tiles-Google-Maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjb%2FVector-Tiles-Google-Maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techjb","download_url":"https://codeload.github.com/techjb/Vector-Tiles-Google-Maps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225086630,"owners_count":17418767,"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":["google-maps","google-maps-api","mapbox","mbtiles","mvt","pbf","vector-tiles"],"created_at":"2024-08-03T19:00:45.629Z","updated_at":"2024-11-17T20:32:02.802Z","avatar_url":"https://github.com/techjb.png","language":"JavaScript","readme":"﻿\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e    \n    \u003cli\u003e\u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n        \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#recommendations\"\u003eRecommendations\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e\u003c/li\u003e        \n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e   \n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgements\"\u003eAcknowledgements\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n[![Product Name Screen Shot][product-screenshot]](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/styles-feature.html)\n\n\nVector Tiles Google Maps is a JavaScript library to render vector tiles in Google Maps.\n\nThe library provides funcionality to enable cache, filter features, apply styles, onclick event, mouse hover, and show/hide layers.\n\nFurther work would be to load [Mapxbox GL Styles](https://docs.mapbox.com/mapbox-gl-js/style-spec/) in Google Maps.\n\n### Built With\n\n* [Google Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/overview?)\n* [Mapbox vector tiles](https://github.com/mapbox/vector-tile-js)\n* [Protocol Buffers](https://github.com/protocolbuffers/protobuf)\n* JavaScript\n\n\n\u003c!-- DEMO EXAMPLES --\u003e\n## Examples\n\n* [Basic](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/basic.html) - Basic loading vector tiles with debug enabled.\n* [Cache](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/cache.html) - Cache enabled.\n* [Click](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/click.html) - Click to select one or multiple features.\n* [Hover](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/hover.html) - On mouse hover event.\n* [Preselected features](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/preselected-features.html) - Set features as selected before loading.\n* [Filter](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/filter.html) - Filter features by it properties.\n* [Layers](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/layers.html) - Add remove vector tiles layers.\n* [Styles](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/styles.html) - Change style dynamically.\n* [Styles feature](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/styles-feature.html) - Style based on feature properties.\n* [Style filter and layer](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/style-filter-layer.html) - Update the style, filter and visible layers simultaneously.\n* [Point, linestring and polygon](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/point-linestring-polygon.html) - Show all type of geometries.\n* [Custom draw](https://techjb.github.io/Vector-Tiles-Google-Maps/examples/custom-draw.html) - Custom draw function for each feature.\n\n\n\u003c!-- INSTALATION --\u003e\n## Installation\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/techjb/Vector-Tiles-Google-Maps.git\n   ```\n2. Install NPM packages\n   ```sh\n   npm install\n   ```\n3. Get your own API Key for the [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/get-api-key) and replace it in all the provided examples\n   ```html\n   \u003cscript src=\"https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY\" defer\u003e\u003c/script\u003e\n   ```\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\nCreate the `MVTSource` object and then insert it as a `overlayMapType`. \nProvide the vector tiles server url in the options object.\n\n\n```js\nvar options = {\n    url: \"http://your_vector_tiles_url/{z}/{x}/{y}.pbf\"\n};\n\nvar mvtSource = new MVTSource(map, options);\nmap.overlayMapTypes.insertAt(0, mvtSource);\n```\n\n### Recommendations\n\n* Insert the `MVTSource` after tiles have been loaded for the first time \nto avoid duplicate invocation to `GetTile()`. It is documented in [this issue tracker](https://issuetracker.google.com/issues/73335429).\n\n```js\n google.maps.event.addListenerOnce(map, 'tilesloaded', function () {\n    map.overlayMapTypes.insertAt(0, mvtSource);\n});\n```\n\n* If you need to set style based on feature property or trigger `onClick` or `onMouseHover` event, \nset the property `getIDForLayerFeature` option with the function that returns the unique id for each feature.\n\n```js\nvar options = {    \n    getIDForLayerFeature: function(feature) {\n        return feature.properties.id;\n    }\n};\n```\n\n* Enable cache for better performance and smooth flow.\n```js\nvar options = {    \n    cache: true\n};\n```\n\n* Set the `sourceMaxZoom` option to enable [overzoom](https://docs.mapbox.com/help/glossary/overzoom/).\n```js\nvar options = {    \n    sourceMaxZoom: 14\n};\n```\n\n\n\u003c!-- DOCUMENTATION --\u003e\n## Documentation\n\nSee [documentation](https://github.com/techjb/Vector-Tiles-Google-Maps/blob/master/DOCUMENTATION.md) for the contructor options and public methods.\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\nSee the [open issues](https://github.com/techjb/Vector-Tiles-Google-Maps/issues) for a list of proposed features (and known issues).\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- LICENSE --\u003e\n## License\n\nSee [license](https://github.com/techjb/Vector-Tiles-Google-Maps/blob/master/LICENSE.txt) for more information.\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nJesús Barrio - [@techjb](https://twitter.com/techjb)\n\nProject Link: [https://github.com/techjb/Vector-Tiles-Google-Maps](https://github.com/techjb/Vector-Tiles-Google-Maps)\n\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n\n* The authors of the library [Leaflet.MapboxVectorTile](https://github.com/SpatialServer/Leaflet.MapboxVectorTile) witch has been used as a start point for this development.\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[product-screenshot]: images/screenshot.png","funding_links":[],"categories":["Clients"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjb%2FVector-Tiles-Google-Maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechjb%2FVector-Tiles-Google-Maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjb%2FVector-Tiles-Google-Maps/lists"}