{"id":24438424,"url":"https://github.com/dartclub/mapbox_widget_layer","last_synced_at":"2025-04-12T17:51:25.269Z","repository":{"id":52110072,"uuid":"520074246","full_name":"dartclub/mapbox_widget_layer","owner":"dartclub","description":"[experiment] Custom Flutter Widgets on top of a Mapbox Map (package mapbox_gl). Exposes builders to reactively build widgets based on screen position, zoom, bearing, and tilt.","archived":false,"fork":false,"pushed_at":"2022-08-21T16:14:23.000Z","size":221,"stargazers_count":11,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T12:11:47.986Z","etag":null,"topics":["dart","flutter","geodata","mapbox","mapbox-gl","visualization"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/mapbox_widget_layer","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dartclub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-01T11:02:07.000Z","updated_at":"2024-11-14T06:35:44.000Z","dependencies_parsed_at":"2022-09-01T12:40:57.001Z","dependency_job_id":null,"html_url":"https://github.com/dartclub/mapbox_widget_layer","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/dartclub%2Fmapbox_widget_layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartclub%2Fmapbox_widget_layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartclub%2Fmapbox_widget_layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartclub%2Fmapbox_widget_layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dartclub","download_url":"https://codeload.github.com/dartclub/mapbox_widget_layer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610409,"owners_count":21132920,"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":["dart","flutter","geodata","mapbox","mapbox-gl","visualization"],"created_at":"2025-01-20T19:16:14.554Z","updated_at":"2025-04-12T17:51:25.240Z","avatar_url":"https://github.com/dartclub.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mapbox_widget_layer\n\n!! May be unstable and have bad performance !!\nCustom Flutter Widgets on top of a Mapbox Map (package [mapbox_gl](https://pub.dev/packages/mapbox_gl)). Exposes builders to reactively build widgets based on screen position, zoom, bearing, and tilt.\n\n\nhttps://user-images.githubusercontent.com/10634693/185800406-314cf4d4-128f-4c16-b5cf-e97035e15664.mov\n\n\nHeavily inspired by the example here: [flutter-mapbox-gl/maps \u003e custom markers](https://github.com/flutter-mapbox-gl/maps/blob/master/example/lib/custom_marker.dart)\n\n## Usage\n\n- Install [mapbox_gl](https://pub.dev/packages/mapbox_gl)\n- Create a new widget with a `Stack` widget that contains a `MapboxMap` and the `MapboxWidgetLayer`\n\nThere are three options for widget rendering:\n\n1) `MapboxItemBuilder` – exposes all attributes to manually control rendering of the widget: `screenPosition` `zoom`, `bearing`, and `tilt` in a `builder`-closure to reactively build widgets according to the exposed attributes.\n    Example usage:  \n\n    ```dart\n        MapboxItemBuilder(\n            builder: (context, screenPosition) {\n                debugPrint('${screenPosition.screenPosition}');\n                debugPrint('${screenPosition.zoom}');\n                debugPrint('${screenPosition.bearing}');\n                debugPrint('${screenPosition.tilt}');\n                return Container(\n                  height: 100,\n                  width: 100,\n                  color: Colors.blue[200],\n                  child: const Center(child: Text('builder')),\n                );\n            },\n            size: const Size(100, 100),\n            coordinate: const LatLng(49.457647152564334, 11.076190602176172),\n        ),\n    ```\n\n2) `MapboxItem` – does not expose options to customize rendering.\n    Example usage:\n\n    ```dart\n        MapboxItem(\n            child: Container(\n                height: 100,\n                width: 100,\n                color: Colors.red[200],\n                child: const Center(child: Text('item')),\n            ),\n            size: const Size(100, 100),\n            coordinate: const LatLng(49.45800162760231, 11.076150534247994),\n        ),\n    ```\n\n3) `MapboxAutoTransformItem` – auto-adjusts rendering, based on the `zoom`, `bearing`, and `tilt`. Allows for manual control of the `zoomBase` (zoom level at which the scale of the widget should match the `size` in pixels), and `zoomExpFactor`, which is the exponential base for the interpolation between zoom levels.\n    Example usage:\n\n    ```dart\n        MapboxAutoTransformItem(\n            child: Container(\n                height: 100,\n                width: 100,\n                color: Colors.green[200],\n                child: const Center(child: Text('auto')),\n            ),\n            size: const Size(100, 100),\n            coordinate: const LatLng(49.45750295375467, 11.076125061775054),\n        ),\n    ```\n\n### Full example can be found in file `./example/main.dart` [HERE](https://pub.dev/packages/mapbox_widget_layer/example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartclub%2Fmapbox_widget_layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdartclub%2Fmapbox_widget_layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartclub%2Fmapbox_widget_layer/lists"}