Test out the Maps plugin for Flutter

Guest

No items found.

Guest

May 8, 2018

Test out the Maps plugin for Flutter

Guest

No items found.

Guest

May 8, 2018

We’ve just released a plugin that adds experimental Mapbox Maps support to Flutter. Embed interactive and customizable maps inside a Flutter widget with just a few lines of code. Add one of our designer map styles or create your own in Studio and reference it in your app using the plugin.

To install the Flutter plugin follow the instructions on https://pub.dartlang.org/packages/mapbox_gl. The source code is available at https://github.com/mapbox/flutter-mapbox-gl where you can find additional documentation and examples to get you started.

Add a map

To embed an interactive map in your Flutter widget, add a MapboxOverlay as a child. For example, the following snippet will add a map with a Dark style centered at the coordinates specified in target:



child: new MapboxOverlay(
controller: new MapboxOverlayController(),
options: new MapboxMapOptions(
style: Style.dark,
camera: new CameraPosition(
target: new LatLng(lat: 52.376316, lng: 4.897801),
zoom: 15.0,
bearing: 0.0,
tilt: 0.0),
),
)

The map integrates correctly with other UI flutter components. In this example you can see how the map can be included in a tabbed view with three tabs.

The plugin also includes API support to convert from the Flutter local screen coordinates (the x,y coordinates where the user taps on the screen) to latitude and longitude values on the map.

Make your map interactive

The plugin comes with a demo app that showcases some of the interactions you can build with the plugin today. See it in action:

Apply flyTo, easeTo and jumpTo camera animations.
Using a tap on the map to convert the tap location to map latitude and longitude values

Load different map styles when user selects from a toggle menu.

Please note that this is an experimental plugin meant for gathering early feedback from the Flutter community. It only supports Android for now, but we plan to add new features in the coming weeks. We welcome and encourage contributions in the GitHub repo.

Look for us at Google I/O

Like every year, we’ll be attending Google I/O to hangout and enjoy all the announcements. Ping Dan or Pablo if you have any questions about the Flutter plugin or if you simply want to chat about our developer platform for maps and location services.

Heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 4

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 5

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

response = requests.get(

  "https://api.mapbox.com/v4/mapbox.temperature-raster-tileset/tilequery/40,-105.json",

    params={

        "layers": "temperature,wind_speed",

        "bands": "1708304400,1708311600",

    },

Optional caption
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque euismod maximus porta. Pellentesque vitae augue elit. Nam semper eros leo, nec hendrerit nunc aliquet quis. Morbi ac sapien tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur porta imperdiet lorem, ut aliquet orci pellentesque quis. Donec magna augue, molestie aliquam enim eu, auctor feugiat metus."

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

No items found.
No items found.

Related articles