### start() Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiAnimatedImage.html Starts the animation playback for the GuiAnimatedImage component. ```APIDOC ## start() ### Description Starts the animation playback for the AnimatedImage component. ### Declaration Swift ```swift @objc public func start() ``` ``` -------------------------------- ### Create and Animate InfoWindow with DropEffect Source: https://apis.map.kakao.com/ios_v2/docs/map/11_animation This example shows how to create an InfoWindow animator with a DropAnimationEffect. It retrieves an existing InfoWindow, configures the animator with a pixel height, duration, and repetition, adds the InfoWindow to the animator, and then starts the animation. ```swift //InfoWindow에 DropAnimation효과를 주기 위해 Animator를 생성한다. func createInfoWindowAnimator() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getGuiManager() // 생성한 InfoWindow를 가져온다. let infoWindow = manager.getGui(guiName: "infoWindow") as! InfoWindow // InfoWindow Animator 생성. DropAnimationEffect를 적용한다. let animator = manager.addInfoWindowAnimator(animatorID: "drop_animator", interpolation: AnimationInterpolation(duration: 1000, repeat: 1, method: .cubinIn), effect: DropAnimationEffect(pixelHeight: 800), hideAtStop: false) animator?.addInfoWindow(infoWindow) // animator에 InfoWindow를 추가한다. animator?.start() // animator 시작. animator에 들어가있는 InfoWindow에 애니메이션 효과가 적용된다. } ``` -------------------------------- ### Start Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/InfoWindowAnimator.html Starts the animator. If no InfoWindows are added, this function does not execute. After calling start, InfoWindows cannot be added or removed until stop is called. If you need to add more InfoWindows, call stop first. InfoWindows are cleared after the animation finishes, requiring InfoWindows to be re-added for subsequent starts. Actions like move on the InfoWindow interface are paused when the animator starts. ```swift public func start() ``` -------------------------------- ### Start Animation Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiAnimatedImage.html Starts the animation playback for the GuiAnimatedImage component. ```swift @objc public func start() ``` -------------------------------- ### createMapPolygonShape Example Source: https://apis.map.kakao.com/ios_v2/docs/map/06_shape/02_mappolygonshape Example of how to create a MapPolygonShape using MapPolygonShapeOptions and add it to a ShapeLayer. ```APIDOC ## Example: Creating a MapPolygonShape This example demonstrates how to create a MapPolygonShape with specified options and add it to a map. ```swift func createMapPolygonShape() { let mapView: KakaoMap = mapController?.getView("mapview") as! KakaoMap let manager = mapView.getShapeManager() // Create shapeLayer let layer = manager.addShapeLayer(layerID: "shape", zOrder: 10001) // Create MapPolygonShapeOptions for creating MapPolygonShape let options = MapPolygonShapeOptions(shapeID: "mapPolygonShape", styleID: "ShapeStyle", zOrder: 1) // MapPolygon is made up of WGS84 coordinates (latitude, longitude) let polygon = MapPolygon(exteriorRing: [ MapPoint(longitude: 127.10656, latitude: 37.40303), MapPoint(longitude: 127.10655, latitude: 37.40301), MapPoint(longitude: 127.10660, latitude: 37.40247), MapPoint(longitude: 127.10938, latitude: 37.40249), MapPoint(longitude: 127.10946, latitude: 37.40253), MapPoint(longitude: 127.10945, latitude: 37.40298) ], hole: nil, styleIndex: 0) options.polygons.append(polygon) let shape = layer?.addMapPolygonShape(options) shape?.show() } ``` ``` -------------------------------- ### Run Route Animation Source: https://apis.map.kakao.com/ios_v2/docs/map/07_route Starts the previously created route animations. It assigns routes to the animators and then calls the start method on each animator to begin the progress visualization. ```swift func runAnimation() { let mapView = mapController?.getView("mapview") as? KakaoMap let manager = mapView?.getRouteManager() let animator1 = manager?.getRouteAnimator(animatorID: "routeAnimator1") let animator2 = manager?.getRouteAnimator(animatorID: "routeAnimator2") let fgRoutes = manager?.getRouteLayer(layerID: "RouteLayer")?.getRoute(routeID: "fgRoutes") let bgRoutes = manager?.getRouteLayer(layerID: "RouteLayer")?.getRoute(routeID: "bgRoutes") animator1?.addRoute(fgRoutes!) animator2?.addRoute(bgRoutes!) animator1?.start() animator2?.start() } ``` -------------------------------- ### Get Directions (Car) Source: https://apis.map.kakao.com/ios_v2/docs/getting-started/urlscheme Opens Kakao Map to provide directions between a start point ('sp') and an end point ('ep') using a car as the mode of transport ('by=car'). ```url kakaomap://route?sp=37.39529,127.11044&ep=37.49795,127.02763&by=car ``` ```url http://m.map.kakao.com/scheme/route?sp=37.39529,127.11044&ep=37.49795,127.02763&by=car ``` -------------------------------- ### Get Route Point Info on Route Source: https://apis.map.kakao.com/ios_v2/references/Classes/Route.html Retrieves the position and direction on the route line corresponding to a specified progress value. Progress is measured from the start point to the end point. ```swift public func getRoutePointInfoOnRoute(progress: Float) -> RoutePointInfo? ``` -------------------------------- ### Create RouteStyleSet with Patterns and Styles Source: https://apis.map.kakao.com/ios_v2/docs/map/07_route This example demonstrates creating a RouteStyleSet with multiple RoutePatterns and RouteStyles. It shows how to add patterns with specified distances and symbols, and then define styles with varying widths, colors, stroke widths, stroke colors, and pattern indices. Use this to define complex route appearances. ```swift // RouteStyleSet을 생성한다. func createRouteStyleSet() { let mapView = mapController?.getView("mapview") as? KakaoMap let manager = mapView?.getRouteManager() let _ = manager?.addRouteLayer(layerID: "RouteLayer", zOrder: 0) let patternImages = [UIImage(named: "route_pattern_arrow.png"), UIImage(named: "route_pattern_walk.png"), UIImage(named: "route_pattern_long_dot.png")] // StyleSet에 pattern을 추가한다. let styleSet = RouteStyleSet(styleID: "routeStyleSet1") styleSet.addPattern(RoutePattern(pattern: patternImages[0]!, distance: 60, symbol: nil, pinStart: false, pinEnd: false)) styleSet.addPattern(RoutePattern(pattern: patternImages[1]!, distance: 6, symbol: nil, pinStart: true, pinEnd: true)) styleSet.addPattern(RoutePattern(pattern: patternImages[2]!, distance: 6, symbol: UIImage(named: "route_pattern_long_airplane.png")!, pinStart: true, pinEnd: true)) let colors = [ UIColor(hex: 0x7796ffff), UIColor(hex: 0x343434ff), UIColor(hex: 0x3396ff00), UIColor(hex: 0xee63ae00) ] let strokeColors = [ UIColor(hex: 0xffffffff), UIColor(hex: 0xffffffff), UIColor(hex: 0xffffff00), UIColor(hex: 0xffffff00) ] let patternIndex = [-1, 0, 1, 2] // 총 4개의 스타일을 생성한다. for index in 0 ..< colors.count { let routeStyle = RouteStyle() // 각 스타일은 1개의 표출 시작 레벨 = 0 인 PerLevelStyle을 갖는다. 즉, 전 레벨에서 동일하게 표출된다. // Style의 패턴인덱스가 -1로 지정되는 경우, 패턴을 사용하지 않고 컬러만 사용한다. routeStyle.addPerLevelStyle(PerLevelRouteStyle(width: 18, color: colors[index], strokeWidth: 4, strokeColor: strokeColors[index], level: 0, patternIndex: patternIndex[index])) styleSet.addStyle(routeStyle) } manager?.addRouteStyleSet(styleSet) } ``` -------------------------------- ### InfoWindow Initialization Source: https://apis.map.kakao.com/ios_v2/references/Classes/InfoWindow.html Initializes a new InfoWindow with a given name. ```APIDOC ## InfoWindow(_:) ### Description Initializes a new InfoWindow instance. ### Declaration Swift ```swift @objc public init(_ name: String) ``` ### Parameters - `_ name` (String) - The name of the InfoWindow. ``` -------------------------------- ### Create and Add SpriteGUI using GuiManager Source: https://apis.map.kakao.com/ios_v2/docs/map/05_gui/03_spritegui This example shows how to create a SpriteGui, configure its layout and properties, add child components like buttons, and then add it to the map using the GuiManager. The SpriteGui will only be visible after being added via GuiManager and calling show(). ```swift func createSpriteGUI() { let mapView = mapController?.getView("mapview") as! KakaoMap let guiManager = mapView.getGuiManager() let spriteGui = SpriteGui("testSprite") //SpriteGui를 만듬. SpriteGui는 화면좌표상의 특정지점에 고정되는 GUI이다. 구성방법은 InfoWindow와 동일하다. // spriteGui mainLayout property 변경 spriteGui.arrangement = .horizontal // 배치 방향 spriteGui.bgColor = UIColor.clear // 배경 색깔 spriteGui.splitLineColor = UIColor.white //구분선 컬러 // spriteGui property spriteGui.origin = GuiAlignment(vAlign: .top, hAlign: .center ) //화면의 우하단으로 배치 spriteGui.position = GuiOffset(x: 80, y: 200) let button1 = GuiButton("button1") button1.image = UIImage(named: "track_location_btn.png") let button2 = GuiButton("button2") button2.image = UIImage(named: "tile.png") spriteGui.addChild(button1) spriteGui.addChild(button2) // 아래의 guiManager를 통해 addGui를 하고난 이후에 SpriteGui의 show()/hide() 함수들이 동작한다. // 추가하기 전에는 show()를 호출해도 아무것도 표시되지 않는다. let _ = guiManager.addGui(spriteGui) spriteGui.delegate = self spriteGui.show() } ``` -------------------------------- ### Get Directions (Foot) with Waypoint Source: https://apis.map.kakao.com/ios_v2/docs/getting-started/urlscheme Opens Kakao Map to calculate walking directions from a start point ('sp') to an end point ('ep'), including a waypoint ('vp'). Note that public transit does not support waypoints. ```url kakaomap://route?sp=37.40205,127.10821&vp=37.39424,127.11030&ep=37.39529,127.11044&by=foot ``` ```url http://m.map.kakao.com/scheme/route?sp=37.40205,127.10821&vp=37.39424,127.11030&ep=37.39529,127.11044&by=foot ``` -------------------------------- ### Get Progress Along Route Line Source: https://apis.map.kakao.com/ios_v2/references/Classes/Route.html Calculates the progress along the route line for a given position. If the position is not exactly on the line, it finds the nearest point on the line to determine the progress. Progress is measured from the start point to the end point. ```swift @objc public func getProgressAlongRouteLine(position: MapPoint) -> Float ``` -------------------------------- ### Initialize Kakao Maps SDK with KAKAO_APP_KEY Source: https://apis.map.kakao.com/ios_v2/docs/getting-started/basics/02_auth Use the SDKInitializer.InitSDK() function to add your KAKAO_APP_KEY to the app. This function must be called before the engine starts. ```swift SDKInitializer.InitSDK("YOUR_KAKAO_APP_KEY") ``` -------------------------------- ### Create and Display InfoWindow Source: https://apis.map.kakao.com/ios_v2/docs/map/05_gui/04_infowindow This snippet demonstrates how to create an InfoWindow with custom body and tail images, add child components like buttons and text to the body, set its position, and display it on the map. It also shows how to update the InfoWindow's position in response to a GUI event. ```swift // 컴포넌트를 구성하여 InfoWindow를 생성한다. func createInfoWindow() { let view = mapController?.getView("mapview") as! KakaoMap let infoWindow = InfoWindow("infoWindow"); // bodyImage let bodyImage = GuiImage("bgImage") bodyImage.image = UIImage(named: "white_black_round10.png") bodyImage.imageStretch = GuiEdgeInsets(top: 9, left: 9, bottom: 9, right: 9) // tailImage let tailImage = GuiImage("tailImage") tailImage.image = UIImage(named: "white_black.png") //bodyImage의 child로 들어갈 layout. let layout: GuiLayout = GuiLayout("layout") layout.arrangement = .horizontal //가로배치 let button1: GuiButton = GuiButton("button1") button1.image = UIImage(named: "noti.png")! let text = GuiText("text") let style = TextStyle() style.fontSize = 20 text.addText(text: "안녕하세요~", style: style) //Text의 정렬. Layout의 크기는 child component들의 크기를 모두 합친 크기가 되는데, Layout상의 배치에 따라 공간의 여분이 있는 component는 align을 지정할 수 있다. text.align = GuiAlignment(vAlign: .middle, hAlign: .left) // 좌중단 정렬. bodyImage.child = layout infoWindow.body = bodyImage infoWindow.tail = tailImage infoWindow.bodyOffset.y = -10 layout.addChild(button1) layout.addChild(text) infoWindow.position = MapPoint(longitude: 126.978365, latitude: 37.566691) infoWindow.delegate = self let guiManager = view.getGuiManager() let _ = guiManager.addGui(infoWindow) infoWindow.show() } // 버튼이 클릭될 때 발생 func guiDidTapped(_ gui: KakaoMapsSDK.GuiBase, componentName: String) { print("Gui: \(gui.name), Component: \(componentName) tapped") // InfoWindow의 position을 업데이트한다. (gui as? InfoWindow)?.position = MapPoint(longitude: 126.996, latitude: 37.533) } ``` -------------------------------- ### InfoWindow Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/InfoWindow.html Initializes an InfoWindow with a given name. This is the primary way to create an InfoWindow instance. ```swift @objc public init(_ name: String) ``` -------------------------------- ### Create and Style WaveText Labels Source: https://apis.map.kakao.com/ios_v2/docs/map/04_label/04_wavetext This snippet demonstrates the setup required for WaveText, including creating a label layer, defining multiple styles that change based on zoom level, and adding a WaveText with initial text and style. ```swift // WaveText 생성을 위해 LabelLayer를 생성한다. func createLabelLayer() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getLabelManager() let layerOption = LabelLayerOptions(layerID: "WaveTextLayer", competitionType: .none, competitionUnit: .poi, orderType: .rank, zOrder: 0) let _ = manager.addLabelLayer(option: layerOption) } // WaveText가 처음 표시될 때 사용할 style 생성 func createWaveTextStyle() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getLabelManager() let perLevelStyle1 = PerLevelWaveTextStyle(textStyle: TextStyle(fontSize: 15, fontColor: UIColor.white, strokeThickness: 2, strokeColor: UIColor.red), level: 10) let perLevelStyle2 = PerLevelWaveTextStyle(textStyle: TextStyle(fontSize: 20, fontColor: UIColor.white, strokeThickness: 4, strokeColor: UIColor.blue), level: 15) let waveTextStyle = WaveTextStyle(styleID: "perLevelWaveTextStyle", styles:[perLevelStyle1, perLevelStyle2]) manager.addWaveTextStyle(waveTextStyle) } // 버튼이 클릭되면 변경할 WaveTextStyle 생성 func createChangedWaveTextStyle() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getLabelManager() let perLevelStyle1 = PerLevelWaveTextStyle(textStyle: TextStyle(fontSize: 15, fontColor: UIColor.white, strokeThickness: 2, strokeColor: UIColor.blue), level: 10) let perLevelStyle2 = PerLevelWaveTextStyle(textStyle: TextStyle(fontSize: 20, fontColor: UIColor.white, strokeThickness: 4, strokeColor: UIColor.red), level: 15) let waveTextStyle = WaveTextStyle(styleID: "perLevelWaveTextStyle2", styles: [perLevelStyle1, perLevelStyle2]) manager.addWaveTextStyle(waveTextStyle) } // WaveText 생성 func createWaveText() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getLabelManager() let layer = manager.getLabelLayer(layerID: "WaveTextLayer") let options = WaveTextOptions(styleID: "perLevelWaveTextStyle", waveTextID: "waveText1") options.rank = 0 options.text = "흐르는 글씨" // 그려질 경로의 point들을 지정. options.points = [MapPoint(longitude: 127.027401, latitude: 37.498469), MapPoint(longitude: 127.027511, latitude: 37.498367), MapPoint(longitude: 127.02768, latitude: 37.498254), MapPoint(longitude: 127.027882, latitude: 37.498195), MapPoint(longitude: 127.028052, latitude: 37.498165)] let waveText = layer?.addWaveText(options) waveText?.show() } ``` -------------------------------- ### Is Animator Started Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/InfoWindowAnimator.html A read-only boolean property indicating whether the animator has been started. ```swift public var isStart: Bool { get } ``` -------------------------------- ### Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/CameraTransform.html Initializes a new instance of CameraTransform with default values. ```APIDOC ## init() ### Description Initializes a new instance of CameraTransform. ### Declaration Swift ```swift public override init() ``` ``` -------------------------------- ### Add PolylineShape to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds a PolylineShape to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addPolylineShape(_ shape: PolylineShape) ``` -------------------------------- ### Create SpriteGUI with 9-patch GuiImage Source: https://apis.map.kakao.com/ios_v2/docs/map/05_gui/02_gui-components This example demonstrates how to create a SpriteGui and add a GuiImage component to it. The GuiImage is configured to use 9-patch resizing and includes a GuiText component as its child. ```swift func createSpriteGUI() { let mapView = mapController?.getView("mapview") as! KakaoMap let guiManager = mapView.getGuiManager() let spriteGui = SpriteGui("testSprite") //SpriteGui를 만듬. spriteGui.origin = GuiAlignment(vAlign: .middle, hAlign: .center) // 9-patch 형태로 사용할 GuiImage Component 생성 let bgImage = GuiImage("bgImage") bgImage.image = UIImage(named: "white_black_round10.png") bgImage.imageStretch = GuiEdgeInsets(top: 9, left: 9, bottom: 9, right: 9) // GuiImage의 child로 설정할 GuiText Component 생성 let text = GuiText("text") text.addText(text: "안녕하세요~", style: TextStyle(fontSize: 20, fontColor: UIColor.white, strokeThickness: 2, strokeColor: UIColor.blue)) // GuiText를 GuiImage의 child component로 설정한다. bgImage.child = text // SpriteGui에 GuiImage 컴포넌트 추가. spriteGui.addChild(bgImage) let _ = guiManager.addGui(spriteGui) spriteGui.delegate = self spriteGui.show() } ``` -------------------------------- ### Add MapPolylineShape to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds a MapPolylineShape to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addMapPolylineShape(_ shape: MapPolylineShape) ``` -------------------------------- ### Initialize WaveTextOptions with Style and WaveText IDs Source: https://apis.map.kakao.com/ios_v2/references/Classes/WaveTextOptions.html Use this initializer to create WaveTextOptions with both a specified style ID and a WaveText ID. If no WaveText ID is provided, one will be automatically assigned. ```swift @objc public init(styleID: String, waveTextID: String) ``` -------------------------------- ### Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/WaveTextStyle.html Initializes a new WaveTextStyle with a unique style ID and an array of PerLevelWaveTextStyle objects. ```APIDOC ## Initializer ### Description Initializes a new WaveTextStyle with a unique style ID and an array of PerLevelWaveTextStyle objects. ### Declaration Swift ```swift @objc public init(styleID: String, styles: [PerLevelWaveTextStyle]) ``` ### Parameters - **styleID** (String) - Required - The ID for the WaveTextStyle. - **styles** ([PerLevelWaveTextStyle]) - Required - An array of PerLevelWaveTextStyle objects that define the styles for each level. ``` -------------------------------- ### Add PolygonShape to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds a PolygonShape to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addPolygonShape(_ shape: PolygonShape) ``` -------------------------------- ### Add MapPolygonShape to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds a MapPolygonShape to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addMapPolygonShape(_ shape: MapPolygonShape) ``` -------------------------------- ### Add Single Poi to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/PoiAnimator.html Adds a single Poi object to the animator. Poi objects can only be added before `start()` is called or after `stop()` has been called and before the next `start()`. ```swift @objc public func addPoi(_ poi: Poi) ``` -------------------------------- ### Create SpriteGui with GuiLayout Source: https://apis.map.kakao.com/ios_v2/docs/map/05_gui/02_gui-components Demonstrates using GuiLayout within a SpriteGui to arrange multiple image components horizontally. Properties like arrangement, split lines, and background color can be configured. ```swift func createSpriteGUI() { let mapView = mapController?.getView("mapview") as! KakaoMap let guiManager = mapView.getGuiManager() let spriteGui = SpriteGui("testSprite") //SpriteGui를 만듬. spriteGui.origin = GuiAlignment(vAlign: .middle, hAlign: .center) spriteGui.showSplitLine = true // layout내의 컴포넌트 구분선을 추가한다. spriteGui.arrangement = .horizontal // layout내의 컴포넌트 배치 방향을 수평으로 설정. 컴포넌트가 수평 방향으로 차례대로 쌓인다. spriteGui.bgColor = UIColor.white // layout의 배경 컬러값을 white로 설정. // 첫번째 이미지 컴포넌트 let image1 = GuiImage("image1") image1.image = UIImage(named: "noti.png") // 두번째 이미지 컴포넌트 let image2 = GuiImage("image2") image2.image = UIImage(named: "noti2.png") // 세번째 이미지 컴포넌트 let image3 = GuiImage("image3") image3.image = UIImage(named: "noti3.png") spriteGui.addChild(image1) spriteGui.addChild(image2) spriteGui.addChild(image3) let _ = guiManager.addGui(spriteGui) spriteGui.delegate = self spriteGui.show() } ``` -------------------------------- ### Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/KMController.html Initializes a new instance of KMController. The designated initializer requires a KMViewContainer. ```APIDOC ## Initializer ### Designated Initializer * `- initWithViewContainer:` Initializes a new instance of KMController with the specified view container. #### Declaration Objective-C ``` - (instancetype _Nonnull)initWithViewContainer: (KMViewContainer *_Nonnull)viewContainer; ``` Swift ``` init(viewContainer: KMViewContainer) ``` #### Return Value KMController ``` -------------------------------- ### Add Multiple PolylineShapes to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds an array of PolylineShapes to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addPolylineShapes(_ shapes: [PolylineShape]) ``` -------------------------------- ### Add Multiple MapPolylineShapes to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds an array of MapPolylineShapes to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addMapPolylineShapes(_ shapes: [MapPolylineShape]) ``` -------------------------------- ### Create WaveText with Options Source: https://apis.map.kakao.com/ios_v2/docs/map/04_label/04_wavetext Instantiate WaveTextOptions and set properties like styleID, rank, text, and points to define the appearance and path of the WaveText. This options object is then passed to the addWaveText method of a LabelLayer to create the WaveText object. ```swift let options = WaveTextOptions(styleID: "perLevelWaveTextStyle") options.rank = 0 options.text = "흐르는 글씨" // 그려질 경로의 point들을 지정. options.points = [MapPoint(longitude: 127.027401, latitude: 37.498469), MapPoint(longitude: 127.027511, latitude: 37.498367), MapPoint(longitude: 127.02768, latitude: 37.498254), MapPoint(longitude: 127.027882, latitude: 37.498195), MapPoint(longitude: 127.028052, latitude: 37.498165)] let waveText = layer?.addWaveText(options) ``` -------------------------------- ### Add Multiple PolygonShapes to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds an array of PolygonShapes to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addPolygonShapes(_ shapes: [PolygonShape]) ``` -------------------------------- ### Prepare Engine Source: https://apis.map.kakao.com/ios_v2/references/Classes/KMController.html Prepares the engine for rendering. Calls addViews on MapControllerDelegate when rendering is complete. ```Objective-C - (BOOL)prepareEngine; ``` ```Swift func prepareEngine() -> Bool ``` -------------------------------- ### Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/SpriteGui.html Initializes a new instance of the SpriteGui class. If no layout is specified, a vertical layout is used by default. ```APIDOC ## init(_:) ### Description Initializes a new instance of the SpriteGui class. By default, the main layout is set to a vertical layout if not specified otherwise. ### Declaration Swift ```swift @objc public init(_ name: String) ``` ### Parameters - `_ name` (String) - The name of the Gui. ``` -------------------------------- ### Add Multiple MapPolygonShapes to Animator Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeAnimator.html Adds an array of MapPolygonShapes to the animator. Shapes can only be added before start() is called. After start() is invoked, shapes cannot be added until the animation completes or stop() is called. ```swift @objc public func addMapPolygonShapes(_ shapes: [MapPolygonShape]) ``` -------------------------------- ### Type Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiComponentBase.html Gets the type of the GuiComponent. ```swift @objc internal(set) public var type: GuiComponentType { get set } ``` -------------------------------- ### Initializer with styleID Source: https://apis.map.kakao.com/ios_v2/references/Classes/WaveTextOptions.html Initializes WaveTextOptions with a specified style ID. ```APIDOC ## Initializer with styleID ### Description Initializes WaveTextOptions with a specified style ID. ### Parameters - **styleID** (String) - Required - The ID of the WaveTextStyle to use. ``` -------------------------------- ### cameraHeight Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets the current camera height in meters. ```APIDOC ## cameraHeight ### Description 현재 카메라 높이(m)를 가져온다. ### Property Type `Double` ``` -------------------------------- ### Initialize WaveTextOptions with Style ID Source: https://apis.map.kakao.com/ios_v2/references/Classes/WaveTextOptions.html Use this initializer to create WaveTextOptions with a specified style ID. The WaveText ID will be automatically assigned. ```swift @objc public required init(styleID: String) ``` -------------------------------- ### Enable ProMotion Support Source: https://apis.map.kakao.com/ios_v2/docs/getting-started/basics/01_view Set `proMotionSupport` to `true` on `KMController` to enable ProMotion Display for up to 120Hz frame rates. This is false by default. Ensure the device supports ProMotion. ```swift mapController = KMController(viewContainer: mapContainer!)! mapController?.proMotionSupport = true; ``` -------------------------------- ### isFocused Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets the current focus state of the map. ```APIDOC ## isFocused ### Description Retrieves the current focus state of the KakaoMap. ### Property `isFocused: Bool` ``` -------------------------------- ### zoomLevel Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets the current zoom level of the map. ```APIDOC ## zoomLevel ### Description Retrieves the current zoom level of the KakaoMap. ### Property `zoomLevel: Int` ``` -------------------------------- ### Create and Handle GuiButton Clicks Source: https://apis.map.kakao.com/ios_v2/docs/map/05_gui/02_gui-components This example demonstrates how to create a SpriteGui containing two GuiButtons, add them to the map view, and handle their click events using the GuiEventDelegate. Ensure the delegate is set to 'self' to receive tap events. ```swift func createSpriteGUI() { let mapView = mapController?.getView("mapview") as! KakaoMap let guiManager = mapView.getGuiManager() let spriteGui = SpriteGui("testSprite") //SpriteGui를 만듬. spriteGui.arrangement = .horizontal spriteGui.bgColor = UIColor.clear spriteGui.splitLineColor = UIColor.white spriteGui.origin = GuiAlignment(vAlign: .bottom, hAlign: .right) //화면의 우하단으로 배치 // 버튼 두개 생성 let button1 = GuiButton("button1") button1.image = UIImage(named: "track_location_btn.png") let button2 = GuiButton("button2") button2.image = UIImage(named: "tile.png") spriteGui.addChild(button1) spriteGui.addChild(button2) let _ = guiManager.addGui(spriteGui) // gui event의 delegate를 지정한다. spriteGui.delegate = self spriteGui.show() } // GuiButton이 클릭되면 아래 delegate를 호출한다. func guiDidTapped(_ gui: KakaoMapsSDK.GuiBase, componentName: String) { // 클릭된 gui 객체와 클릭된 컴포넌트의 name을 이벤트로 전달한다. print("Gui: \(gui.name), Component: \(componentName) tapped") if componentName == "button1" { //do something } if componentName == "button2" { //do something } } ``` -------------------------------- ### shapeID Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/MapPolylineShapeOptions.html Gets or sets the ID of the Shape. ```APIDOC ## shapeID Property ### Description Gets or sets the ID of the Shape. ### Declaration Swift ```swift @objc public internal(set) var shapeID: String? { get set } ``` ``` -------------------------------- ### GuiAnimatedImage Initialization Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiAnimatedImage.html Initializes a new GuiAnimatedImage component with a specified component ID. ```APIDOC ## GuiAnimatedImage(_:) ### Description Initializes a new GuiAnimatedImage component. ### Declaration Swift ```swift @objc public init(_ componentId: String) ``` ### Parameters - `_componentId_` (String) - Component ID ``` -------------------------------- ### Initialize TextStyle with Font Size and Color Source: https://apis.map.kakao.com/ios_v2/references/Classes/TextStyle.html Use this convenience initializer to create a TextStyle object with only the essential font size and font color specified. Other properties will use their default values. ```swift @objc public convenience init(fontSize: UInt, fontColor: UIColor) ``` -------------------------------- ### maxLevel Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets the maximum zoom level allowed for the map. ```APIDOC ## maxLevel ### Description Retrieves the maximum zoom level supported by the KakaoMap configuration. ### Property `maxLevel: Int` ``` -------------------------------- ### GuiText Initialization Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiText.html Initializes a GuiText component with a unique component ID. ```APIDOC ## GuiText Initialization ### Description Initializes a GuiText component with a unique component ID. ### Method `init(_:)` ### Parameters - `_componentId` (String) - The componentId for the GuiText. ``` -------------------------------- ### minLevel Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets the minimum zoom level allowed for the map. ```APIDOC ## minLevel ### Description Retrieves the minimum zoom level supported by the KakaoMap configuration. ### Property `minLevel: Int` ``` -------------------------------- ### Get all PolygonShapes Source: https://apis.map.kakao.com/ios_v2/references/Classes/DimScreen.html Retrieves all PolygonShapes currently added to the DimScreen. ```swift @objc open func getAllHighlightPolygonShapes() -> [PolygonShape]? ``` -------------------------------- ### Convenience TextStyle Initializer Source: https://apis.map.kakao.com/ios_v2/references/Classes/TextStyle.html A convenience initializer for TextStyle that only requires font size and font color. ```APIDOC ## Convenience Initializer ### Description A convenience initializer for TextStyle that only requires font size and font color. ### Declaration Swift ```swift @objc public convenience init(fontSize: UInt, fontColor: UIColor) ``` ### Parameters - **fontSize** (UInt) - font 크기 - **fontColor** (UIColor) - font 컬러 ``` -------------------------------- ### Component ID Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiComponentBase.html Gets the unique identifier for the GuiComponent. ```swift @objc internal(set) public var componentId: String { get set } ``` -------------------------------- ### Initializer with Deltas Source: https://apis.map.kakao.com/ios_v2/references/Classes/CameraTransform.html Initializes a new instance of CameraTransform with specified changes in position, height, rotation, and tilt. ```APIDOC ## init(deltaPos:deltaHeight:deltaRotation:deltaTilt:) ### Description Initializes a new instance of CameraTransform with specified changes. ### Declaration Swift ```swift @objc required public init(deltaPos: CameraTransformDelta, deltaHeight: Double, deltaRotation: Double, deltaTilt: Double) ``` ### Parameters - **deltaPos** (CameraTransformDelta) - 카메라가 바라보는 위치 변화량 - **deltaHeight** (Double) - 카메라 높이 변화량 - **deltaRotation** (Double) - 카메라 회전각 변화량 - **deltaTilt** (Double) - 카메라 기울임각 변화량 ``` -------------------------------- ### Adding POIs with PoiOptions Source: https://apis.map.kakao.com/ios_v2/docs/map/04_label/02_poi Demonstrates how to create a POI using PoiOptions and add it to a LabelLayer. It also outlines the different `addPoi(s)` methods available for adding single or multiple POIs. ```APIDOC ## Adding POIs POIs are added to a LabelLayer using the `addPoi(s)` methods provided by the LabelManager. It is recommended to use these methods with `PoiOptions` to receive internally generated POI objects. ### Example: Creating a single POI ```swift // Create a PoiOptions object with a specific style and ID let poiOption = PoiOptions(styleID: "customStyle1", poiID: "poi1") // Add the POI to the layer at a specific map point let poi1 = layer?.addPoi(option: poiOption, at: MapPoint(longitude: 127.108678, latitude: 37.402001)) ``` ### Available `addPoi(s)` methods: - `addPoi(option:at:) -> Poi`: Use this to create a single POI. - `addPois(option:at:) -> [Poi]`: Use this to create multiple POIs with the same options but at different locations. - `addPois(options:at:) -> [Poi]`: Use this to create multiple POIs with different options. The number of options must match the number of locations. #### Recommendation For adding multiple POIs, it is recommended to use the `addPois` interfaces rather than calling `addPoi` multiple times to improve efficiency. ``` -------------------------------- ### images Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/GuiAnimatedImage.html Gets the array of images used in the animation. ```APIDOC ## images ### Description Gets the images that constitute the animation. ### Declaration Swift ```swift @objc open var images: [UIImage] { get } ``` ``` -------------------------------- ### Get All MapPolygonShapes from Layer Source: https://apis.map.kakao.com/ios_v2/references/Classes/ShapeLayer.html Retrieves all MapPolygonShapes currently present in the layer. ```Swift @objc public func getAllMapPolygonShapes() -> [MapPolygonShape]? ``` -------------------------------- ### Open Kakao Map App Source: https://apis.map.kakao.com/ios_v2/docs/getting-started/urlscheme Use this scheme to launch the Kakao Map app. The 'open' action is the most basic way to start the app. ```url kakaomap://open ``` ```url http://m.map.kakao.com/scheme/open ``` -------------------------------- ### Initializer for ZoneLinkInfo with Zone and Detail IDs Source: https://apis.map.kakao.com/ios_v2/references/Classes/ZoneLinkInfo.html Initializes a ZoneLinkInfo object with the ID of a connected zone and its detail ID. Use this when a part of another zone is connected. ```swift @objc public convenience init(zoneId: String, detailId: String) ``` -------------------------------- ### cameraMaxLevel Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets or sets the maximum zoom level for camera movement. ```APIDOC ## cameraMaxLevel ### Description Sets or gets the maximum zoom level the camera can move to. Values outside the range of `minLevel` to `maxLevel` are ignored. This value must be greater than or equal to `cameraMinLevel`. ### Property `cameraMaxLevel: Int` ``` -------------------------------- ### cameraMinLevel Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets or sets the minimum zoom level for camera movement. ```APIDOC ## cameraMinLevel ### Description Sets or gets the minimum zoom level the camera can move to. Values outside the range of `minLevel` to `maxLevel` are ignored. This value must be less than or equal to `cameraMaxLevel`. ### Property `cameraMinLevel: Int` ``` -------------------------------- ### Creating WaveText with Options Source: https://apis.map.kakao.com/ios_v2/docs/map/04_label/04_wavetext WaveText cannot be created directly. Instead, it is generated internally when you call `addWaveText` on a LabelLayer and pass `WaveTextOptions`. This example shows how to initialize `WaveTextOptions` with various properties and then add the WaveText to a layer. ```APIDOC ## Creating WaveText WaveText is not created directly by the user. It is generated internally by the API when `addWaveText` is called on a `LabelLayer` with `WaveTextOptions`. ### Method Signature ```swift func addWaveText(_ options: WaveTextOptions) -> WaveText? ``` ### Parameters #### `WaveTextOptions` Properties - **ID** (string) - Unique ID for the WaveText within the same Layer. Cannot be duplicated within a Layer. - **styleID** (string) - Required. The ID of the `WaveTextStyle` to use for displaying the WaveText. The style must be added beforehand. - **rank** (integer) - The rendering priority of the WaveText. - **text** (string) - The text to be displayed in the WaveText. - **points** (Array) - Required. An array of at least two `MapPoint` objects that define the path along which the text will be drawn. ### Request Example ```swift let options = WaveTextOptions(styleID: "perLevelWaveTextStyle") options.rank = 0 options.text = "흐르는 글씨" // Specify the points for the path to be drawn. options.points = [MapPoint(longitude: 127.027401, latitude: 37.498469), MapPoint(longitude: 127.027511, latitude: 37.498367), MapPoint(longitude: 127.02768, latitude: 37.498254), MapPoint(longitude: 127.027882, latitude: 37.498195), MapPoint(longitude: 127.028052, latitude: 37.498165)] let waveText = layer?.addWaveText(options) ``` ### Response - **WaveText** - The created WaveText object, or nil if creation failed. ``` -------------------------------- ### poiClickable Source: https://apis.map.kakao.com/ios_v2/references/Classes/KakaoMap.html Gets or sets whether the default POIs on the map are clickable. ```APIDOC ## poiClickable ### Description Controls the clickability of default POIs (not POIs added via API) on the map. ### Property `poiClickable: Bool` ``` -------------------------------- ### Initializer with styleID and waveTextID Source: https://apis.map.kakao.com/ios_v2/references/Classes/WaveTextOptions.html Initializes WaveTextOptions with a specified style ID and an optional WaveText ID. ```APIDOC ## Initializer with styleID and waveTextID ### Description Initializes WaveTextOptions with a specified style ID and an optional WaveText ID. If waveTextID is not provided, it will be automatically assigned. ### Parameters - **styleID** (String) - Required - The ID of the WaveTextStyle to use. - **waveTextID** (String) - Optional - The ID for the WaveText. If not specified, it will be automatically assigned. ``` -------------------------------- ### Orientation Property Source: https://apis.map.kakao.com/ios_v2/references/Classes/MapPolygonShape.html Gets or sets the current orientation of the polygon shape. ```APIDOC ## orientation ### Description The current orientation value of the PolygonShape. Assigning a new orientation value will change the PolygonShape's orientation. ### Declaration Swift ```swift public var orientation: Double { get set } ``` ``` -------------------------------- ### Create Label Layer Source: https://apis.map.kakao.com/ios_v2/docs/map/04_label/02_poi Initializes a label layer for POIs. Ensure the map controller and view are accessible. ```swift func createLabelLayer() { let view = mapController?.getView("mapview") as! KakaoMap let manager = view.getLabelManager() let layerOption = LabelLayerOptions(layerID: "PoiLayer", competitionType: .none, competitionType: .none, competitionUnit: .symbolFirst, orderType: .rank, zOrder: 0) let _ = manager.addLabelLayer(option: layerOption) } ``` -------------------------------- ### Get Shape ID of MapPolygonShape Source: https://apis.map.kakao.com/ios_v2/references/Classes/MapPolygonShape.html Retrieves the unique identifier for the shape. ```swift public var shapeID: String { get } ```