[4.x] LongdoMap - MetamediaTechnology/longdo-map-demo-ios GitHub Wiki

public var apiKey: String

Description

Longdo Map API key.


public var server: String

Description

Longdo Map server URL.


public var options: LongdoMap.Option

Description

Initial Longdo Map setting.


public func ldstatic(_ type: String, with name: String) -> LDStatic

Description

      Create Longdo Map's static object.

Parameters

  • type Type of Longdo Map's object.
  • name Value of Longdo Map's object.

Return

      Longdo Map's static object.


public func ldobject(_ type: String, with params: [Any]) -> LDObject

Description

      Create Longdo Map's object.

Parameters

  • type Type of Longdo Map's object.
  • params Properties of Longdo Map's object. (See the type used.)

Return

      Longdo Map's object.


public func ldfunction(_ function: String) -> LDFunction

Description

      Create function in Javascript language to use with some Longdo Map’s method that needs function as parameter and has returned value.

Parameters

  • function Custom javascript function e.g. "z => (z * z + 1)" for tileMatrix when add layer.

Return

      LDFunction.


public func render()

Description

      Rendered Longdo Map view.


public func call(method: String, args: [Any]?) -> Any?

Description

      Call Longdo Map's method.

Parameters

  • method Longdo Map's method.
  • args Method's argument. (See the type used.)

Notes: For Event.bind method, you can use the third argument as boolean to decide whether to continue the default action or not. (By default the value is true.)

Return

      Method's result if available.

Example

let _ = map.call(method: "Event.bind", args: [
    map.ldstatic("EventName", with: "BeforeContextmenu"),
    {
        (result: Any?) -> Void in
        // ...
    },
    false
])

public func objectCall(ldobject: LDObject, method: String, args: [Any]?) -> Any?

Description

      Call Longdo Map object's method.

Parameters

  • ldobject Longdo Map's object.
  • method Longdo Map object's method.
  • args Method's argument. (See the type used.)

Return

      Method's result if available.