Skip to main content

method

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

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

camera

Camera used for position calculation.

geometry

Geometry object to be embedded into the screen area defined by the screen_area parameter.

styleZoomToTiltRelation

Dependence function of the camera tilt angle on the style scaling level.

screenArea

Screen area in which to embed the geometry. If not specified, camera padding is used for calculation.

tilt

Map tilt. If not set, the current camera tilt is used.

bearing

Map bearing. If not set, the current camera bearing is used.

size

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

Returns

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

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

camera

Camera used for position calculation.

objects

Map objects that must be embedded into the screen area defined by the screen_area parameter.

styleZoomToTiltRelation

Dependence function of the camera tilt angle on the style scaling level.

screenArea

Screen area in which to embed the geometry. If not specified, camera padding is used for calculation.

tilt

Camera tilt. If not specified, the current camera tilt in used.

bearing

Camera bearing. If not specified, the current camera bearing is used.

size

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

Returns

calculateClosestPoint(routeGeometry:point:)

public func calculateClosestPoint(
routeGeometry: GeoPointRouteAttribute,
point: GeoPoint
) -> RoutePoint?
Parameters

createDefaultMaxTiltRestriction()

public func createDefaultMaxTiltRestriction() -> StyleZoomToTiltRelation

createDefaultStyleZoomToTiltRelation()

public func createDefaultStyleZoomToTiltRelation() -> StyleZoomToTiltRelation

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

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:styleZoomToTiltRelation:size:)

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

camera

Camera used for position calculation.

geometry

Geometry object to be embedded into the screen area defined by camera paddings.

styleZoomToTiltRelation

Dependence function of the camera tilt angle on the style scaling level.

size

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

Returns

zoomOutToFit(camera:objects:styleZoomToTiltRelation:size:)

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

camera

Camera used for position calculation.

objects

Map objects that must be embedded into the screen area defined by internal camera paddings.

styleZoomToTiltRelation

Dependence function of the camera tilt angle on the style zoom level.

size

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

Returns