package com.awesomeproject3;

import android.content.Context;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;

public class TplMapsController extends ReactContextBaseJavaModule {
    private static final String MODULE_NAME = "MyModule";


    Context context;

    public TplMapsController(ReactApplicationContext reactContext) {
        super(reactContext);
    }

    public TplMapsController(ModuleCallback callback) {
        Constant.moduleCallback = callback;
    }

    @Override
    public String getName() {
        return MODULE_NAME;
    }

    @ReactMethod
    public void myMethod(String param) {
        Constant.moduleCallback.nativeModuleCalled(0,"myMethod");
    }

    @ReactMethod
    public void AddMarker(String lnglat){
        Constant.moduleCallback.nativeModuleCalled(1 , lnglat);
    }

    @ReactMethod
    public void AddCustomMarker(String lnglat){
        Constant.moduleCallback.nativeModuleCalled(3 , lnglat);
    }

    @ReactMethod
    public void SetCameraAnimation(String lnglat , String zoom){
        String lnglatAndZoom = lnglat+";"+zoom;
        Constant.moduleCallback.nativeModuleCalled(2 , lnglatAndZoom);
    }

    @ReactMethod
    public void CameraCallback(String message, Promise promise) {
        Constant.promise  = promise;
    }
}
