> Agents can also search and read this documentation through its [MCP server](https://nostramap-doc.fatos.biz/~gitbook/mcp).

# FATOS Developer Introduction

in collaboration with NostraMap

## **Build & Create with FATOS developers in collaboration with NostraMap!**&#x20;

Documents and examples to help you start building with FATOS. Increasing developer productivity is one of our major goals. This is direction we are pursuing to provide a convenient environment so that developers can create more valuable apps by focusing more on the core logic of the app.

FATOS SDK provides  NostraMap functions through various libraries so that you can implement the functions of the app platform. map data is also provided through API format. Create a variety of location-based services through SDK and API.

### To use FATOS API

{% content-ref url="/pages/-MLBq0pSxBBSvvTWyTz3" %}
[FATOS API](https://nostramap-doc.fatos.biz/fatos-api)
{% endcontent-ref %}

{% content-ref url="/pages/-MLBq0qMauzlD90hEzeg" %}
[Get your API Key](https://nostramap-doc.fatos.biz/get-your-api-key)
{% endcontent-ref %}

### To use FATOS SDK

{% content-ref url="/pages/-MLBq0q8Jj6DRTaILXBf" %}
[FATOS SDK](https://nostramap-doc.fatos.biz/fatos-sdk)
{% endcontent-ref %}


# FATOS API

Implement features with FATOS API!

FATOS APIs are divided into Basic and Advanced and consist of a total of 32.

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2Fca121a76557d8ad206096998dcc60304ce2be0c0.png?generation=1604385814913768\&alt=media)

The procedure for using the FATOS Map API using JavaScript is as follows.

The implementation uses JavaScript code to display the map on the html page, which consists of the following steps.

First, load the Maps API code libraries.\
Second, initialize a map object, displaying the map.


# Map

Everything about map and its properties

## Introduction

FATOS map is a JavaScript library that uses WebGL to rendering maps while interacting with users in a vector tile type.

To use "FATOS Map", you must request an API key and then apply that key to the source. If you want an API key, please go to [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz) and request an API key after sign up.

Please let us know if you have any technical problems using our SDK\
Contact : <sales@fatoscorp.com>

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MLH6n6_VG6AtuWHf1I1%2F-MLH7mgHlOqyDjv2tBZ3%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202020-11-04%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%204.22.52.png?alt=media\&token=c0f45739-2ee6-483c-9237-8514a7b4f144)

## Description

The map object represents a map of the screen. It provides methods and properties for programmatically changing the map and generating an event when an user interacts with it. Map instance creates a map by specifying containers and other options

| Name            | Description                                                                                                              | Optional |
| --------------- | ------------------------------------------------------------------------------------------------------------------------ | -------- |
| `zoom`          | The zoom value is the zoom in/out value of the map. Not the required input.                                              | `option` |
| `center`        | Center is coordinate value that will be displayed to the center at the first loading of the map and is a required input. | `must`   |
| `maxZoom`       | Maximum zoom value. Not required value.                                                                                  | `option` |
| `minZoom`       | Minimum zoom value. Not required value.                                                                                  | `option` |
| `key`           | Authentication value for map use. Required input value.                                                                  | `must`   |
| `zoomControl`   | The value of the button to adjust the zoom level value of the map. Not required value.                                   | `option` |
| `draggable`     | Whether the marker on the map can be moved to the desired location. Not required value.                                  | `option` |
| `rotateControl` | This option lets you interact with the rotation of the map by dragging it. Not required value.                           | `option` |
| `tilt`          | The slope of the map. The range from 0 to 60 and the initial value is zero(0).                                           | `option` |

## Example

```markup
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>FATOS Map</title>
</head>
<body>
<div style="height: 100vh;">
    <div id="app"></div>

</div>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>
    let LatLng = {lat: 1.28516, lng: 103.84738}
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY'
        }
    )
</script>
</body>
</html>
```


# Map control

Features and actions on the map


# Building

Building visibility manipulation

## building3d

takes a visibility mode (string) as a parameter and displays buildings based on the specified option.

```javascript
mapInstance.building3d(mode);
```

### Parameter

| Required Parameter | Description                         | Type   |
| ------------------ | ----------------------------------- | ------ |
| mode               | "3d", "2d", or "none" can be chosen | String |

```javascript
mapInstance.building3d("3d");
mapInstance.building3d("2d");
mapInstance.building3d("none");
```


# Bounds

Bounds for map viewport

## fitBounds

takes bounds and opt as arguments and sets the center of the map with the given parameter. bounds parameter is a JSON object with two intercardinal directions (sw and ne), with latitude and longitude (lat, lng) respectively.

```javascript
mapInstance.fitBounds(bounds, opt);
```

### Parameter

| Required Parameter | Description                                                                                     | Type |
| ------------------ | ----------------------------------------------------------------------------------------------- | ---- |
| bounds             | Center these bounds in the viewport and use the highest zoom level up to and including the map. | JSON |

| Optional Parameter | Description                                                                                   | Type    |
| ------------------ | --------------------------------------------------------------------------------------------- | ------- |
| padding            | The amount of padding in pixels to add to the given bounds.                                   | Numeric |
| linear             | If true, the map transitions using Map#easeTo. If false, the map transitions using Map#flyTo. | Bool    |
| maxZoom            | The maximum zoom level to allow when the map view transitions to the specified bounds.        | Numeric |

### Example

```javascript
let bounds = {
        sw: {lat: 37.457464, lng: 126.899302},
        ne: {lat: 37.645804, lng: 127.161728}
}

let opt = {
    padding: {
           top: 5,
           bottom: 5,
           right: 15,
           left: 15
    },
    linear: true,         // true for “easeTo” false for “flyTo”
    maxZoom: 10
}

let opt2 = {
    padding: 10            // 10 for top, bottom, right, and left.
}

mapInstance.fitBounds(fit, opt);
mapInstance2.fitBounds(fit, opt2);
```

## getBounds

Retrieves the bounds attribute set in 'fitBounds()'

```javascript
mapInstance.getBounds();
```

### Return

Intercardinal coordinates (ne, sw) with latitude and longitude

```javascript
mapInstance.getBounds();
return : {
        ne : {lat: 37.645804, lng: 127.161728}
        sw : {lat: 37.457464, lng: 126.899302}
}
```


# Center

## setCenter

Sets the center of the map.

```
mapInstance.setCenter(LatLng);
```

### Parameter

| Required Parameter | Description                                               | Type |
| ------------------ | --------------------------------------------------------- | ---- |
| LatLng             | Latitude and longitude to be set as the center of the map | JSON |

### Example

```javascript
let LatLng = {
        lat: 37.574674, 
        lng: 126.958004
}
mapInstance.setCenter(LatLng);
```

## getCenter

Retrieves the latitude and longitude value set in "setCenter()"

```javascript
mapInstance.getCenter();
```

### Return

The map's geographical center point

### Example

```javascript
mapInstance.getCenter();
return : {
        lat: 37.574674, 
        lng: 126.958004
}
```


# Heading

Focal point for rotating a map view

## setHeading

Takes an angle value (in degree) and sets "heading" (focal point) to rotate the map in the desired direction or angle. The default is 0 degree (North)

```
mapInstance.setHeading(value);
```

### Parameter

| Required Parameter | Description                   | Type    |
| ------------------ | ----------------------------- | ------- |
| value              | Angle in degree from 0 to 360 | Numeric |

### Example

```
mapInstance.setHeading(90);
```

## getHeading

Gets the current focal point (heading) value in angle.

```javascript
mapInstance.getHeading();
```

### Return

The angle in degree.

### Example

```javascript
mapInstance.getHeading();
return : 90
```


# Flyto

Animated focus to a location

## flyTo

Takes a JSON object as a parameter that contains latitude, longitude, zoom, and optional speed. Displays a location that matches the parameters with flying animation.

| Parameter        | Description                                                           | Type    |
| ---------------- | --------------------------------------------------------------------- | ------- |
| lat              | Latitude                                                              | Numeric |
| lng              | Longitude                                                             | Numeric |
| zoom             | Zoom level of the map                                                 | Numeric |
| speed (optional) | <p>Determines flying animation speed</p><p>The default value: 2.5</p> | Numeric |

### Example

```javascript
mapInstance.flyTo ({
    lat: 37.553749,
    lng: 126.808706,
    zoom: 15,
    speed: 4
})
```


# Tilt

Tilt your 3d map view

## setTilt

Sets the slope/tilt of the map view. The parameter ranges from 0 to 60. If the value is closer to 0, then the map appears to be 2D. If the value is close to 60, the map appears to be 3D.

### Parameter

| Required Parameter | Description | Type           |
| ------------------ | ----------- | -------------- |
| value              | Slope       | Numeric (0-60) |

## Example

```
mapInstance.setTilt(40);
```

## getTilt

Gets the slope/tilt value of the map.

### Return

The current tilt of the map.

### Example

```javascript
mapInstance.getTilt();
return 40
```


# Zoom

Controls scale of your map view

## setZoom

Sets the zoom level of the map.

### Parameter

| Required Parameter | Description       | Type    |
| ------------------ | ----------------- | ------- |
| value              | Zoom level (0-20) | Numeric |

### Example

```javascript
mapInstance.setZoom(5);
```

## getZoom

Gets the current zoom level of the map.

### Return

The current zoom level of the map.

### Example

```javascript
mapInstance.getZoom();
return 5
```


# Marker

Marker manipulation

## Marker

Creates a marker on the map using the specified option. To display markers, you can set coordinate value, marker icons, and icon sizes.

```javascript
new fatosmap.maps.Marker({ option });
```

### Parameter

| Required Parameter | Description                       | Type         |
| ------------------ | --------------------------------- | ------------ |
| position           | Latitude and longitude {lat, lng} | JSON         |
| map                | Map object to display the marker  | Map instance |

| Optional Parameter    | Description                                                                                                                                                                                                                                                        | Type                            |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- |
| icon                  | Sets the image of a marker                                                                                                                                                                                                                                         | URL                             |
| iconSize              | <p>Sets the size of a marker icon.</p><p>\[width, height]</p>                                                                                                                                                                                                      | Numeric Array                   |
| message               | Sets the popup message                                                                                                                                                                                                                                             | <p>String <br>or</p><p>HTML</p> |
| label                 | marker that's labeled                                                                                                                                                                                                                                              | HTML                            |
| anchor (popup)        | A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker#setLngLat. Options are 'center' , 'top' , 'bottom' , 'left' , 'right'.                                                                               | String                          |
| markerOffset (marker) | <p>The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. default \[0, 0]</p><p>A Point or an array of two numbers representing <code>x</code> and <code>y</code> screen coordinates in pixels.</p> | Array\<Number>                  |
| popupOffset(popup)    | <p>The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. default \[0, 0]</p><p>A Point or an array of two numbers representing <code>x</code> and <code>y</code> screen coordinates in pixels.</p> | Array\<Number>                  |
| closeButton (popup)   | If true, a close button will appear in the top right corner of the popup. default false                                                                                                                                                                            | Bool                            |
| closeOnClick (popup)  | If true, the popup will be closed when the map is clicked. default false                                                                                                                                                                                           | Bool                            |
| addMarkerEvent        | You can give the marker a promised event. (dragstart/drag/dragend)                                                                                                                                                                                                 | JSON Array                      |
| drag                  | A boolean indicating whether or not a marker is able to be dragged to a new position on the map.                                                                                                                                                                   | Bool                            |

{% hint style="info" %}
anchor, offset, closeButton, and closeOnClick are available only if the popup message is set.
{% endhint %}

### Example

```javascript
** Single Create Marker **
let marker = new fatosmap.maps.Marker({
        position: {lat: 37.564895, lng: 126.987056},
        map: mapInstance,
        icon: image(My Image),
        iconSize: [30, 30],
        message: 'Fatos', // String
        //message: `<div>FATOS</div>` // HTML 
        label: `<div>1</div>` //HTML
        anchor : 'bottom',
        markerOffset : [0, 0],
        popupOffset: [0,0],
        closeButton: true,
        closeOnClick: true,
        drag: true,
        addMarkerEvent: [
                {
                    event:'dragstart',
                    callback: onDragStart
                },
                {
                    event:'drag',
                    callback: onDrag
                },
                {
                    event:'dragend',
                    callback: onDragEnd
                }
            ]
});
function onDragStart(e) {
    console.log('onDragStart', e);
}
function onDrag(e) {
    console.log('onDrag', e);
}
function onDragEnd  (e) {
    console.log('Dragend', e);
};
---------------------------------------------------------------------------
** Multi Create Markers **
let markers = []
let count = markers.length
let positions = [
        { lat: 37.564952 , lng: 125.987321 },
        { lat: 37.564952 , lng: 126.987321 },
        { lat: 37.564952 , lng: 124.987321 }
]

for(let i = 0; i < count; i++){
        let marker = new fatosmap.maps.Marker({
                position: positions[i],
                map: mapInstance
        })
        markers.push(marker)
        markers[i].setMap(mapInstance)
    }
```

### RemoveMarker

Clears the markers shown on the map.

### Example

```javascript
marker.setMap(null);
```


# Instance Members

### getId()

Get the marker's id.

```
// one marker 
marker.getId();

// markers
let ids = [];
for(let i = 0; i < markers.length; i++) {
    ids.push(markers[i].getId());
}
console.log('Ids :', ids);
```

### setLngLat(markerId, lnglat)

Set the marker's geographical position and move it.

| Required Parameter | Description                       | Type   |
| ------------------ | --------------------------------- | ------ |
| markerID           | The ID that created the marker.   | String |
| lnglat             | Latitude and longitude {lat, lng} | Object |

```
const lnglat = { lat: 37.482630, lng: 126.899893};
marker.setLngLat(markerID, lnglat);
```

### getLngLat(markerId) <a href="#getlnglat-markerid" id="getlnglat-markerid"></a>

Get the marker's geographical location.

| Required Parameter | Description                     | Type   |
| ------------------ | ------------------------------- | ------ |
| markerID           | The ID that created the marker. | String |

```javascript
const lnglat = marker.getLngLat(markerID);
console.log(lnglat);
```

### setMessage(markerId, message)

Sets the popup's content to a string of text.

| Required Parameter | Description                                 | Type   |
| ------------------ | ------------------------------------------- | ------ |
| markerID           | The ID that created the marker.             | String |
| message            | The message you want to show on the marker. | HTML   |

```
const message = <div>Change Message</div>; 
marker.setMessage(id, message);
```

### setZIndex(markerId, index)

Change the marker's Z-lndex.

| Required Parameter | Description                                                                                          | Type    |
| ------------------ | ---------------------------------------------------------------------------------------------------- | ------- |
| markerID           | The ID that created the marker.                                                                      | String  |
| index              | The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. | Numeric |

```
marker.setZIndex(markerID, index);
```

### getZIndex(markerId)

Get the marker's Z-lndex.

| Required Parameter | Description                     | Type   |
| ------------------ | ------------------------------- | ------ |
| markerID           | The ID that created the marker. | String |

```
marker.getZIndex(markerID);
```

### setOffset(markerId, offset)

Sets the offset of the marker.

| Required Parameter | Description                                       | Type            |
| ------------------ | ------------------------------------------------- | --------------- |
| markerID           | The ID that created the marker.                   | String          |
| offset             | Move the selected element to a specific location. | Array\<Numeric> |

```
const offset = [0, -20]; 
marker.setOffset(markerID, offset);
```

### getOffset(markerId)

Get the marker's offset.

| Required Parameter | Description                     | Type   |
| ------------------ | ------------------------------- | ------ |
| markerID           | The ID that created the marker. | String |

```
marker.getOffset(markerID);
```

### setDraggable(markerId, bool)

Sets the draggble property and functionality of the marker.

| Required Parameter | Description                                | Type    |
| ------------------ | ------------------------------------------ | ------- |
| markerID           | The ID that created the marker.            | String  |
| bool               | Whether to move by clicking on the marker. | boolean |

```
const bool = true;
marker.setDraggable(markerID, bool);
```

### isDraggable(markerId)

Returns true if the marker can be dragged.

| Required Parameter | Description                     | Type   |
| ------------------ | ------------------------------- | ------ |
| markerID           | The ID that created the marker. | String |

```
marker.isDraggable(markerID);
```

### setPopupOffset(markerId, offset)

Sets the Popup offset of the marker.

| Required Parameter | Description                                       | Type            |
| ------------------ | ------------------------------------------------- | --------------- |
| markerID           | The ID that created the marker.                   | String          |
| offset             | Move the selected element to a specific location. | Array\<Numeric> |

```
const offset = [0, -20]; 
marker.setPopupOffset(markerID, offset);
```

### getPopupOffset(markerId)

Get the marker's Popup offset.

| Required Parameter | Description                     | Type   |
| ------------------ | ------------------------------- | ------ |
| markerID           | The ID that created the marker. | String |

```
marker.getPopupOffset(markerID)
```

### togglePopup()

Opens or closes the Popup instance that is bound to the Marker, depending on the current state of the Popup.

```javascript
// marker
marker.togglePopup();

// markers
markers[i].togglePopup();
```


# Polyline

Connect vertices with lines

## Polyline

Sets latitude/longitude, color, transparency, line thickness. Draws a line on the map by combining the set value. Collects the values of multiple coordinates and express them as lines.

```javascript
new fatosmap.maps.Polyline({ option })
```

### Parameter

| Required Parameter | Description                       | Type       |
| ------------------ | --------------------------------- | ---------- |
| path               | Each {lat, lng} behaves as a node | JSON Array |

| Optional Parameter    | Description                                                                                                                                                                                                | Type          |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| strokeColor           | specifies a hexadecimal HTML color of the format "#FFFFFF", The default is '#000000'                                                                                                                       | Hex           |
| strokeOpacity         | specifies a numerical value between 0.0 and 1.0 to determine the opacity of the line's color. The default is 1.0                                                                                           | Numeric       |
| strokeWeight          | specifies the width of the line in pixels. The default is 1                                                                                                                                                | Numeric       |
| message (popup)       | Set the message of popup, type is string or HTML                                                                                                                                                           | String / HTML |
| event                 | popup mouse event click or mouseover. The default click                                                                                                                                                    | String        |
| anchor (popup)        | A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker#setLngLat. Options are 'center' , 'top' , 'bottom' , 'left' , 'right'. The default is bottom | String        |
| offset (popup)        | The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. default 15                                                                           | Numeric       |
| closeButton (popup)   | If true, a close button will appear in the top right corner of the popup. The default is false                                                                                                             | Bool          |
| coloseOnClick (popup) | If true, the popup closes when the map is clicked. The default is false                                                                                                                                    | Bool          |

### Example

```javascript
let line = [    
    {lat: 37.772, lng: -122.214},    
    {lat: 21.291, lng: -157.821},    
    {lat: -18.142, lng: 178.431},    
    {lat: -27.467, lng: 153.027}    
];    
let polyline = new fatosmap.maps.Polyline({    
    path:            line,                     
    strokeColor:     '#0000FF',         
    strokeOpacity:   0.5,           
    strokeWeight:    10,
    message:         'FATOS',
    anchor:          'bottom',
    offset:          15,
    closeButton:     true,
    closeOnClick:    true,                
});    

polyline.setMap(mapInstance);
```

## How to clear the polyline

Clears the path drawn on the map.

### Example

```javascript
polyline.setMap(null);
```


# Polygon

Fill colors the area within given vertices

## Polygon

Creates a custom polygon. Takes JSON Array of at least 3 latitude/longitude for vertices, color, and transparency as arguments.

```javascript
new fatosmap.maps.Polygon({ option });
```

### Parameter

| Required Parameter | Description                      | Type       |
| ------------------ | -------------------------------- | ---------- |
| paths              | Coordinate value for each vertex | JSON Array |

| Optional Parameter | Description                                                                                                                                   | Type          |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| fillColor          | specifies a hexadecimal HTML color of the format "#FFFFFF". The Polygon class does not support named colors. The default is '#000000'         | Hex (String)  |
| fillOpacity        | specifies a numerical value between 0.0 and 1.0 to determine the opacity of the fill's color. The default is 1.0                              | Numeric       |
| outlineColor       | specifies a hexadecimal HTML outline color of the format "#FFFFFF". The Polygon class does not support named colors. The default is '#000000' | Hex (String)  |
| text               | Optional formatted. Defaults to ""                                                                                                            | String        |
| textColor          | Optional color. Defaults to "#000000". Requires "text" option.                                                                                | Hex (String)  |
| textHaloColor      | Optional color. Defaults to "rgba(0, 0, 0, 0)". Requires "text" option.                                                                       | RGBA          |
| textHaloWidth      | Optional number greater than or equal to 0. Units in pixels. Defaults to 0. Requires "text" option.                                           | Numeric       |
| textSize           | Optional number greater than or equal to 0. Units in pixels. Defaults to 16. Requires "text" option.                                          | Numeric       |
| textOffset         | Optional array of numbers. Units in ems. Defaults to \[0,0]. Requires "text" option.                                                          | Numeric Array |

### Example

```javascript
let triangleCoords = [    
    {lat: 25.774, lng: -80.190},    
    {lat: 18.466, lng: -66.118},    
    {lat: 32.321, lng: -64.757},    
    {lat: 25.774, lng: -80.190}    
];    

let polygons = new fatosmap.maps.Polygon({    
    paths:             triangleCoords,    
    fillColor:         '#FF0000',    
    fillOpacity:       0.35,
    outlineColor:      '#DC151A',
    text:              'FATOS',
    textColor:         '#91FF7C',
    textSize:          25,
    textOffset:        [5,4],
    textHaloWidth:     10    
});    

bermudaTriangle.setMap(mapInstance);
```

## How to remove polygons

Clears the polygon drawn on the map

### Example

```javascript
// Method 1.
bermudaTriangle.setMap(null);

// Method 2.
polygon.setMap("removeAll");
```

## setVisible

Sets a visibility option for a polygon instance.

### Example

```javascript
polygon.setVisible("none");
```


# Circle

Generate a circle and edit properties

## Circle

Creates a circle that takes center point, radius, colors, and transparency as arguments.

```javascript
new fatosmap.maps.Circle({ option });
```

### Parameter

| Required Parameter | Description                                 | Type    |
| ------------------ | ------------------------------------------- | ------- |
| center             | center point in latitude/longitude          | JSON    |
| radius             | specifies the radius of the circle in meter | Numeric |

| Optional Parameter | Description                                                                                                                         | Type          |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| fillColor          | specifies a hexadecimal HTML color of the format "#FFFFFF".The Circle class does not support named colors. The default is '#000000' | Hex (String)  |
| fillOpacity        | specifies a numerical value between 0.0 and 1.0 to determine the opacity of the fill's color. The default is 1.0                    | Numeric       |
| text               | Optional formatted. The defaults is ""                                                                                              | String        |
| textColor          | Optional color. Defaults to "#000000". Requires "text" option.                                                                      | Hex (String)  |
| textHaloColor      | Optional color. Defaults to "rgba(0, 0, 0, 0)". Requires "text" option.                                                             | RGBA          |
| textHaloWidth      | Optional number greater than or equal to 0. Units in pixels. Defaults to 0. Requires "text" option.                                 | Numeric       |
| textSize           | Optional number greater than or equal to 0. Units in pixels. Defaults to 16. Requires "text" option.                                | Numeric       |
| textOffset         | Optional array of numbers. Units in ems. Defaults to \[0,0]. Requires "text" option.                                                | Numeric Array |

### Example

```javascript
let center = {lat: 37.5650745, lng:126.9850103}

let cityCircle = new fatosmap.maps.Circle({    
    fillColor: '#FF0000',    
    fillOpacity: 0.35,    
    center: center,
    radius:10*100
    text: 'FATOS',
    textColor:'#fff',
    textSize: 25,
    textOffset:[5,4]
    textHaloWidth:10
});    

cityCircle.setMap(mapInstance);
```


# On/Off

Event detection

## on / off

Adds or removes a listener for a specific event on a given layer.

```
// Adds a listener
mapInstance.on(type, layerId, listener);

// Removes a listener
mapInstance.off(type, layerId, listener);
```

### Parameter

| Parameter          | Description                                                                                                                                                                                                                                                                                                                                                          | Type     |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| type               | specifies which event to listen to.                                                                                                                                                                                                                                                                                                                                  | String   |
| *Supported types:* | "mouseup", "mousedown", "click", "dblclick", "mousemove", "mouseenter", "mouseleave, "mouseover", "mouseout", "contextmenu", "touchstart", touchend" or "touchcancel".  "mouseenter" and "mouseover" events are triggered when the cursor enters a visible portion of the specified layer or map canvas from outside and vice versa for "mouseleave" and "mouseout". |          |
| layerId (Optional) | ID of a style layer. Only layer that matches the given parameter will trigger the event listener.                                                                                                                                                                                                                                                                    | String   |
| listener           | A callback function that detects the event and triggers further procedures.                                                                                                                                                                                                                                                                                          | Function |

#### Example(Javascript + HTML)

```javascript
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Map Event</title>
</head>
<body>
<div style="height: 100vh">
    <div id="app"></div>
    <pre id="info"></pre>
</div>
<button style="position: absolute; float: top; top: 50px; left: 50px;" onclick="mapClick()">On map Click</button>
<button style="position: absolute; float: top; top: 50px; left: 150px;" onclick="mapClickoff()">OFF map Click</button>
<style>
    #info {
        display: block; position: absolute; float: top; top: 0; left: 30%;
        width: 50%; padding: 10px; border: none; border-radius: 3px; font-size: 12px;
        text-align: center; color: #222; background: #fff;
    }
</style>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>
    const LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14.5,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY',
        }
    );
    function mapClick() {
        mapInstance.on('click', clickEvent);
    }
    function clickEvent(e) {
        console.log('click', e);
        document.getElementById('info').innerHTML = JSON.stringify(e.lngLat);
    }
    function mapClickoff() {
        mapInstance.off('click', clickEvent);
    }
</script>
</body>
</html>
```


# Once

Event detection

## once

Adds a one-time listener for an initial occurrence of a specific event on a given layer.

```javascript
mapInstance.once(type, layerId, listener);
```

### Parameter

{% hint style="info" %}
Parameters for "once" is same as "on" or "off" function.
{% endhint %}

{% content-ref url="/pages/-MLBq0psqTwaCUghrUDG" %}
[On/Off](https://nostramap-doc.fatos.biz/fatos-api/map/map-control/on-off)
{% endcontent-ref %}

#### Example(Javascript + HTML)

```javascript
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Map Event</title>
</head>
<body>
<div style="height: 100vh">
    <div id="app"></div>
    <pre id="info"></pre>
</div>
<button style="position: absolute; float: top; top: 50px; left: 50px;" onclick="mapClick()">Once map Click</button>
<style>
    #info {
        display: block; position: absolute; float: top; top: 0; left: 30%;
        width: 50%; padding: 10px; border: none; border-radius: 3px; font-size: 12px;
        text-align: center; color: #222; background: #fff;
    }
</style>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>
    let LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14.5,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY',
        }
    );
    function mapClick() {
        mapInstance.once('click', clickEvent);
    }
    function clickEvent(e) {
        console.log('click', e);
        document.getElementById('info').innerHTML = JSON.stringify(e.lngLat);
    }
</script>
</body>
</html>
```


# Language

## setLanguage

Sets the language of the map.

```
mapInstance.setLanguage(language);
```

### Parameter

| Required Parameter | Description                                             | Type   |
| ------------------ | ------------------------------------------------------- | ------ |
| language           | specifies the language of the map. ("national" or "en") | String |

{% hint style="success" %}
"national" will display each region of the map with corresponding native language.
{% endhint %}

### Example

```javascript
mapInstance.setLanguage("national");
```

## getLanguage

Retrieves the language parameter of the map instance.

```javascript
mapInstance.getLanguage();

return: "national"
```


# Theme

Change the map theme

## Set map theme <a href="#set-map-theme" id="set-map-theme"></a>

| Parameter | Description                                       | Type   |
| --------- | ------------------------------------------------- | ------ |
| theme     | <p>basic</p><p>satellite   // Satellite theme</p> | String |

{% tabs %}
{% tab title="Before loading the map" %}

```
let LatLng = {lat: 37.482890, lng: 126.896086}
let mapInstance = new fatosmap.maps.Map(
    document.getElementById("app"),
    {
        zoom: 14,
        center: LatLng,
        maxZoom: 20,
        minZoom: 2,
        key: 'YOUR_API_KEY'
        
        // theme
        theme: 'satellite' Default basic
    }
)
```

{% endtab %}

{% tab title="After loading the map" %}

```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Map Event</title>
</head>
<body>
<div style="height: 100vh">
    <div id="app"></div>
</div>
<button style="position: absolute; float: top; top: 50px; left: 50px;" onclick="setTheme()">Set Theme</button>
<button style="position: absolute; float: top; top: 50px; left: 150px;" onclick="getTheme()">Get Theme</button>
<button style="position: absolute; float: top; top: 100px; left: 50px;" onclick="showTraffic(true)">Show Traffic Line</button>
<button style="position: absolute; float: top; top: 100px; left: 200px;" onclick="showTraffic(false)">Remove Traffic Line</button>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>
    let LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14.5,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY'
        }
    );
    function setTheme() {
        mapInstance.setTheme('basic');
    }
    function getTheme() {
        console.log(mapInstance.getTheme());
    }
    function showTraffic(bool) {
        mapInstance.setTraffic(bool)
    }
</script>
</body>
</html>
```

{% endtab %}
{% endtabs %}


# Cluster

If the data is a collection of point features, setting this to true clusters the points by radius into groups.

## Cluster

```
new fatosmap.maps.Cluster({ option)};
```

Parameter

| map      | Map object to display ther Cluster                                                       | Map instance   |
| -------- | ---------------------------------------------------------------------------------------- | -------------- |
| position | Latitude(must), Longitude(must), iconType(Option), message(Option), popupMessage(Option) | Array\<object> |

| clusterMaxZoom | Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Numeric        |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| clusterRadius  | Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Numeric        |
| clusterStyle   | <p>Set individual cluster styles.</p><p><strong>color</strong> : Set the color of the inner cluster. <br>            Colors, HEX, RGB, RGBA<br><strong>strokeColor</strong> : Set the color of the outer cluster. <br>             Colors, HEX, RGB, RGBA<br><strong>strokeWidth</strong> : Set the width of the outer cluster.<br>             numeric<br><strong>radius</strong> : Set the radius of the cluster.<br>              numeric<br><strong>count</strong> : The number of clusters. <br>             numeric<br> <strong>textSize</strong> : Set the text size of the cluster.  </p><p>             numeric</p><p><strong>textColor</strong> : Set the text color of the cluster.   </p><p>             Colors, HEX, RGB, RGBA</p><p><strong>textHaloWidth</strong> : Distance of halo to the font outline.</p><p>             numeric</p><p><strong>textHaloColor</strong> : The color of the text's halo.</p><p>             Colors, HEX, RGB, RGBA</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Array\<object> |
| circleStyle    | <p>Set circle styles.</p><p><strong>color</strong> : Set the color of the inner circle. <br>            Colors, HEX, RGB, RGBA</p><p><strong>strokeColor</strong> : Set the color of the outer circle. <br>             Colors, HEX, RGB, RGBA<br><strong>strokeWidth</strong> : Set the width of the outer circle.<br>             numeric<br><strong>radius</strong> : Set the radius of the circle.<br>              numeric</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Array\<object> |
| marker         | <p>Whether to display the data as a marker.</p><p>Default false(circle)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Boolean        |
| markerStyle    | <p>If marker true, </p><p>Set marker styles.</p><p><strong>minZoom</strong> : Zoom level to indicate the marker.</p><p>              numeric Default clusterMaxZoom</p><p><strong>overlap</strong> : If true, the icon will be visible even if it collides with other previously drawn symbols. </p><p>              boolean Default false</p><p><strong>placement</strong> : If true, other symbols can be visible even if they collide with the icon.</p><p>              boolean Default false</p><p><strong>iconSize</strong> : Scales the original size of the icon by the provided factor.</p><p>              numeric Default 1</p><p><strong>iconAnchor</strong> : Part of the icon placed closest to the anchor.<br> <code>"center"</code>, <code>"left"</code>, <code>"right"</code>, <code>"top"</code>, <code>"bottom"</code>, <code>"top-left"</code>, <code>"top-right"</code>, <code>"bottom-left"</code>, <code>"bottom-right"</code></p><p>              String Default center</p><p><strong>textAnchor</strong> : Part of the text placed closest to the anchor.<br> <code>"center"</code>, <code>"left"</code>, <code>"right"</code>, <code>"top"</code>, <code>"bottom"</code>, <code>"top-left"</code>, <code>"top-right"</code>, <code>"bottom-left"</code>, <code>"bottom-right"</code></p><p>              String Default center</p><p><strong>textColor</strong> : The color with which the text will be drawn.<br>              Colors, HEX, RGB, RGBA</p><p><strong>textOffset</strong> : Offset distance of text from its anchor.<br>              Array\<Numeric> Default \[0,0]<br><strong>textHaloColor</strong> : The color of the text's halo, which helps it stand out from backgrounds.<br>             Colors, HEX, RGB, RGBA<br><strong>textHaloWidth</strong> : Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.</p><p>              numeric Default 0<br><strong>addImage</strong> : The marker image is registered with the server.<br>              Array\<object><br>               <strong>imageId</strong> : It must match the icon type of data.</p><p>               <strong>imageUrl</strong> : Link with an image.</p><p></p> | Array\<object> |
| popupStyle     | <p>If marker true, </p><p>Set popup styles.</p><p><strong>event :</strong> mouse event.</p><p>"click", "mouseenter"</p><p>            String Defautl click</p><p><strong>className</strong> : Space-separated CSS class names to add to popup container.</p><p>            String Default None</p><p><strong>closeButton</strong> : If true, a close button will appear in the top right corner of the popup.</p><p>            Boolean Default false<br><strong>closeOnClick</strong> : If true , the popup will close when the map is clicked.<br>            Boolean Default false<br><strong>offset</strong> : A pixel offset applied to the popup's location.</p><p>             Array\<numeric> Default \[0,0]</p><p><strong>maxWidth</strong> : A string that sets the CSS property of the popup's maximum width.</p><p>            String Default fit-content<br><strong>anchor</strong> : Part of the popup that should be positioned closest to the coordinate</p><p>�<code>'center'</code> , <code>'top'</code> , <code>'bottom'</code> , <code>'left'</code> , <code>'right'</code> , <code>'top-left'</code> , <code>'top-right'</code> , <code>'bottom-left'</code> , and <code>'bottom-right'</code> </p><p>              String Default center</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Array\<object> |

### Example (Javascript + HTML)

```javascript
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div style="height: 100vh">
    <div id="app"></div>
</div>
<button style="position: absolute; float: top; top: 50px; left: 50px;" onclick="clusterFNC()">Create Cluster</button>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>
    let LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14.5,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY',
        }
    );

    let data = [
        {lat: 37.564895, lng: 126.987056, iconType: 'truck', message: 'truck', popupMessage: `<div>Fatos</div>`},
        {lng: 126.978505, lat: 37.564978, iconType: 'bus', message: 'bus'},
        {lng: 126.987233, lat: 37.564934, iconType: 'kickboard', message: 'kickboard', popupMessage: `<div>Fatos2</div>`},
        {lng: 126.995626, lat: 37.550784, iconType: 'bus', message: 'bus'},
        {lng: 127.009800, lat: 37.530547, iconType: 'car', message: 'car'},
        {lng: 127.018089, lat: 37.540411, iconType: 'car', message: 'car'},
        {lng: 127.088223, lat: 37.528625, iconType: 'car', message: 'car'},
        {lng: 127.128448, lat: 37.572359, iconType: 'kickboard', message: 'car'},
        {lng: 127.284693, lat: 37.530413, iconType: 'car', message: 'car'},
        {lng: 127.321753, lat: 37.538258, iconType: 'bus', message: 'car'},
        {lng: 127.348518, lat: 37.592647, iconType: 'car', message: 'car'}
        ];

    let cluster;
    function clusterFNC () {
        cluster = new fatosmap.maps.Cluster({
            map:mapInstance,                    // Map to be created
            position: data,             // Data of objects to be clustered     
            clusterMaxZoom: 14,         // Uncluster if zoom exceeds level 14       
            clusterRadius: 150,         // All Cluster radius 150       
            clusterStyle: [
                {
                    color: 'rgba(81,187,214,0.7)',
                    radius: 20,
                },
                {
                    color: 'rgba(241,240,117,0.71)',
                    count: 8,
                    radius: 30,
                },
                {
                    color: 'rgba(242,140,177,0.71)',
                    strokeColor: '#feff18',
                    strokeWidth : 2,
                    count: 10,
                    radius: 40,
                    textSize: 20,
                    textColor: '#fff',
                    textHaloWidth: 2,
                    textHaloColor: '#222'
                }
            ],
            // Create circle-shaped points when not using markers.
            circleStyle: {
                color: '#fc00ee',
                radius: 8,
                strokeColor: '#fff',
                strokeWidth: 2
            },
            marker: true,
            markerStyle: {
                minZoom: 1,
                overlap: true,
                placement: true,
                iconSize: 1,
                iconAnchor: 'top',
                textAnchor: 'bottom',
                textColor: 'rgb(244,165,98)',
                textOffset: [0,5],
                textHaloColor: '#fff',
                textHaloWidth: 2,
                addImage: [     // marker: true  must
                    {
                        imageId: 'car',      // imageId === position.iconType  must
                        imageUrl: 'https://maps.fatos.biz/dist/car_fatos.png'
                    },
                    {
                        imageId: 'bus',
                        imageUrl: 'https://maps.fatos.biz/dist/bus_fatos.png'
                    },
                    {
                        imageId: 'truck',
                        imageUrl: 'https://maps.fatos.biz/dist/truck_fatos.png'
                    },
                    {
                        imageId: 'kickboard',
                        imageUrl: 'https://maps.fatos.biz/dist/kickboard_fatos.png'
                    }
                ],
            },
            popupStyle: {
                event: 'click',
                className: 'fatos-marker-popup-bottom',
                closeButton:false,
                offset:[0, -10],
                closeOnClick: true,
                maxWidth: 'fit-content',
                anchor: 'bottom',
            },
        });
        cluster.setMap(mapInstance);
    }
</script>
</body>
</html>
```

###


# Instance Members

### setLngLat(data)

Set the cluster's geographical position and move it.

```
 cluster.setLngLat(data);
```

### Remove Cluster

Removes the cluster from a map.

```
cluster.setMap(null);
```


# Button control

Edit button properties

## Button Visibility

You can toggle the visibility of control buttons with the following functions.

{% tabs %}
{% tab title="Before loading the map" %}

```
    let LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY'
            
            // button 
            buttonControl: false, // Remove all buttons. Default true. 
            btnTheme: false, // Remove the theme button. Default true.
            btnPitch: false, // Remove the pitch(3D) button. Default true.
            btnBuilding3d: false, // Remove the building button. Default true.
            btnZoom: false, // Remove the zoom button. Default true.
            btnCompass: false, // Remove the compass button. Default true.
            btnBering: false, // Remove the bering button. Default true.
            btnDistance: false, // Remove the distance button. Default true.
            btnArea: false, // Remove the area button. Default true.
            btnRadius: false, // Remove the radius button. Default true.
            btnFullScreen: false, // Remove the fullScreen button. Default true.
            btnGeoLocate: false, // Remove the geoLocate button. Default true.
            btnTraffic: false, // Remove the traffic button. Default true.
        }
    )
```

{% endtab %}

{% tab title="After loading the map" %}

```
/*
You can create or remove a button bar at the top right of 
the map with all buttons.
*/
mapInstance.onBtnAll();
mapInstance.offBtnAll();

// Theme Button.
mapInstance.onBtnTheme();
mapInstance.offBtnTheme();

// Pitch button.
mapInstance.onBtnPitch();
mapInstance.offBtnPitch();

// Building button.
mapInstance.onBtnBuilding3d();
mapInstance.offBtnBuilding3d();

// Zoom-in and zoom-out button.
mapInstance.onBtnZoom();
mapInstance.offBtnZoom();

// Compass button.
mapInstance.onBtnCompass();
mapInstance.offBtnCompass();

// Bering button.
mapInstance.onBtnBering();
mapInstance.offBtnBering();

// Radius button.
mapInstance.onBtnRadius();
mapInstance.offBtnRadius();

// Area Button.
mapInstance.onBtnArea();
mapInstance.offBtnArea();

// Distance Button.
mapInstance.onBtnDistance();
mapInstance.offBtnDistance();

// Full-screen button.
mapInstance.onBtnFullScreen();
mapInstance.offBtnFullScreen();

// Geographic location button.
mapInstance.onBtnGeoLocate();
mapInstance.offBtnGeoLocate();

// Traffic button.
mapInstance.onBtnTraffic();
mapInstance.offBtnTraffic();
```

{% endtab %}
{% endtabs %}


# Utilities

Additional features


# Rectangle

## Rectangle

Create a rectangle to display on the map.

```
new fatosmap.maps.Rectangle({ option });
```

| Required Parameter | Description                         | Type         |
| ------------------ | ----------------------------------- | ------------ |
| map                | Map object to display the Rectangle | Map instance |

| Optional Parameter | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Type     |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| circleStyle        | <p>Set individual circle styles.</p><p><strong>color</strong> : Set the color of the inner cluster. <br>            Colors, HEX, RGB, RGBA<br>            Default : #fff<br><strong>strokeColor</strong> : Set the color of the outer cluster. <br>             Colors, HEX, RGB, RGBA<br>             Default : #F2AF4E<br><strong>strokeWidth</strong> : Set the width of the outer cluster.<br>             numeric<br>             Default : 4<br><strong>radius</strong> : Set the radius of the cluster.<br>              numeric </p><p>              Default : 4.5</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Object   |
| rectangleStyle     | <p>Set individual rectangle styles.</p><p><strong>lineColor :</strong> The color with which the line will be drawn.<br>                    Colors, HEX, RGB, RGBA<br>                    Default : #1bcdc1<br><strong>lineWidth</strong> : Stroke thickness.</p><p>                    numeric </p><p>                    Default : 5<br><strong>dashLineColor</strong> : The color with which the line will be drawn.<br>                    Colors, HEX, RGB, RGBA<br>                    Default : #a5a5a5<br><strong>dashLineWidth</strong> : Stroke thickness.</p><p>                              numeric </p><p>                              Default : 4<br><strong>dashArray</strong> : Specifies the lengths of the alternating dashes and gaps that form the dash pattern.<br>                      Array\<numeric><br>                      Default : \[3, 2]<br><strong>fillColor</strong> : The color of the filled part of this layer.<br>                    Colors, HEX, RGB, RGBA<br>                    Default : #1bcdc1<br><strong>fillOpacity</strong> : The opacity of the entire fill layer.<br>                    numeric between 0 and 1</p><p>                    Default : 0.3<br><strong>textColor</strong> : The color with which the text will be drawn.<br>                    Colors, HEX, RGB, RGBA<br>                    Default : #F2AF4E</p><p><strong>textSize</strong> : Set the font size.<br>                  numeric<br>                  Default : 18<br><strong>textHaloColor</strong> : The color of the text's halo, which helps it stand out from backgrounds.<br>             Colors, HEX, RGB, RGBA<br>             Default : #fff<br><strong>textHaloWidth</strong> : Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.</p><p>              numeric <br>              Default 5</p><p>�<strong>overlap</strong> : If true, the icon will be visible even if it collides with other previously drawn symbols. </p><p>              boolean <br>              Default true</p><p><strong>placement</strong> : If true, other symbols can be visible even if they collide with the icon.</p><p>              boolean <br>              Default true</p> | Object   |
| callback           | A callback is a function passed as an argument to another function.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Function |

```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Rectangle</title>
</head>
<body>
<div style="height: 100vh">
    <div id="app"></div>
</div>
<button style="position: absolute; float: top; top: 50px; left: 50px;" onclick="rectangleAPI()">Rectangle API</button>
<script type="text/javascript" src="https://maps.fatos.biz/dist/fatosmap-gl.js"></script>
<script>

    const LatLng = {lat: 37.482901, lng: 126.896038};
    const mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14.5,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY',
        }
    );

    function rectangleAPI() {
        new fatosmap.maps.Rectangle({
            map : mapInstance,
            circleStyle : {
              color: '#fff',
              radius: 4.5,
              strokeColor: '#F2AF4E',
              strokeWidth: 4
            },
            rectangleStyle : {
                lineColor: '#1bcdc1',
                lineWidth: 5,
                dashLineColor: '#a5a5a5',
                dashLineWidth: 4,
                dashArray: [3,2],
                fillColor: '#1bcdc1',
                fillOpacity: 0.3,
                textColor: '#F2AF4E',
                textSize: 18,
                textHaloColor: '#fff',
                textHaloWidth: 5,
                overlap: true,
                placement: true,
            },
            callback : getData,
        });
    }
    function getData(bounds) {
        console.log('GetData ::', bounds)
    }
</script>
</body>
</html>
```


# Distance

Get a distance for given coordinates

## getDistance

Returns the distance in meter between 2 or more coordinates.

```javascript
mapInstance.getDistance(coordinates)
```

### Parameter

| Required Parameter | Description                                                                 | Type       |
| ------------------ | --------------------------------------------------------------------------- | ---------- |
| coordinates        | Array of latitude/longitude. The array must contain at least 2 coordinates. | JSON Array |

### Example

```javascript
mapInstance.getDistance(
   [
       {lng: -122.019807, lat: 45.632433},
       {lng: -122.019767, lat: 45.632453},
       {lng: -122.01971, lat: 45.632472}
   ])
```

### Return

Distance value in the meter.


# Area

Get an area of given coordinates

## getArea

Returns the area in meter squared of a polygon.

```
mapInstance.getArea(coordinates)
```

### Parameter

| Required Parameter | Description                                                                 | Type       |
| ------------------ | --------------------------------------------------------------------------- | ---------- |
| coordinates        | Array of latitude/longitude. The array must contain at least 3 coordinates. | JSON Array |

### Example

```javascript
mapInstance.getArea(
   [
       {lng: -122.019807, lat: 45.632433},
       {lng: -122.019767, lat: 45.632453},
       {lng: -122.01971, lat: 45.632472}
   ])
```

### Return

Area value in meter squared


# Search

Find locations by POI, Address, or Geocoding


# POI

Search by POI such as airports, parks, mines, or gas station

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## POI Search

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/search/POI`

Returns search results based on POI search queries and coordinate settings.

#### Query Parameters

| Name  | Type   | Description                                                                                                                        |
| ----- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| key   | string | Your API Key.                                                                                                                      |
| kwd   | string | <p>Name search: search word<br>Nearby search:<br>category ID (String to hex encoding)i.e. {ABC Market} to {ec9db4eba788ed8ab8}</p> |
| stype | string | <p>Search type<br>Name search: 1<br>Nearby search: 3</p>                                                                           |
| cx    | string | User's current location X coordinate (wgs84)                                                                                       |
| cy    | string | User's current location Y coordinate (wgs84)                                                                                       |
| rad   | string | Search radius (Optional for name search)                                                                                           |

{% tabs %}
{% tab title="200 " %}

```javascript
GET
https://api.fatos.biz/nostra/api/search/POI?key=YOUR_API_KEY&kwd=42414e4b&stype=1&cx=100.600855&cy=13.811968&minx=100.574184&miny=13.478281&maxx=101.097168&maxy=13.829890


{
   "pgno":1,
   "cnt":20,
   "totalCnt":1,
   "totalpg":1,
   "items":[
      {
         "name":"Bangkok Bank Chok Chai 4 Lat Phrao",
         "addr1":"Soi Chok Chai 4 Soi 24, Lat Phrao, Lat Phrao, Bangkok",
         "phone":"025305340",
         "cate":"27011",
         "posx":100.59697899967432,
         "posy":13.80723299458623,
         "entx":100.59678964,
         "enty":13.80722684,
         "dist":672,
         "postal":"10230"
      },
      {
         "name":"Krung Thai Bank Chok Chai 4 Soi 22",
         "addr1":"Soi Chok Chai 4 Soi 22, Lat Phrao, Lat Phrao, Bangkok",
         "phone":"025302571",
         "cate":"27012",
         "posx":100.59697095304728,
         "posy":13.806722117587924,
         "entx":100.59687766,
         "enty":13.80671649,
         "dist":718,
         "postal":"10230"
      },
             .............
             .............
      {
         "name":"Kasikorn Bank Chok Chai 4",
         "addr1":"Soi Lat Phrao 53 (Chok Chai 4), Saphan Song, Wang Thonglang, Bangkok",
         "phone":"025398735",
         "cate":"27014",
         "posx":100.59553362429142,
         "posy":13.798390505835414,
         "entx":100.59558576,
         "enty":13.79838555,
         "dist":1615,
         "postal":"10310"
      },
      {
         "name":"Government Savings Bank Green Plaza (Wang Hin)",
         "addr1":"Soi Lat Phrao Wang Hin 77 (Soi Bua Rung), Lat Phrao, Lat Phrao, Bangkok",
         "phone":"025786038",
         "cate":"27020",
         "posx":100.59141928330064,
         "posy":13.823720449581742,
         "entx":100.59155451,
         "enty":13.82361508,
         "dist":1656,
         "postal":"10230"
      },
      {
         "name":"Cimb Thai Bank Centralfestival Eastville",
         "addr1":"Soi Nakniwat 6, Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"27023",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      },
      {
         "name":"Siam Commercial Bank Central Festival Eastville Sme Business Center",
         "addr1":"Pradit Manutham Rd., Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"27017",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      },
      {
         "name":"UOB Bank Centralfestival Eastville",
         "addr1":"Pradit Manutham Rd., Lat Phrao, Lat Phrao, Bangkok",
         "phone":"020935888",
         "cate":"27025",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      },
      {
         "name":"Bangkok Bank Centralfestival Eastville",
         "addr1":"Pradit Manutham Rd., Lat Phrao, Lat Phrao, Bangkok",
         "phone":"025536124",
         "cate":"27011",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      },
      {
         "name":"Kasikorn Bank Centralfestival Eastville",
         "addr1":"Pradit Manutham Rd., Lat Phrao, Lat Phrao, Bangkok",
         "phone":"020419030",
         "cate":"27014",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      },
      {
         "name":"TMB Bank Centralfestival Eastville",
         "addr1":"Pradit Manutham Rd., Lat Phrao, Lat Phrao, Bangkok",
         "phone":"025536151",
         "cate":"27015",
         "posx":100.61363803222775,
         "posy":13.803701447322965,
         "entx":100.61522448,
         "enty":13.8017536,
         "dist":1658,
         "postal":"10230"
      }
   ]
}
```

{% endtab %}
{% endtabs %}


# Address

Find a location by an address

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## Address

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/search/ADDR`

Returns search results based on address search queries and coordinate settings

#### Query Parameters

| Name  | Type   | Description                                                                               |
| ----- | ------ | ----------------------------------------------------------------------------------------- |
| key   | string | Your API Key.                                                                             |
| kwd   | string | <p>Search word (string to hex encoding)<br>{Ogeumno182} to {ec98a4eab888eba19c313832}</p> |
| stype | string | Search type: 2 (for address search)                                                       |
| cx    | string | User's current location X coordinate (wgs84)                                              |
| cy    | string | User's current location Y coordinate (wgs84)                                              |

{% tabs %}
{% tab title="200 " %}

```javascript
GET
https://api.fatos.biz/nostra/api/search/ADDR?key=YOUR_API_KEY&kwd=536f69&stype=2&cx=100.600855&cy=13.811968


{
   "pgno":1,
   "cnt":20,
   "totalCnt":1,
   "totalpg":1,
   "items":[
      {
         "name":"Inthra Department Store (Soi Wang Thong)",
         "addr1":"Ratchaprarop Rd., Thanon Phaya Thai, Ratchathewi, Bangkok",
         "phone":"022080022",
         "cate":"21020",
         "posx":100.5410311371088,
         "posy":13.75199113972485,
         "entx":100.54136682,
         "enty":13.75191756,
         "dist":9284,
         "postal":"10400"
      },
      {
         "name":"Soi 14 Mini Plaza",
         "addr1":"Soi Loet Phatthana Nuea, Bang Kho, Chom Thong, Bangkok",
         "phone":"",
         "cate":"21020",
         "posx":100.47748725861311,
         "posy":13.703114921227098,
         "entx":100.47747289,
         "enty":13.70315614,
         "dist":18000,
         "postal":"10150"
      },
      {
         "name":"Chaomae Soi Dok Mak Park",
         "addr1":"Ban Kaeng Krachan Rd., Kaeng Krachan, Kaeng Krachan, Phetchaburi",
         "phone":"",
         "cate":"61000",
         "posx":99.64819215238094,
         "posy":12.90196624584496,
         "entx":99.64843636,
         "enty":12.90183411,
         "dist":144427,
         "postal":"76170"
      },
      {
         "name":"Khao Soi Dao Wildlife Preserve Area",
         "addr1":"Highway 3391, Sai Khao, Soi Dao, Chanthaburi",
         "phone":"039486337",
         "cate":"62000",
         "posx":102.1933595649898,
         "posy":13.103127479553223,
         "entx":102.19332435,
         "enty":13.10345999,
         "dist":189385,
         "postal":"22180"
      },
      {
         "name":"Phu Soi Dao National Park",
         "addr1":"Highway 1268, Bo Phak, Chat Trakan, Phitsanulok",
         "phone":"055436001",
         "cate":"62000",
         "posx":100.94716016203165,
         "posy":17.696453416720033,
         "entx":100.94693537,
         "enty":17.69660335,
         "dist":433500,
         "postal":"65170"
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-4 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60088211670518,
         "posy":13.811777662485838,
         "entx":100.60088227,
         "enty":13.81177771,
         "dist":21,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-6 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.6008018180728,
         "posy":13.812182424589992,
         "entx":100.60080183,
         "enty":13.8121825,
         "dist":24,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-2 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60095503926277,
         "posy":13.811439536511898,
         "entx":100.60095504,
         "enty":13.81143959,
         "dist":59,
         "postal":""
      },
      {
         "name":"Soi Sangsit 8",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.6013280339539,
         "posy":13.812485849484801,
         "entx":100.60132814,
         "enty":13.81248585,
         "dist":76,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 3 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60155602172017,
         "posy":13.811737345531583,
         "entx":100.60155617,
         "enty":13.81173742,
         "dist":79,
         "postal":""
      },
      {
         "name":"Soi Sangsit 7",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60141218826175,
         "posy":13.812848450616002,
         "entx":100.60141223,
         "enty":13.8128485,
         "dist":114,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.59992959722877,
         "posy":13.81145621649921,
         "entx":100.59992968,
         "enty":13.81145628,
         "dist":114,
         "postal":""
      },
      {
         "name":"Soi Sangsit 9",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60208357870579,
         "posy":13.812247049063444,
         "entx":100.60208361,
         "enty":13.81224706,
         "dist":136,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-5 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.59953162446618,
         "posy":13.81193658336997,
         "entx":100.59953164,
         "enty":13.81193664,
         "dist":142,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-3 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.59958124533296,
         "posy":13.811593931168318,
         "entx":100.59958135,
         "enty":13.81159398,
         "dist":143,
         "postal":""
      },
      {
         "name":"Soi Muban Otsathit 5",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60071682557464,
         "posy":13.810672340914607,
         "entx":100.60071683,
         "enty":13.81067237,
         "dist":144,
         "postal":""
      },
      {
         "name":"Soi Sangsit 6",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.6013510003686,
         "posy":13.813186408951879,
         "entx":100.60135112,
         "enty":13.81318645,
         "dist":145,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 1-1 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.59963069856167,
         "posy":13.811250105500221,
         "entx":100.59963074,
         "enty":13.81125016,
         "dist":154,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 5-4 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60229178518057,
         "posy":13.811916969716549,
         "entx":100.6022918,
         "enty":13.81191704,
         "dist":155,
         "postal":""
      },
      {
         "name":"Soi Chok Chai 4 Soi 36 Yaek 4 (Soi Muban 34)",
         "addr1":", Lat Phrao, Lat Phrao, Bangkok",
         "phone":"",
         "cate":"STREET",
         "posx":100.60169029980898,
         "posy":13.810813492164016,
         "entx":100.60169046,
         "enty":13.81081353,
         "dist":156,
         "postal":""
      }
   ]
}
```

{% endtab %}
{% endtabs %}


# Geocoding

Process of converting between addresses and geographic coordinates


# Forward

Convert addresses into geographic coordinates

Forward geocoding uses address information to return the coordinates of the area as a coordinate list of polygons.

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## Forward Geocoding

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/geocoding/forward`

<https://api.fatos.biz/nostra/api/geocoding/forward?key=YOUR\\_API\\_KEY\\&q=starbucks\\&format=json\\&polygon=1\\&addressdetails=1>

#### Query Parameters

| Name           | Type    | Description                                                                                                                                                          |
| -------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key            | string  | Your API Key.                                                                                                                                                        |
| format         | string  | \[ xml \| json ], output type methods.                                                                                                                               |
| q              | string  | String to search with a keyword. A comma as a delimiter is optional but recommended for performance improvement.                                                     |
| q(Korean)      | string  | Used when the keyword is Korean.                                                                                                                                     |
| polygon        | integer | \[ 1 \| 0 ] Display the retrieved items or not.                                                                                                                      |
| addressdetails | integer | \[ 1 \| 0 ] Whether to separate addresses into details.                                                                                                              |
| acceptlanguage | string  | countrycode\[,countrycode]\[,countrycode] Limit search results to specific countries. (sg: singapore, th: thailand, id: indonesia, kr: korea, us: united states....) |

{% tabs %}
{% tab title="200 " %}

```javascript

[
   {
      "place_id":201729370,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":574232767,
      "boundingbox":[
         "14.6529907",
         "14.6531146",
         "121.0340492",
         "121.0341783"
      ],
      "lat":"14.65305215",
      "lon":"121.034113797629",
      "display_name":"Starbucks, Bagong Pag-asa, 1st District, Quezon City, Metro Manila, 1100, Philippines",
      "class":"landuse",
      "type":"retail",
      "importance":0.30000000000000004
   },
   {
      "place_id":212390751,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":653844914,
      "boundingbox":[
         "35.6887634",
         "35.689637",
         "-88.8645964",
         "-88.8639259"
      ],
      "lat":"35.68919695",
      "lon":"-88.8642631797254",
      "display_name":"Starbucks, Jackson, Madison County, Tennessee, USA",
      "class":"landuse",
      "type":"commercial",
      "importance":0.30000000000000004
   },
   {
      "place_id":220481158,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":699403412,
      "boundingbox":[
         "54.1970215",
         "54.1975768",
         "-1.3640128",
         "-1.3628934"
      ],
      "lat":"54.19731615",
      "lon":"-1.36342356572266",
      "display_name":"Starbucks, Topcliffe, Hambleton, North Yorkshire, Yorkshire and the Humber, England, UK",
      "class":"landuse",
      "type":"construction",
      "importance":0.30000000000000004
   },
   {
      "place_id":209262468,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":630629643,
      "boundingbox":[
         "45.5201776",
         "45.5206305",
         "-123.0495263",
         "-123.0491338"
      ],
      "lat":"45.5202415",
      "lon":"-123.0495263",
      "display_name":"starbucks, Cornelius, Washington County, Oregon, 97113-8912, USA",
      "class":"highway",
      "type":"service",
      "importance":0.185
   },
   {
      "place_id":203234991,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":585748043,
      "boundingbox":[
         "42.5958064",
         "42.5960583",
         "-114.4537878",
         "-114.4531201"
      ],
      "lat":"42.5960328",
      "lon":"-114.4534149",
      "display_name":"Starbucks, Twin Falls, Twin Falls County, Idaho, 83303, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   },
   {
      "place_id":199933003,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":561682901,
      "boundingbox":[
         "40.141506",
         "40.14179",
         "-82.9883653",
         "-82.9878283"
      ],
      "lat":"40.141506",
      "lon":"-82.9880607",
      "display_name":"Starbucks, Polaris Towne Center, Columbus, Delaware County, Ohio, 43240, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   },
   {
      "place_id":199922259,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":561645620,
      "boundingbox":[
         "47.5957607",
         "47.5966273",
         "-122.6303493",
         "-122.6299422"
      ],
      "lat":"47.5961084",
      "lon":"-122.63003",
      "display_name":"Starbucks, Bremerton, Kitsap County, Washington, 98310, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   },
   {
      "place_id":210703648,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":641008084,
      "boundingbox":[
         "47.909268",
         "47.9098004",
         "-122.2255174",
         "-122.2254595"
      ],
      "lat":"47.909723",
      "lon":"-122.2255174",
      "display_name":"Starbucks, Intercity, Pinehurst, Everett, Snohomish County, Washington, 98204, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   },
   {
      "place_id":180885231,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":439064755,
      "boundingbox":[
         "38.592138",
         "38.5927772",
         "-90.5433536",
         "-90.5429724"
      ],
      "lat":"38.5927416",
      "lon":"-90.5431978",
      "display_name":"Starbucks, Olde Towne Plaza, Ballwin, Saint Louis County, Missouri, 63011, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   },
   {
      "place_id":157893372,
      "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
      "osm_type":"way",
      "osm_id":318593592,
      "boundingbox":[
         "37.8254181",
         "37.8257484",
         "-121.2366731",
         "-121.2361599"
      ],
      "lat":"37.8254181",
      "lon":"-121.2361599",
      "display_name":"Starbucks, Manteca, San Joaquin County, California, 95336, USA",
      "class":"highway",
      "type":"service",
      "importance":0.175
   }
]
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Either one of "q" or "q(Korean)" parameters should be used.
{% endhint %}


# Reverse

Convert geographic coordinates into addresses

Reverse geocoding uses latitude and longitude information to provide an address. An optional description of the zoom level provides information suitable for the OpenLayers room level.

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## Reverse Geocoding

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/geocoding/reverse`

<https://api.fatos.biz/nostra/api/geocoding/reverse?key=YOUR\\_API\\_KEY\\&format=json\\&lat=13.687091\\&lon=100.533239\\&zoom=18\\&addressdetails=1\\&accept-language=en>

#### Query Parameters

| Name | Type   | Description                       |
| ---- | ------ | --------------------------------- |
| key  | string | Your API Key.                     |
| lat  | string | Y coordinate of the search target |
| lon  | string | X coordinate of the search target |

{% tabs %}
{% tab title="200 " %}

```javascript

{
   "place_id":118088515,
   "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
   "osm_type":"way",
   "osm_id":153714066,
   "lat":"13.6871585047729",
   "lon":"100.533058061162",
   "display_name":"Thanon Sathu Pradit, Bang Phong Phang, Bangkok, Yannawa District, Bangkok, 10120, Thailand",
   "address":{
      "road":"Thanon Sathu Pradit",
      "neighbourhood":"Bang Phong Phang",
      "city":"Bangkok",
      "suburb":"Yannawa District",
      "state":"Bangkok",
      "postcode":"10120",
      "country":"Thailand",
      "country_code":"th"
   },
   "boundingbox":[
      "13.6789095",
      "13.6943457",
      "100.5289945",
      "100.5343971"
   ]
}
```

{% endtab %}
{% endtabs %}


# Geofencing

Object detection nearby a given site.

Geofencing is a private API where we provide functionalities for object detection within an area. You may check if registered vehicles are approaching or exitting a given site.

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MNwTWytURKD_IU_Vjuy%2F-MNwULdMlcILcAZwtYu2%2Fgeofencing.png?alt=media\&token=22505d7c-d9a6-4c49-a4a9-dfc1dcfe68d7)

With Geofencing API, you can notify if a registered object is nearby. The object, of course, can be any traceable object including a person, pet, bike, and more.

If you are interested in about Geofencing API, please contact our sales team. \
\
**<sales@fatoscorp.com>**&#x20;


# Routing

Set routing options with various options including waypoints, vehicle types and road priorities


# Route

Flexible instructions to the destination

The Routing API will show you how to get where you’re going.\
With the Routing API, you can:

* Provide precise instructions to a destination using various transport modes (e.g., car, public transit, bicycle).
* To request directions, call four values: a start point, destination, and car type, and waypoint (optional).

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## Routing API

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/route`

​Example API Call:\
\
<https://api.fatos.biz/nostra/api/route?key=YOUR\\_API\\_KEY\\&origin=13.729139,100.493947\\&destination=13.746328,100.512601\\&angle=-1\\&rpoption=3\\&unixtime=1604626833\\&gmtoffset=32400>

#### Query Parameters

| Name        | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startname   | string  | Starting place name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| destname    | string  | Destination name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| hipass      | integer | <p>0: None<br>1: Yes<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| fueltype    | integer | <p>0: Gasoline<br>1: Diesel<br>2: LPG<br>3: CNG<br>4: Electric<br>5: BioDiesel</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| pattern     | integer | <p>Reflect pattern information<br>0: Ignore<br>1: Reflect pattern information<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| gmtoffset   | string  | Timezone                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| unixtime    | string  | Time when requesting for RP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| traffic     | integer | <p>Reflect traffic information<br>0: Ignore<br>1: Reflect traffic information<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| carspeed    | integer | <p>0\~255<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| reqtype     | string  | <p>0: Initial RP request<br>1. Retry RP request on route deviation<br>2. User RP request<br>3. Periodic RP request<br>4. Request Route detail<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| origin      | string  | Start point (lat, lng)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| destination | string  | End point (lat, lng)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| key         | string  | Your API Key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| via         | number  | Waypoint (lat, lng), In the case of multiple waypoints, list them in order in the query string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| cartype     | integer | <p>car type <br>101: 2 Axles, less than 16 persons<br>102: 2 Axles, less than 32 persons<br>103: 2 Axles, less than 33 persons<br>104: 3 Axles, between 10 to 20 Ton<br>105: 4 Axles or above (Over 20 Ton)<br>106: 2 Axles, less than 1000cc<br><br>111: Truck with dangerous load<br>112: Truck<br>113: Construction Machinery<br>114: Construction Vehicle<br>115: Trailer<br>116: Farm Vehicle<br><br>121: Bus<br>122: Taxi<br>123: Taxi without passenger<br>124: Cart<br>125: HOV<br>126: Emergency<br>127: Motorcycle<br>128: 3 Wheel Motorcycle<br><br>141: Bicycle<br>142: Tricycle<br>143: Pedestrian<br>144: Pet<br>145: WheelChair<br>146: Visually Impaired<br></p> |
| rpoption    | integer | <p>Routing Plan Option<br>Sum of each option value.<br>1: Recommended 1<br>2: Recommended 2<br>4: Highway Priority<br>8: General road Priority<br>16: Shortest Distance<br>32: Free road (in the shortest time)<br>64: Exclude Car-only<br>256: Free road (in the shortest distance)<br><br>ex) rpoption 3 => Recommended 1 + Recommended 2<br></p>                                                                                                                                                                                                                                                                                                                              |
| gpsangle    | number  | degrees (0\~359)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "routes": [
    {
      "rpoption": 1,
      "bounds": {
        "lefttop": {
          "lon": 127.006812,
          "lat": 36.081916
        },
        "rightbottom": {
          "lon": 128.36276,
          "lat": 37.560658
        }
      },
      "legs": [
        {
          "distance": {
            "text": "339.7 km",
            "value": 339760
          },
          "duration": {
            "text": "265 min",
            "value": 15909
          },
          "end_location": {
            "lon": 128.325439,
            "lat": 36.144195
          },
          "start_location": {
            "lon": 127.02298,
            "lat": 37.559692
          },
          "step": [
            {
              "distance": {
                "text": "0 m",
                "value": 0
              },
              "duration": {
                "text": "0 sec",
                "value": 0
              },
              "end_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "start_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "polyline": {
                "points": "{zfdFmchfW"
              },
              "instructions": "starting point",
              "roadcategory": 12,
              "maneuver": 49
            },
            {
              // steps omitted
            },
            {
              "distance": {
                "text": "0.1 km",
                "value": 116
              },
              "duration": {
                "text": "56 sec",
                "value": 56
              },
              "end_location": {
                "lon": 127.023163,
                "lat": 37.560658
              },
              "start_location": {
                "lon": 127.022793,
                "lat": 37.559661
              },
              "polyline": {
                "points": "{zfdFmchfWIEUS]YGEGCWA_BI"
              },
              "instructions": "Destination",
              "roadcategory": 12,
              "maneuver": 3
            }
          ],
          "via_waypoint": [
            {
              "location": {
                "lon": 127.123108,
                "lat": 36.123123
              },
              "step_index": 27
            }
          ]
        }
      ],
      "overview_polyline": {
        "points_count": 3986,
        "points": "{zfdFmchfW??IEUS]YGEGCWA_BI?wBtDCP@Z@lCJ`@C\\G`@ULMx@eARS...."
      }
    }
  ],
  "status": "OK"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Display of Directions Results**

After you receive the requested results, you must decode the result into a geometry code. Call the Fatos.polyLine() function as the decoded result and display the result on the map.
{% endhint %}


# Route for truck

Routing plan optimized for truck

The Routing API will show you how to get where you’re going.\
With the Routing API, you can:

* Provide precise instructions to a destination using routing plans for various types of trucks
* To request directions, call four values: a start point, destination, and car type, and waypoint (optional).

{% hint style="info" %}
See the [**API Key Issuance page**](https://nostramap-doc.fatos.biz/get-your-api-key) for information on using keys.
{% endhint %}

## Routing API for Truck

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/nostra/api/route`

​Example API Call:\
\
<https://api.fatos.biz/nostra/api/route?key=YOUR\\_API\\_KEY\\&origin=37.483294848898396,126.89654749206602\\&destination=37.51702306480502,127.0416190159097\\&angle=-1\\&rpoption=1\\&unixtime=1604626833\\&gmtoffset=32400\\&cartype=1>

#### Query Parameters

| Name        | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startname   | string  | Starting place name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| destname    | string  | Destination name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| weight      | number  | <p>Vehicle Weight<br>i.e.<br>45 => 4.5t<br>55 => 5.5t<br><br>Default: 4.5t</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| height      | string  | <p>Vehicle Height<br>i.e.<br>35 => 3.5m<br>45 => 4.5m<br><br>Default: 3.5m</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| length      | string  | <p>Vehicle Length<br>i.e.<br>100 => 10m<br>150 => 15m<br><br>Default: 0m</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| uturn       | string  | <p>Available U-Turn Lanes<br><br>Default: 4</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| hipass      | integer | <p>0: None<br>1: Yes<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| fueltype    | integer | <p>0: Gasoline<br>1: Diesel<br>2: LPG<br>3: CNG<br>4: Electric<br>5: BioDiesel</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| pattern     | integer | <p>Reflect pattern information<br>0: Ignore<br>1: Reflect pattern information<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| gmtoffset   | string  | Timezone                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| unixtime    | string  | Time when requesting for RP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| traffic     | integer | <p>Reflect traffic information<br>0: Ignore<br>1: Reflect traffic information<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| carspeed    | integer | <p>0\~255<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| reqtype     | string  | <p>0: Initial RP request<br>1. Retry RP request on route deviation<br>2. User RP request<br>3. Periodic RP request<br>4. Request Route detail<br>Default: 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| origin      | string  | Start point (lat, lng)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| destination | string  | End point (lat, lng)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| key         | string  | Your API Key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| via         | number  | Waypoint (lat, lng), In the case of multiple waypoints, list them in order in the query string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| cartype     | integer | <p>car type <br>101: 2 Axles, less than 16 persons<br>102: 2 Axles, less than 32 persons<br>103: 2 Axles, less than 33 persons<br>104: 3 Axles, between 10 to 20 Ton<br>105: 4 Axles or above (Over 20 Ton)<br>106: 2 Axles, less than 1000cc<br><br>111: Truck with dangerous load<br>112: Truck<br>113: Construction Machinery<br>114: Construction Vehicle<br>115: Trailer<br>116: Farm Vehicle<br><br>121: Bus<br>122: Taxi<br>123: Taxi without passenger<br>124: Cart<br>125: HOV<br>126: Emergency<br>127: Motorcycle<br>128: 3 Wheel Motorcycle<br><br>141: Bicycle<br>142: Tricycle<br>143: Pedestrian<br>144: Pet<br>145: WheelChair<br>146: Visually Impaired<br></p> |
| rpoption    | integer | <p>Routing Plan Option<br>Sum of each option value.<br>1: Recommended 1<br>2: Recommended 2<br>4: Highway Priority<br>8: General road Priority<br>16: Shortest Distance<br>32: Free road (in the shortest time)<br>64: Exclude Car-only<br>256: Free road (in the shortest distance)<br><br>ex) rpoption 3 => Recommended 1 + Recommended 2<br></p>                                                                                                                                                                                                                                                                                                                              |
| gpsangle    | number  | degrees (0\~359)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Display of Directions Results**

After you receive the requested results, you must decode the result into a geometry code. Call the Fatos.polyLine() function as the decoded result and display the result on the map.
{% endhint %}


# Advanced


# Logistics

The logistics delivery API provides the function of optimal vehicle assignment, optimal route calculation, and accurate travel distance analysis, and helps to reduce cost, save time, and establish the best delivery plan and vehicle operation plan

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MLBVmWUfyMF2uztccpO%2Fuploads%2FB4INvMSTsW73VsS2keGQ%2F%E1%84%80%E1%85%B3%E1%84%85%E1%85%B5%E1%86%B71-1024x574.png?alt=media\&token=2cee3ee9-8253-4ad5-8ebb-6413f490c6a7)

**TMS**

<https://tms.fatos.biz>


# FATOS SDK

Users and companies today demand smart, immersive apps to help them move in more efficient ways. by integrating FATOS SDK into your apps, you can give users advanced location services that support their business. FATOS SDK is available for iOS, Android and React native.

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MNwUNT1fRX7W95vJUGN%2F-MNwUoBvdreSTvEWmciI%2FfatosSDK.png?alt=media\&token=e1441d5e-e034-4e44-ae78-844589babc69)

#### Features

| Feature                              | Description                                                                                                                                                             |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2D/3D vector map available worldwide | Available in 2d/3d mode over 190 countries, FATOS map are small in data size                                                                                            |
| Navigation                           | Just-in-time navigational instructions. Enhance the journey with dynamic information such as signposts and lanes                                                        |
| Hybrid mode                          | Allow users to browse maps, look for places and navigation to a location-even without a data connection. A hybrid engine renders vector map data directly on the device |

#### Documentation

{% content-ref url="/pages/-MLBq0qEXoS6WmBlO7iw" %}
[iOS](https://nostramap-doc.fatos.biz/fatos-sdk/platform/ios)
{% endcontent-ref %}

{% content-ref url="/pages/-MLBq0qBQBuI\_4ZtS3Uk" %}
[Android](https://nostramap-doc.fatos.biz/fatos-sdk/platform/android)
{% endcontent-ref %}

{% content-ref url="/pages/-MLBq0qH60IkEcaTrq--" %}
[React Native](https://nostramap-doc.fatos.biz/fatos-sdk/platform/react)
{% endcontent-ref %}


# Authentication

SDK authentication is a subject to change depending on a project's structure, format, or circumstance. Authentication protocols can be customized through discussion. Please contact our sales team for more information about SDK authenticaiton.\
\
**<sales@fatoscorp.com>**&#x20;


# Platform


# Android


# Start

How to install FatosSDK for Android development

In this section, a guide to set up development environment for FATOS SDK for Android will be introduced. The functions of the SDK are largely composed of map, search, and route planning related operations. The map function can control the map layers, settings, and operation. To use "FATOS SDK for Android", you must request an SDK key and then apply that key to the source. If you want an SDK key, please go to [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz) and request an SDK key after sign up.

Please let us know if you have any technical problems using our SDK\
Contact : <sales@fatoscorp.com>

## Development Environment

Clone or download FATOS SDK for Android from <https://github.com/devfatoscorp/fatos-android-sdk>

![Make sure to clone or download from the Clone menu](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2F93d6bfc685d1c358f23687fb64731c4d30d5db69.png?generation=1604385814798445\&alt=media)

FATOS SDK for Android is deployed as a form of AAR (Android Archive Package). Therefore, it must be linked within your project.

{% hint style="warning" %}
Make sure to check the compatibility

FATOS SDK for Android supports Android 5.0 or above (API Level 20 or above)
{% endhint %}

### To link AAR file

modify **app/build.gradle** like as follow:

```java
repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation(name:'fire_sdk_vX.X.X', ext:'aar')

....
```

### Permissions

To use FATOS SDK for Android, you must set 3 permission settings

```java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        int permissionResultWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
        int permissionResultACCESS_FINE_LOCATION = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);
        int permissionResultACCESS_READ_PHONE= checkSelfPermission(Manifest.permission.READ_PHONE_STATE);

        if (permissionResultWRITE_EXTERNAL_STORAGE == PackageManager.PERMISSION_DENIED
                || permissionResultACCESS_FINE_LOCATION == PackageManager.PERMISSION_DENIED
                || permissionResultACCESS_READ_PHONE == PackageManager.PERMISSION_DENIED) {
            requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.READ_PHONE_STATE}, 1000);
        }
        else {
            m_Handler.postDelayed(startMainActivity, 10);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
    else {
        m_Handler.postDelayed(startMainActivity, 10);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
```

For a flexible navigation feature to be used in your project, your "Application class" and "MainActivity" must be inherited from "ANaviApplication class" and "FMBaseActivity class" respectively.

```java
@Override
public class TNaviApplication extends ANaviApplication {
    private Context m_Context;
    @Override
    public void onCreate() {
    ...
    }
}


public class TNaviMainActivity extends FMBaseActivity {
...
}
```

FATOS SDK for Android requires that Navi Engine initialize. We strongly recommend you do so at onCreate() of MainActivity that extends FMBaseActivity.

```java
public class TNaviMainActivity extends FMBaseActivity {
    private void InitProcess() throws IOException {
        m_Context = this;
        m_gApp = (ANaviApplication) m_Context.getApplicationContext();
        m_route = m_gApp.getRouteApiInstance();
        FMInterface.CreateInstance(m_Context);
        m_FMInterface = FMInterface.GetInstance();
        m_iEngineInit = initFatosNaviEngine();

        if(m_iEngineInit != 1)
        {
            Intent intent = new Intent();
            intent.setAction(TNaviActionCode.READY_MAIN_MAP); // Action name
            sendBroadcast(intent);
            return;
        }
    }
}
```

### To add API key

You must set your API key through FMInterface.initKey() function at onCreate() method in your Application class.

```java
public class TNaviApplication extends ANaviApplication {
    private Context m_Context;

    @Override
    public void onCreate() {
        m_Context = this;
        FMInterface.initKey(m_Context, "FATOS SDK API key");
        super.onCreate();
        ...
        ...
```

If you haven't got an API key, please visit:

{% content-ref url="/pages/-MLBq0qMauzlD90hEzeg" %}
[Get your API Key](https://nostramap-doc.fatos.biz/get-your-api-key)
{% endcontent-ref %}


# Component

FATOS SDK for Android provides 5 main functionalities

## Map

* Provides FatosMap Fragment
* Provides Map Event, Callback functions for status information
* Provides flexibility to FatosMap
* Provides Map Option
* Provides Map Control API (Map Mode, Move coordinate, Zoom-in/out, Map picker, etc)

## Search

* Provides FATOS search results

## Route Plan

* Provides FATOS route planning results
* Provides route planning data management functions

## Route Guide

* Provides custom API for route guide horizontal / length response

## Provides Interface & Base Class

* Map, Route Guidance related controls and functions are provided through Base Class to reduce redundancy and complexity.
* Provides easy-to-implement navigation features.


# iOS


# Start

How to install FATOS SDK for iOS development

In this section, a guide to set up development environment for FATOS SDK for iOS will be introduced. The functions of the SDK are largely composed of map, search, and route planning related operations. The map function can control the map layers, settings, and operation. To use "FATOS SDK for iOS", you must request an SDK key and then apply that key to the source. If you want an SDK key, please go to [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz) and request an SDK key after sign up.

Please let us know if you have any technical problems using our SDK\
Contact : <sales@fatoscorp.com>

## Development Environment

Clone or download FATOS SDK for iOS from <https://github.com/devfatoscorp/fatos-ios-sdk>

![Make sure to clone or download from the Clone menu](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2F93749b75479a0778d2ae00a5bb98aeed82ecd3d2.png?generation=1604385814993161\&alt=media)

To use FATOS SDK for iOS, you must add following folders and files to your project.

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2F9671c406b87af21d57a2c0289ae804ab0e5bc631.png?generation=1604385815537676\&alt=media)

* include (static library header) (folder)
* libFatos.a (static library) (file)
* ResFatos.bundle (SDK resources) (file)

{% hint style="warning" %}
Make sure to check the compatibility

FATOS SDK for iOS supports Xcode 11 or higher

FATOS SDK for iOS supports iOS 13 or higher

FATOS SDK for iOS supports iOS hardware (Not simulators)
{% endhint %}

## To add libFatos.a and basic framework

Click to "project explorer" -> click **TARGETS** -> **Build Phases** -> add a FATOS SDK for iOS and framework needed to link binary with the library. Then, add the following items.

* libFatos.a (FATOS SDK for iOS)
* GLKit.framework
* OpenGLES.framework
* CoreLocation.framework
* AVFoundation.framework
* AudioToolbox.framework

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2Fd531a3b9710cf92ba0e8070045d34525460567e8.png?generation=1604385816043899\&alt=media)

## To add ResFatos.bundle (SDK resources)

Click "project explorer" -> click **TARGETS** -> **Build Phases** -> add ResFatos.bundle to copy Bundle Resources

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2F64f166c8ea2605ae7d1b2d2961675e10d3902be4.png?generation=1604385815371931\&alt=media)

## To link "include" folder (static library header)

Click "project explorer" -> click **TARGETS** -> click **Build Settings** -> **Search Paths** -> Set "**include**" folder path to "**Header Search Paths**"

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2Fe80b092cd1a27bd20785254e8f4e338a288e4a4e.png?generation=1604385815187798\&alt=media)

## To add SDK key

Go to "Project" -> "info.plist" and add "sdk\_key"

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2F6abc746cc26bc0d694ed0963ca0424d0995286b4.png?generation=1604385815794941\&alt=media)

If you haven't got a SDK key, please visit:

{% content-ref url="/pages/-MLBq0qMauzlD90hEzeg" %}
[Get your API Key](https://nostramap-doc.fatos.biz/get-your-api-key)
{% endcontent-ref %}


# Component

FATOS SDK for iOS provides 5 main functionalities.

## Map

* Provides FatosMapView
* Allows FatosMap to be flexible
* Provides Map Options
* Provides Map Control API (Map Mode, Move coordinate, Zoom-in/out, Map picker, etc)

## Search

* Provides FATOS search results

## Route Plan

* Provides FATOS route planning results
* Provides route planning data management functions

## Route Guide

* Provides custom API for route guide horizontal / length response

## Supply Interface & Base Class

* Map, Route Guidance related controls and functions are provided through Base Class to reduce redundancy and complexity.
* Provides easy-to-implement navigation functions.


# React Native


# Start

How to install FATOS SDK for React-Native

This is a multi-platform map SDK based on React Native. The functions of the SDK are largely composed of map, search, and route planning related operations. The map function can control the map layers, settings, and operation. To use "react-native-fatos-sdk", you must request an SDK key and then apply that key to the source. If you want an SDK key, please go to [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz) and request an SDK key after sign up.

Please let us know if you have any technical problems using our SDK\
Contact : <sales@fatoscorp.com>

## Development Environment

### Install our SDK with npm

```bash
react-native init "project name"
npm i react-native-fatos-sdk
```

In order to use Fatos SDK, you must use your SDK key on your project.\
For Android project, add your key to \[string.xml] file.\
For iOS project, add your key to \[info.plist] file.

### How to run example projects

For you to have a better understanding of our SDK, we included a small example project for Android and iOS. Once you install our SDK, you can run our example projects as follow:

{% tabs %}
{% tab title="Android" %}

1. Go to your Android project folder and navigate to /node\_modules/react-native-fatos-sdk/example
2. Open Android project in example name folder with Android Studio and Press the 'Refactor'(top of android studio menu)
3. Select 'Migrate to AndroidX'
4. Migrate the UI library used in the project to AndroidX-based. If build error occurs after migration, AndroidX must be manually applied.

![](https://github.com/devfatoscorp/react-native-fatos-sdk/raw/master/assets/img3.png)
{% endtab %}

{% tab title="iOS" %}

1. Go to your iOS project folder and navigate to /node\_modules/react-native-fatos-sdk/example
2. Run following commands in order

```bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "pwd/Pods/"
pod update
```

1. Add ResFatos.bundle so that Bundle Resources to be copied

![](https://github.com/devfatoscorp/react-native-fatos-sdk/raw/master/assets/img4.png)
{% endtab %}
{% endtabs %}

Once either of Android or iOS project setting is done, you can run the application with following commands

```bash
react-native run-ios
react-native run-android
```


# Component

You can find more in-depth explanation about our SDK at <https://www.npmjs.com/package/react-native-fatos-sdk>&#x20;

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MNwUNT1fRX7W95vJUGN%2F-MNwVOUW57rJ6VfeG-ze%2FreactSDK.png?alt=media\&token=f8ccf562-7af2-4418-aee8-305668a30005)

In this section, we will introduce a brief structure of the SDK interface.

**1. Structure description of react native ui**&#x20;

FatosMainView\.js is the top-level main view. It is rendered in the order in which it is registered in the function render(). function are rendered in the order in which they are registered. Unnecessary views can be unregistered. You can unregister unnecessary views.

```jsx

render() {

     return (
        <View style={styles.container}>
            {mapView}                // Map view
            {firstTbTView}           // TBT view
            {secondTbTView}          // TBT view
            {speedoMeterView}        // Speed view
            {RGView}                 // Map control view
            {SDIView}                // SDI view
            {bottomView}             // Bottom view
            {laneView}               // Lane information
            {searchView}             // Search view
            {searchListView}         // Search list view
            {routeSummaryView}       // Route summary view
            {summarySearchView}      // Route summary search view
            {summarySearchListView}  // Route summary search list view
            {webView}                // Web view
            {indicator}              // loading view
        </View>
    )
}
```

&#x20;**2. FatosEnvBridgeModule(Settings related)**

```jsx
1. Language settings
FatosEnvBridgeModule.SetLanguage(int) (int)FatosEnvBridgeModule.GetLanguage
0 KOREAN, 1 ENGLISH

2. Route line color
FatosEnvBridgeModule.SetPathLineColor(int)  (int)FatosEnvBridgeModule.GetPathLineColor
0 : Red, 1 : Blue, 2 : Green, 3 : Purple

3. Basic Route search option
FatosEnvBridgeModule.SetNavigationOptions(array(bool))
(JSON array)FatosEnvBridgeModule.GetNavigationOptions
0 : Recommended, 1 : Expressway priority, 2 : Avoid toll roads, 3 : Free road first, 4 : Shortest route

4. Map color
FatosEnvBridgeModule.SetMapColor(int)
(int)FatosEnvBridgeModule.GetMapColor
0 day, 1 night, 2 auto

5. Smart driving mode
FatosEnvBridgeModule.SetSmartDrivingMode(bool)
(bool)FatosEnvBridgeModule.GetSmartDrivingMode
true : On, false : Off

6. Camera guidance options
FatosEnvBridgeModule.SetCamreaOptions(array(bool)
(JSON array)FatosEnvBridgeModule.GetCamreaOptions
0 : Fixed camera, 1 : Mobile camera, 2 : Signal control section, 3 : Intervention control, 4 : Parking control, 5 : Bus lane

7. Caution section guidance options
FatosEnvBridgeModule.SetOperationState(array(bool))
(JSON array)FatosEnvBridgeModule.GetOperationState
0 : Sharp curve, 1 : Child protection zone, 2 : Accident hazard

8. Facility guidance options
FatosEnvBridgeModule.SetFacility(array(bool))
(JSON array)FatosEnvBridgeModule.GetFacility
0 : Traffic information collection

9. A guiding voice
FatosEnvBridgeModule.SetGuidevoice(int)
(int)FatosEnvBridgeModule.GetGuidevoice
0 : Detail(TTS) , 1 : Simple(Basic)

10. Cyclic rescan
FatosEnvBridgeModule.SetRediscover(int)
(int)FatosEnvBridgeModule.GetRediscover
0 : 5min, 1 : 10min

11. Waypoint direction
FatosEnvBridgeModule.SetWayPoint(int)
(int)FatosEnvBridgeModule GetWayPoint
0 : Use, 1 : Not use

12. Hi-pass
FatosEnvBridgeModule.SetHiPass(bool)
(String)FatosEnvBridgeModule.GetHiPass
true : On, false : Off

13. Vehicle type
FatosEnvBridgeModule.SetCarType(int)
(int)FatosEnvBridgeModule.GetCarType
0 : compact car, 1 : passenger car, 2 : SUV, 3 : MPV, 4 : Truck, 5 : Special freight vehicle

14. Fuel type
FatosEnvBridgeModule.SetFuel(int)
(int)FatosEnvBridgeModule.GetFuel
0 : Gasoline, 2 : diesel, 3 : LPG

15. Driver position option
FatosEnvBridgeModule.SetSeatPosition(int)
(int)FatosEnvBridgeModule.GetSeatPosition
0 : Left, 1 : Right

16. Current location lcon (cavata)
FatosEnvBridgeModule.SetCarvata(int)
(int)FatosEnvBridgeModule.GetCarvata
0 : White background, 1 : Blue background, 2 : Red arrow, 3 : Blue arrow
```

**3. FatosMapViewBridgeModule(Map function related)**

```jsx
1. Initialization function
In the “App.js” constructor, it requires initialization to “1” for the first time.
FatosMapViewBridgeModule.setListener(String)

2. Change view mode
FatosMapViewBridgeModule. setViewMode (int)
0 : MAP_VIEW_MODE_BIRD, 1 : MAP_VIEW_MODE_NORTHUP, 2: MAP_VIEW_MODE_HEADING

3. Change layer
FatosMapViewBridgeModule.setLayer(baseLayerType(map), bVisible(map))

Example of parameters

baseLayerType = {
    0: BASEMAP_LAYER_AEROPHOTO,
    1: BASEMAP_LAYER_BUILDING,
    2: BASEMAP_LAYER_POI,
    3: BASEMAP_LAYER_ROAD,
    4: BASEMAP_LAYER_SATELLITE
};

bVisible = {

    0: "false",
    1: "true",
    2: "true",
    3: "true",
    4: "false",

};

4. Map zoom-in
FatosMapViewBridgeModule.MapLevelIn()

5. Map zoom-out
FatosMapViewBridgeModule.OnMapLevelOut()

6. Move to current location
FatosMapViewBridgeModule.OnMapAuto()

7. Change Route summary view
Change the map view based on the line color(3 three), map scale and center value to be displayed in the route summary.
FatosMapViewBridgeModule.SummaryMapSetting(lineColor(map), xScale(float), yScale(float), hCenter(float), vCenter(float))

Example of lineColor parameter
Register rgba value separated by commas(,)
lineColor = {
    0: '' + 255 + ',' + 108 + ',' + 108 + ',' + 255,
    1: '' + 21 + ',' + 181 + ',' + 36 + ',' + 255,
    2: '' + 2 + ',' + 228 + ',' + 193 + ',' + 255,
};

8. Change basic(driving) map view
FatosMapViewBridgeModule.DefaultMapSetting()

9. Display the selected route on the route summary view
FatosMapViewBridgeModule.SelectRouteLine(index(int))

10. Select route to drive
FatosMapViewBridgeModule.ApplySelectRouteLine(index(int))

11. Map level update listener
Delivery the level when the map level changes
FatosMapViewBridgeModule.MapLevelUpdateListener(int)

12. administrative name of map current location update listener
Delivery administrative name of map center location
FatosMapViewBridgeModule.PosWorldLocationUpdateListener (String)

13. Map view touch status update listener
Delivery map view touch status change
FatosMapViewBridgeModule.TouchMoveModeListener (int)
    0 : Current location, 1 : On the move, 2 : Transfer completed
```

**4. FatosNaviBridgeModule(Navigation related)**

```jsx
1. Initialization function
In the “App.js” constructor, it requires initialization to “1” for the first time.
FatosNaviBridgeModule.setListener(String)

2 Search
FatosNaviBridgeModule.Search(searchText(String), flag(int))
Use search flag as 1

3. Search result listener
FatosNaviBridgeModule.SearchResultListener (JSON)		{

{

    pgno : “page number”,
    cnt : “number of searches”
    items : [

             {

                "id" : "POI ID",
                "addr1" : "POI Display name",
                "addr2" : "New address(the road name address)",
                "phone" : Phone number(separators comma(,))",
                "cate" : "Classification code",
                "posx" : "POI X coordinates",
                "posy" : "POI Y coordinates",
                "entx" : “POI point of entry X coordinates",
                "enty" : "POI point of entry Y coordinates",
                "dist" : "distance"

             }

        ]

}


4. Request route planning
FatosNaviBridgeModule.Route(startLat(String), startLon(String), goalLat(String), goalLon(String))
If the start point coordinates(startLat, startLon)are set to 0, the current location is automatically set.

5. Request rescan
FatosNaviBridgeModule.Rescan()

6. Route request completed listener
FatosNaviBridgeModule.RouteResultListener(int)
0 : initial search, 1 : Rescan, 2 : Cyclic rescan

7. Cancel the route
FatosNaviBridgeModule.CancelRoute()

8. Start simulated driving
FatosNaviBridgeModule.StartSimulation()

9. Control simulated driving
FatosNaviBridgeModule.DriveControl(int)
0 : Pause, 1 : Restart

10. Simulated driving speed(km/h)
FatosNaviBridgeModule.DriveSpeed(int)

11. End of simulated driving
FatosNaviBridgeModule.DriveClose()

12. Start route guidance
FatosNaviBridgeModule.StartRouteGuidance(index(int))
index selected in route summary

13. Start of simulated driving
FatosNaviBridgeModule.StartSimulation(index(int)
Use index set in FatosMapViewBridgeModule.ApplySelectRouteLine

14. Route summary information
(JSON)FatosNaviBridgeModule.GetRouteSummaryJson()

{
contexts : [
        {

            "Type" : "(int)Route planning option",
            "Length" : "(String)Total distance",
            "Time" : "(int)Total time",
            "Fee" : "(int) Charge information,
            "AvgSpeed" :"(int) section average speed",
            "TurnCongestion" : "(int) section congestion"

        }

    ]

}


15. RG(Driving/Simulated) Date update listener
Send once per second
FatosNaviBridgeModule.UpdateRGListener ((JSON))

{

"MMStatus" : "(int)GPS information",
"CarSpeed" : "(int) speed",
"LocationText" : "(String)location information",
"X" : "(double) location coordinates x",
"Y" : "(double) location coordinates y",
"Angle" : "(float) angle",
"FirstTbTShow" : "(Bool)First TBT exposure",
"SecondTbTShow" : "(Bool)Second TbT exposure,
"SdiShow" : "(Bool)Sdi exposure",
"DriveMode" : "(int) Driving condition",

// If you have route
"CurDist" : "(String)current guidance remaining distance",
"CurType" : "(int)current guidance type",
"NextDist" : "(String) next guide remaining distance",
"NextType" : "(int) next guide type",
"StringText" : "(String) current guidance explanation",
"RemainDistance" : "(String) Remaining distance",
"RemainTime" : "(String) Remaining time",

// If you have sdi information
"ListSDIService" : [
    {
            "Type" : "(int)sdi type",
            "X" : "(int)sdi location coordinates x",
            "Y" : "(int)sdi location coordinates y",
            "Angle" : "(int)sdi angle",
            "MaxSpeed" : "(int) maximum speed limit",
            "SectionDist" : "(int) Total distance of interruption",
            "RemainDist" : "(String)sdi Remaining distance",
            "Weight" : "(int) Weight information about truck",
            "Height" : "(int) Height information about truck"
    }
],

// If you have lane information
"LaneInfo" : {
    "Dist" : "(int)Distance to the lane ",
    "DrawableList" : [
            {
                "Drawable" : "(String) information of lane ui",
                "CoverDrawable" : "(String) information of lane cover ui"
            }
        ]
    }
}

16. ShowIndicator Listener
Delivering to show loading UI during Route planning and search
FatosNaviBridgeModule.ShowIndicatorListener()

17. HideIndicator Listener
Delivering to hide loading UI during Route planning and search
FatosNaviBridgeModule.HideIndicatorListener()

18. App permission completed Listener
Passes whether or not to acquire the privilege so that the UI can be seen after acquiring the app right.
FatosNaviBridgeModule.PermissionCompleteListene()
```


# Release note


# FATOS Map API

## 2.4.9 - 2020-12-04

### New

* \[Map] Added a new option to set button control box visibility on map instance initialization.
* \[Button] Added functions to set visibility for Radius button.
  * mapInstance.onBtnRadius()
  * mapInstance.offBtnRadius()

## 2.4.8 - 2020-11-17

### New

* Cluster angle parameter has been added (-180 \~ 180). e.g. angle:0
* Marker offset parameter has been added. e.g. markerOffset: \[0, 0]

### Improved / Changed

* Improved server stability.


# API Server

## 2.4.8 - 2020-11-17

### Improved / Changed

* Improved server stability.
* Enhanced procedures for routing plan


# RP Server

## 2.4.0 - 2020-11-16

### Improved / Changed

* Reinforced stability and performance of routing plan


# Get your API Key

## How Do I Get an API Key?

Although we provide intuitive API functions and services, they are not available if you do not have an API Key. In order to get an account, please visit our console website [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz)

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MLpGO1kvB3OQymqR34w%2F-MLpgXdpWsHZQDNXqlKN%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202020-10-07%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%201.12.07.png?alt=media\&token=acef3e8c-65c0-4233-999d-b4fc013e5422)

Getting an API key is just as easy as signing up for an account.

1. Sign up for a FATOS account at [https://nostramap-console.fatos.biz/](https://nostramap-console.fatos.biz)
2. Verify your email (We send a verification mail)
3. Sign-in, you will get a free plan API key. (You can request a non-free API key for advanced features)

If you do not have a console account, hit the **sign up** button and get one!

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MLpGO1kvB3OQymqR34w%2F-MLpgpjZNc2bjVTcSOdq%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202020-11-11%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.06.52.png?alt=media\&token=336b7759-5b69-43a1-8bb5-af9cd3700613)

After you sign up with your information, a verification mail will be sent to the email you used to sign up.

![Click "Verify Email"](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2Fb6d33f4b8267d92972c57773fb1a73b4180760fa.png?generation=1604385814502322\&alt=media)

{% hint style="danger" %}
API key may not be available if you do not verify your email.
{% endhint %}

If you do have one, simply sign in and you will see your API Key at the top right corner of the page.

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2Fsync%2Ff598ef8723cdc54e49810a8189ba657c14ae1991.png?generation=1604385813852333\&alt=media)

Voilà! You have got an API key. With the key you have obtained, you can finally make use of any of FATOS SDK! Congratulation.


# Troubleshooting

<br>


# FAQ

## I have got an API / SDK key but it is not working. why is it?

### Why am I getting "403 Permission Denied"?

There could be numerous reasons why what you intend is not happening although you are sure that you have a valid API key. One of those cases is when you misconfigure acceptable IP address / Domain Names / App Bundle IDs in your console page. You can set only hosts with registered IP addresses in the console page can use your API key and misconfiguring such may bring unexpected result.&#x20;

![](https://2018858602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLBVmWUfyMF2uztccpO%2F-MQQGYmCqxIU2HfEKueV%2F-MQQNK_16omY7yW9MSn4%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-01-07%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.28.43.png?alt=media\&token=be9f3b1e-25f8-47ea-9cc6-4bb5c8fc06a1)

Above image is a security tab in the console page. By adding domain name, IP address, or app bundle ID, you can set a constraint such that only apps or browsers that conform to the registered domain name, IP address or app bundle ID may use your API Key. By setting them, even if your API key is exposed to other people, they won't be able to make use of your API Key.

For example, let's say you have set up a Domain Name as "MyDomain.com" in the security tab. If you are making an API call from other than "MyDomain.com" (i.e. **Postman** as it doesn't have domain name unless you set a domain name within Postman as well), our server will send "403 Permission Denied" as it will check the security policy of the API Key first before responding with successful return.

**tldr: Please double check your acceptable IP addresses configuration in your console page.**

##


