Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Working with Maps is an important feature in every developer’s routine. When it comes to integrating maps in a Flutter App, what comes to our mind is GoogleMaps.
That’s true GoogleMaps is a very proficient one, but in today’s blog, we will be reading about how to integrate flutter_map within the app.
flutter_map is highly customizable and scalable and also provides its developers with multiple options to handle the basic maps.
Check the best Flutter app development services offered by Mobikul
In order to add flutter_maps to the app, we will need to add the dependency to pubspec.yaml
After adding this, run the ‘dart pub get’ command.
In order to specify Latitude and Longitude we will also need to add another dependency i.e. latlong2
Here is the basic widget –
mapController – This takes a MapController instance and is used to control the map programmatically.
options – This takes a MapOptions instance. Here we can specify the properties such as minZoom, maxZoom, rotation, etc.
children – In this, we can specify the layers that we need to add to our maps either the Tile Layer, Maker Layer, Polygon Layer, or many others.
nonRotatedChildren – In this we can specify the elements that we want to be rendered over the map but do not want them to rotate.
Within the TileLayer, there are multiple properties such as urlTemplate, userAgentPackageName, tileProvider, tileSize, etc.
The urlTemplate defines the structure to create the URLs for the tiles i.e. {s} means one of the available subdomains (can be omitted) {z} zoom level {x} and {y} — tile coordinates {r} can be used to add “@2x” to the URL to load retina tiles (can be omitted).
{s}
{z}
{x}
{y}
{r}
userAgentPackageName includes the package name for that particular app in order to avoid any constraints due to traffic. By default, it is set to “unknown”.
This layer helps us add multiple markers to our map as per our requirements. We can add custom markers as well. We can also specify the rotations for the markers.
Eg.
In this blog, we have discussed Integrating Flutter Maps into our apps
I hope it will help you in customizing the maps with the help of flutter_map.
Read more interesting Flutter Blogs by Mobikul.
Looking forward to reading about Flavors in Android – https://mobikul.com/android-product-flavors/
Thanks for reading!!
https://docs.fleaflet.dev/
https://pub.dev/packages/flutter_map
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.