Skip to main content

method

calcPosition(camera:geometry:screenArea:tilt:bearing:size:)

public func calcPosition(
camera: BaseCamera,
geometry: Geometry,
screenArea: Padding? = nil,
tilt: Tilt? = nil,
bearing: Bearing? = nil,
size: ScreenSize? = nil
) -> CameraPosition
Parameters

camera

Camera used to calculate the position.

geometry

Geometric object to fit into the screen area specified by the screen_area parameter.

screenArea

Screen area to embed geometry. If not set, camera padding is used for calculation.

tilt

Tilt

bearing

Bearing

size

View area size. If not specified, the ICamera::size() value is used.

Returns

calcPosition(camera:objects:screenArea:tilt:bearing:size:)

public func calcPosition(
camera: BaseCamera,
objects: [SimpleMapObject],
screenArea: Padding? = nil,
tilt: Tilt? = nil,
bearing: Bearing? = nil,
size: ScreenSize? = nil
) -> CameraPosition
Parameters

camera

Camera used to calculate the position.

objects

Map objects to be embedded in the screen area specified by the screen_area parameter.

screenArea

Screen area to embed geometry. If not set, camera padding is used for calculation.

tilt

Tilt

bearing

Bearing

size

Size of the view area. If not specified, the value of ICamera::size() is used.

Returns

createRasterTileDataSource(context:sublayerName:urlTemplate:)

public func createRasterTileDataSource(
context: Context,
sublayerName: String,
urlTemplate: String
) -> Source
Parameters

context

Context.

sublayerName

Name to be used when generating objects. This name must be specified in the styles in the filter condition of the raster type layer for the db_sublayer attribute. Example: [“match”, [“get”, “db_sublayer”], [“NAME”], true, false] For details, see the specification: https://docs.2gis.com/en/mapgl/stylespecification

urlTemplate

URL template for the tile request, must contain substring {x}, {y} and {z}, which when substituted with numeric values form a valid URL to which a request for tile data will be sent.

Returns

createRawMyLocationController()

public func createRawMyLocationController() -> MyLocationController

createSmoothMyLocationController()

public func createSmoothMyLocationController() -> MyLocationController

createStyleZoomToTiltRelation(points:)

public func createStyleZoomToTiltRelation(
points: [StyleZoom: Tilt]
) -> StyleZoomToTiltRelation
Returns
StyleZoomToTiltRelation

Dependence of the camera tilt angle on the style zoom level, if the dependence could not be created - throw an exception.

getHttpCacheManager(context:)

public func getHttpCacheManager(
context: Context
) -> HttpCacheManager?
Parameters

getInstructionManeuver(extraInstructionInfo:)

public func getInstructionManeuver(
extraInstructionInfo: ExtraInstructionInfo
) -> InstructionManeuver
Parameters

extraInstructionInfo

Returns

getLanesControlImages(laneSign:maxCount:ignoreActiveManeuver:)

public func getLanesControlImages(
laneSign: RouteLaneSign,
maxCount: UInt32,
ignoreActiveManeuver: Bool
) -> [LanesControlImage]
Parameters

laneSign

maxCount

ignoreActiveManeuver

Returns

getLocaleManager(context:)

public func getLocaleManager(
context: Context
) -> LocaleManager
Parameters

context

Returns

getPackageManager(context:)

public func getPackageManager(
context: Context
) -> PackageManager
Parameters

context

Returns

getRoadMacroGraph(context:)

public func getRoadMacroGraph(
context: Context
) -> RoadMacroGraph
Parameters

context

Returns

getSystemMemoryManager(context:)

public func getSystemMemoryManager(
context: Context
) -> SystemMemoryManager
Parameters

getTerritoriesAlongRouteProvider(context:)

public func getTerritoriesAlongRouteProvider(
context: Context
) -> TerritoriesAlongRouteProvider
Parameters

getTerritoryManager(context:)

public func getTerritoryManager(
context: Context
) -> TerritoryManager
Parameters

getVoiceManager(context:)

public func getVoiceManager(
context: Context
) -> VoiceManager
Parameters

context

Returns

parseGeoJson(geoJsonData:)

public func parseGeoJson(
geoJsonData: String
) -> [GeometryMapObject]
Parameters

geoJsonData

Returns

parseGeoJsonFile(fsPath:)

public func parseGeoJsonFile(
fsPath: String
) -> [GeometryMapObject]
Parameters

projectionZToStyleZ(projectionZ:latitude:)

public func projectionZToStyleZ(
projectionZ: Zoom,
latitude: Latitude
) -> StyleZoom
Parameters

projectionZ

latitude

Returns

remainingRouteGeometry(fullRouteGeometry:currentRoutePoint:)

public func remainingRouteGeometry(
fullRouteGeometry: GeoPointRouteAttribute,
currentRoutePoint: RoutePoint
) -> GeoPointRouteAttribute
Parameters

fullRouteGeometry

Full geometry of the entire route.

currentRoutePoint

Current position on the route.

Returns
GeoPointRouteAttribute

Geometry of the rest of the route.

routeMatchesTruckPassZonePasses(truckPassZoneIds:passZonePasses:)

public func routeMatchesTruckPassZonePasses(
truckPassZoneIds: TruckPassZoneIdRouteLongAttribute,
passZonePasses: [TruckPassZonePass]
) -> Bool
Parameters

truckPassZoneIds

Route attribute with truck pass zone identifiers.

passZonePasses

Passes for passing through truck pass zones.

Returns
Bool

Signifies whether there are enough passes to pass a route.

styleZToProjectionZ(styleZ:latitude:)

public func styleZToProjectionZ(
styleZ: StyleZoom,
latitude: Latitude
) -> Zoom
Parameters

styleZ

latitude

Returns

toMapGeometry(geometry:)

public func toMapGeometry(
geometry: GeoPointRouteAttribute
) -> Geometry
Parameters

zoomOutToFit(camera:geometry:size:)

public func zoomOutToFit(
camera: BaseCamera,
geometry: Geometry,
size: ScreenSize? = nil
) -> CameraPosition
Parameters

camera

Camera used to calculate the position.

geometry

Geometric object to fit into the screen area specified by the camera's padding.

size

View area size. If not specified, the ICamera::size() value is used.

Returns

zoomOutToFit(camera:objects:size:)

public func zoomOutToFit(
camera: BaseCamera,
objects: [SimpleMapObject],
size: ScreenSize? = nil
) -> CameraPosition
Parameters

camera

Camera used to calculate the position.

objects

Map objects to fit into the screen area specified by the camera padding.

size

View area size. If not specified, the ICamera::size() value is used.

Returns