Skip to content

dionlahh/flutter-map-module

Repository files navigation

Fluter Map Module

It was built using Flutter framework and supporting dependencies.

Features that this Fluter Map Module offers:

  • Map view of current position
  • Area of coverage
  • Feature plotting

Prerequisites

  • Android Studio SDK
  • Flutter SDK
  • Android 9.0 and above

Table of Contents

  1. Integration
  2. Features & Functions
    a. Map
    b. App Bar Buttons
    c. Floating Action Buttons
  3. Libraries

Integration

When developing on different workstations, the Flutter packages and dependencies needs to be updated. This can be done so by running the following command lines within the Flutter module's working directory:

flutter clean

followed by

flutter pub get

Launch

On application launch, it will first launch the map module, with orienation lock on. The screen will show the phone's current location and heading.

Map

App Bar Buttons:

  • Orientation Lock Toggle
    • True (default): Screen is locked to the phone's current position on the map, and and will automatically rotate towards the phones's heading.
    • False: Screen is no longer locked, and the user can move the map around to view other parts of the map. Map no longer automatically rotate to the phone's heading.
  • Grid Toggle
    • Toggles on and off a grid on the map.
  • Map Layer Toggle
    • Toggles between different map layers.
  • Settings Button
    • Allows the user to adjust the position marker's arc's radius and span using 2 different sliders. (default: 100m and phone's back camera's horizontal FOV)

Floating Action Buttons:

These buttons allows for the user to draw its corresponding shapes/objects on the map.

Clear All:

  • Button is only available when there are objects plotted on the map.
  • Deletes all plotted objects.

Polyline:

  • Tap on the screen to plot the points of the polyline.
  • Save the plotted polyline by pressing the save button. This will change the polyline's colour to red, indicating that it has been saved.
  • Toggle button switches the opacity of all saved polylines between 1 (default) and 0.

Polygon:

  • Tap on the screen to plot the points of the polygon.
  • Save the plotted polygon by pressing the save button. This will change the polygon's colour to red, indicating that it has been saved.
  • Toggle button switches the opacity of all saved polygon between 1 (default) and 0.
  • Saved polygons can be edited by tapping on the polygons
    • Square markers on the polygon can be dragged to change the vertice's location.
    • Circle markers on the polygon can be dragged to create a new vertice.
    • Saved polygons can be deleted by tapping on the circle, followed by the delete button.

Markers:

  • Tap on the screen to plot different markers.
  • To add text beneath the markers, type the text in the textfield at the botttom of the screen. All the markers currently being plotted will have the same text.
  • Save the plotted markers by pressing the save button.
  • Toggle button switches the opacity of all saved markers between 1 (default) and 0.
  • Saved markers can be tapped on for more information regarding the marker's position

Circles:

  • Tap on the screen to plot a circle. (Only one circle can be plotted at a time)
  • To adjust the radius of the circle, use the slider at the bottom of the screen. The radius in meters is shown beside the slider. (Max: 500m)
  • Save the plotted circle by pressing the save button.
  • Toggle button switches the opacity of all saved circles between 1 (default) and 0.
  • Saved circles' radius can be adjusted by tapping on the circle on the map
  • Saved circles can be deleted by tapping on the circle, followed by the delete button.

Other Map Features:

  • Scale Bar
    • Changes according to the current zoom of the map
  • Compass
    • Rotates according to the phone's heading

Libraries

This section includes useful libraries and plugins used within the Ground Sensor project.

Flutter Dependencies:


Know Issues

  • On first launch, the application will crash due to permissions not being handled properly by the application. To fix, long press the application in the app drawer > App info > Permissions > allow location permission. Relaunch the application and you are good to go.

About

Map created using Flutter Maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published