Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I used old version of flutter map, and i used to manage zoom in and zoom out using attributebuilder from tile layer, how I can achieve the same using latest version (7.0.2)n #1981

Closed
halhwadi opened this issue Oct 19, 2024 · 1 comment
Labels
general This issue is not a bug nor feature request, and is better suited for Discussions or Discord

Comments

@halhwadi
Copy link

halhwadi commented Oct 19, 2024

What is the bug?

its not a bug, its question, I searched for answers in flutter documentation but didn't get the answer, I need your assistance to help me figure out how I can zoom in and zoom out with maintain the markers location on map using version 7.0.2, I used to attribuitebuilder, see the existing code:

                                          TileLayer(
                                            urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
                                            subdomains: ['a', 'b', 'c'],
                                          //   attributionBuilder: (_) {
                                          //   return Row(
                                          //     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                          //     crossAxisAlignment: CrossAxisAlignment.center,
                                          //     children: [
                                          //       FloatingActionButton(
                                          //         heroTag: 'zoomOut',
                                          //         onPressed: _zoomOut,
                                          //         tooltip: 'Zoom',
                                          //         child: const Icon(Icons.remove_circle_outline_rounded,size:30.0),
                                          //       ),
                                          //       FloatingActionButton(
                                          //         heroTag: 'zoomIn',
                                          //         onPressed: _zoomIn,
                                          //         tooltip: 'Zoom',
                                          //         child: const Icon(Icons.add_circle_outline_rounded,size:30.0),
                                          //       ),
                                          //     ],
                                          //   );
                                          // },
                                        ),
                                        MarkerLayer(
                                          markers: markers
                                        ),
                                      ],
                                    ),
                                  )
                                ]

How can we reproduce it?

                                         TileLayer(
                                            urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
                                            subdomains: ['a', 'b', 'c'],
                                          //   attributionBuilder: (_) {
                                          //   return Row(
                                          //     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                          //     crossAxisAlignment: CrossAxisAlignment.center,
                                          //     children: [
                                          //       FloatingActionButton(
                                          //         heroTag: 'zoomOut',
                                          //         onPressed: _zoomOut,
                                          //         tooltip: 'Zoom',
                                          //         child: const Icon(Icons.remove_circle_outline_rounded,size:30.0),
                                          //       ),
                                          //       FloatingActionButton(
                                          //         heroTag: 'zoomIn',
                                          //         onPressed: _zoomIn,
                                          //         tooltip: 'Zoom',
                                          //         child: const Icon(Icons.add_circle_outline_rounded,size:30.0),
                                          //       ),
                                          //     ],
                                          //   );
                                          // },
                                        ),
                                        MarkerLayer(
                                          markers: markers
                                        ),
                                      ],
                                    ),
                                  )
                                ]

Do you have a potential solution?

No response

Platforms

android 13, windows 11

Severity

Fatal: Causes the application to crash

@halhwadi halhwadi added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Oct 19, 2024
@halhwadi halhwadi changed the title i used old version of flutter map, and i used to manage zoom in and zoom out using attributebuilder from tile layer, how i can achieve the same using latest version (7.0.2)n I used old version of flutter map, and i used to manage zoom in and zoom out using attributebuilder from tile layer, how I can achieve the same using latest version (7.0.2)n Oct 19, 2024
@josxha josxha added general This issue is not a bug nor feature request, and is better suited for Discussions or Discord and removed needs triage This new bug report needs reproducing and prioritizing bug This issue reports broken functionality or another error labels Oct 19, 2024
@josxha
Copy link
Contributor

josxha commented Oct 19, 2024

Hello @halhwadi, please prefer to ask your questions in the Q&A in the GitHub discussions or in the #help channel on the discord server.

It's great if you include code samples but please format them in advance and please post every code snippet only once. You can use a code block like this: https://www.markdownguide.org/extended-syntax/#fenced-code-blocks

The attributionBuilder is not available in newer versions. You can just move your FloatingActionButtons directly inside the children list from FlutterMap. There is a dedicated example for zoom buttons in the example app.

@josxha josxha closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general This issue is not a bug nor feature request, and is better suited for Discussions or Discord
Projects
Status: Done
Development

No branches or pull requests

2 participants