Classes
GridHelper
class that provide grid helping functions
-
convertBoundsToGridLines(bounds:precision:)
Converting Mapbox coordinates to grid lines
this function encodes mapbox coordinates and currrent precision level to grid lines
-
extendGridBounds(_:)
extendGridBounds
this function encodes mapbox coordinates and extend bounds in all the direction to fill white space.
-
lngLatBoundsToUnlCoreBounds(_:)
lngLatBoundsToUnlCoreBounds
this function encodes mapbox coordinates to unl core bound of all four directions n,e,w,s
-
getCell(_:_:)
getCell( function is used to retrive the grid cell according to user tap coordinates over the map and current precision level
-
getFormattedCellDimensions(_:)
getFormattedCellDimensions
get cell dimensions according to current precision level
-
getFormattedCellDimensionsFrom(integer:)
getFormattedCellDimensionsFrom
get cell dimensions according to current precision level in integer type
-
locationIdToBoundsCoordinates(_:)
locationIdToBoundsCoordinates
encode geohash locationId to coordinates array of all directions
-
getMinGridZoom(_:)
getMinGridZoom
retrive zoom level according to current precision level
-
locationIdToLngLat(_:)
locationIdToLngLat
encode geohash locationID to CLLocationCoordinate2D
GridLayers
class that provide different grid layers
-
lines(_:)
lines(
get lines style layer according to the grid option
-
cellFill(_:)
cellFill(
get cell fill style layer according to the grid option
-
cellLine(_:)
cellLine(
get cell border style layer according to the grid option
GridPresenter
This class provide all the neccesary functions to present grid over maps
-
init(_:_:)
Initializing the class
-
handlePrecisionChange(newPrecision:)
handlePrecisionChange
this function takes the user precision input and configure the map accordingly
-
handleMapClick(click:_centre:)
handleMapClick
while presenting grid view this function encode user click over map display the selected location
-
updateGridLines()
updateGridLines
while moving the map across this function help to update grid lines
-
addLayersAndSources()
addLayersAndSources
While initializing the map this function add all required sources and layers
-
hideGrid()
hideGrid
remove the source and layer of grid from the map
-
hideSelectedCell()
hideSelectedCell
remove selected grid cell source and layer from the map
-
handleStyleChange()
handleStyleChange
Handles the styles changes between all different tiles
GridSources
This class provide required sources for the map
-
line()
line()
Line source is used to draw grid
-
cell()
cell()
Cell source is used to draw rectangle cell
MapHelper
This Class provide all the helper function for map
-
UNLImage(named:)
UNLImage is extension function for setting the images in UNL Project
-
name: Image name
-
TileSelectorView
this class is for tile selector view
-
delegate
Variables
-
layoutSubviews()
Lifecycle methods
-
loadTiles(arrayTiles:)
loadTiles(
This function is used to display all the provided tiles in selector where user can change map style according to their choice
- arrayTiles: array of tiles
UNLMapSDK
This class is Used to Initialize the SDK
-
init()
-
configure(apiKey:vpmId:gridControl:tilesSelectorControl:)
Configure function is used to set all th required properties while setting up the SDK
- apiKey: API Key
- vpmId: VPM ID
- gridControl: flag to hide/show grid control
- tilesSelectorControl: flag to hide/show tile selector control
UNLMapView
this class is used to display map and all the in-built and custom controls
-
gridOptions
-
arrayTiles
-
layoutSubviews()
-
loadMap()
MARK: - Configure and Load Map
-
showTiles(withArray:)
showTiles
Shows the tiles in selector according to user input
- tiles: Array of tiles
-
changeTile(style:)
changeTiles
Changes the map style with user input of selected tile
- style: selected tile style
-
selectedTile(name:)
selectedTile
callback for selected tile
- strName: selected tile name in string
-
mapView(_:regionDidChangeWith:animated:)
-
mapView(_:didFinishLoading:)
-
mapViewRegionIsChanging(_:)
-
touchesEnded(_:with:)