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 MapmyIndia's Map[1] in the form of a safety strip depending upon the user's current location. MapmyIndiaMaps SDK for iOS is SDK to display map on iOS platform.
A method need to be called to check safety status. SDK has inbuild view with button which can be used to call that method.
A sample application project can be found on github by following link: iOS MapDemo.
Note This fetatue is available from version 5.7.8
of MapmyIndiaMaps SDK.
After loading of MapmyIndia's Map[1], 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.
[_mapView showCurrentLocationSafety];
mapView.showCurrentLocationSafety()
Note:
showCurrentLocationSafety
will only works if user's location is available. So best practice to call this function when map is ready to show user's location. A delegate methoddidUpdateUserLocation
of map SDK can be used to check when map is ready to show user location.
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. By default its position will be on top of map.
By default safety status strip will be shown on top of map. But its position can be changed by property safetyStripPosition
which is of type MGLOrnamentPosition
.
[_mapView setSafetyStripPosition:MGLOrnamentPositionBottomLeft];
mapView.safetyStripPosition = .bottomLeft
By default margins of safety status is zero. But margins can be set by property safetyStripMargins
which is of type CGPoint
.
[_mapView setSafetyStripMargins:CGPointMake(0, 30)];
mapView.safetyStripMargins = CGPoint(x: 0, y: 30)
Safety Strip can be hidden from map by calling method hideSafetyStrip
.
[_mapView hideSafetyStrip];
mapView.hideSafetyStrip()
A MapmyIndia's map component which is part of MapmyIndiaMaps SDK for iOS.
For any queries and support, please contact:
Email us at [email protected]
Stack Overflow Ask a question under the mapmyindia-api
Support Need support? contact us!
Blog Read about the latest updates & customer stories
© Copyright 2020. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions