Skip to main content

COVID-19 Safety Status on Mappls Map

Introduction

It is a guide to display a user's safety status for COVID-19 on a map. It will show whether user is in a containment zone or not if yes how much is distance from current location.

Following this guide it will be possible to display user's safety status on Mappls Map in the form of a safety strip depending upon the user's current location.

A method need to be called to check safety status. SDK has inbuild view with button which can be used to call that method.

Getting Started

Get Safety Status

After loading of Map, a mthod can be called to get safety status. showCurrentLocationSafety is the method which helps to find user's safety status. On successfully fetching of status a safety strip will be shown on map.

Java

mapplsMap.showCurrentLocationSafety();

Kotlin

mapplsMap?.showCurrentLocationSafety()

Safety Strip

On successfully receiving status based on location from server, a view will be shown on map with safety information like distance, containment zone location etc.

Safety Strip Position

By default safety status strip will be shown on top of map.

Java

mapplsMap.getUiSettings().setSafetyStripGravity(Gravity.TOP);

Kotlin

mapplsMap?.uiSettings?.safetyStripGravity = Gravity.TOP

Safety Strip Margins

By default margins of safety status is zero.

Java

mapplsMap.getUiSettings().setSafetyStripMargins(left, top, right, bottom);

Kotlin

mapplsMap?.uiSettings?.setSafetyStripMargins(left, top, right, bottom)

Hide Safety Status

Java

mapplsMap.getUiSettings().hideSafetyStrip();

Kotin

mapplsMap?.uiSettings?.hideSafetyStrip()