Component
You can find more in-depth explanation about our SDK at https://www.npmjs.com/package/react-native-fatos-sdk
In this section, we will introduce a brief structure of the SDK interface.
1. Structure description of react native ui
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.
1
2
render() {
3
4
return (
5
<View style={styles.container}>
6
{mapView} // Map view
7
{firstTbTView} // TBT view
8
{secondTbTView} // TBT view
9
{speedoMeterView} // Speed view
10
{RGView} // Map control view
11
{SDIView} // SDI view
12
{bottomView} // Bottom view
13
{laneView} // Lane information
14
{searchView} // Search view
15
{searchListView} // Search list view
16
{routeSummaryView} // Route summary view
17
{summarySearchView} // Route summary search view
18
{summarySearchListView} // Route summary search list view
19
{webView} // Web view
20
{indicator} // loading view
21
</View>
22
)
23
}
Copied!
2. FatosEnvBridgeModule(Settings related)
1
1. Language settings
2
FatosEnvBridgeModule.SetLanguage(int) (int)FatosEnvBridgeModule.GetLanguage
3
0 KOREAN, 1 ENGLISH
4
5
2. Route line color
6
FatosEnvBridgeModule.SetPathLineColor(int) (int)FatosEnvBridgeModule.GetPathLineColor
7
0 : Red, 1 : Blue, 2 : Green, 3 : Purple
8
9
3. Basic Route search option
10
FatosEnvBridgeModule.SetNavigationOptions(array(bool))
11
(JSON array)FatosEnvBridgeModule.GetNavigationOptions
12
0 : Recommended, 1 : Expressway priority, 2 : Avoid toll roads, 3 : Free road first, 4 : Shortest route
13
14
4. Map color
15
FatosEnvBridgeModule.SetMapColor(int)
16
(int)FatosEnvBridgeModule.GetMapColor
17
0 day, 1 night, 2 auto
18
19
5. Smart driving mode
20
FatosEnvBridgeModule.SetSmartDrivingMode(bool)
21
(bool)FatosEnvBridgeModule.GetSmartDrivingMode
22
true : On, false : Off
23
24
6. Camera guidance options
25
FatosEnvBridgeModule.SetCamreaOptions(array(bool)
26
(JSON array)FatosEnvBridgeModule.GetCamreaOptions
27
0 : Fixed camera, 1 : Mobile camera, 2 : Signal control section, 3 : Intervention control, 4 : Parking control, 5 : Bus lane
28
29
7. Caution section guidance options
30
FatosEnvBridgeModule.SetOperationState(array(bool))
31
(JSON array)FatosEnvBridgeModule.GetOperationState
32
0 : Sharp curve, 1 : Child protection zone, 2 : Accident hazard
33
34
8. Facility guidance options
35
FatosEnvBridgeModule.SetFacility(array(bool))
36
(JSON array)FatosEnvBridgeModule.GetFacility
37
0 : Traffic information collection
38
39
9. A guiding voice
40
FatosEnvBridgeModule.SetGuidevoice(int)
41
(int)FatosEnvBridgeModule.GetGuidevoice
42
0 : Detail(TTS) , 1 : Simple(Basic)
43
44
10. Cyclic rescan
45
FatosEnvBridgeModule.SetRediscover(int)
46
(int)FatosEnvBridgeModule.GetRediscover
47
0 : 5min, 1 : 10min
48
49
11. Waypoint direction
50
FatosEnvBridgeModule.SetWayPoint(int)
51
(int)FatosEnvBridgeModule GetWayPoint
52
0 : Use, 1 : Not use
53
54
12. Hi-pass
55
FatosEnvBridgeModule.SetHiPass(bool)
56
(String)FatosEnvBridgeModule.GetHiPass
57
true : On, false : Off
58
59
13. Vehicle type
60
FatosEnvBridgeModule.SetCarType(int)
61
(int)FatosEnvBridgeModule.GetCarType
62
0 : compact car, 1 : passenger car, 2 : SUV, 3 : MPV, 4 : Truck, 5 : Special freight vehicle
63
64
14. Fuel type
65
FatosEnvBridgeModule.SetFuel(int)
66
(int)FatosEnvBridgeModule.GetFuel
67
0 : Gasoline, 2 : diesel, 3 : LPG
68
69
15. Driver position option
70
FatosEnvBridgeModule.SetSeatPosition(int)
71
(int)FatosEnvBridgeModule.GetSeatPosition
72
0 : Left, 1 : Right
73
74
16. Current location lcon (cavata)
75
FatosEnvBridgeModule.SetCarvata(int)
76
(int)FatosEnvBridgeModule.GetCarvata
77
0 : White background, 1 : Blue background, 2 : Red arrow, 3 : Blue arrow
Copied!
3. FatosMapViewBridgeModule(Map function related)
1
1. Initialization function
2
In the “App.js” constructor, it requires initialization to “1for the first time.
3
FatosMapViewBridgeModule.setListener(String)
4
5
2. Change view mode
6
FatosMapViewBridgeModule. setViewMode (int)
7
0 : MAP_VIEW_MODE_BIRD, 1 : MAP_VIEW_MODE_NORTHUP, 2: MAP_VIEW_MODE_HEADING
8
9
3. Change layer
10
FatosMapViewBridgeModule.setLayer(baseLayerType(map), bVisible(map))
11
12
Example of parameters
13
14
baseLayerType = {
15
0: BASEMAP_LAYER_AEROPHOTO,
16
1: BASEMAP_LAYER_BUILDING,
17
2: BASEMAP_LAYER_POI,
18
3: BASEMAP_LAYER_ROAD,
19
4: BASEMAP_LAYER_SATELLITE
20
};
21
22
bVisible = {
23
24
0: "false",
25
1: "true",
26
2: "true",
27
3: "true",
28
4: "false",
29
30
};
31
32
4. Map zoom-in
33
FatosMapViewBridgeModule.MapLevelIn()
34
35
5. Map zoom-out
36
FatosMapViewBridgeModule.OnMapLevelOut()
37
38
6. Move to current location
39
FatosMapViewBridgeModule.OnMapAuto()
40
41
7. Change Route summary view
42
Change the map view based on the line color(3 three), map scale and center value to be displayed in the route summary.
43
FatosMapViewBridgeModule.SummaryMapSetting(lineColor(map), xScale(float), yScale(float), hCenter(float), vCenter(float))
44
45
Example of lineColor parameter
46
Register rgba value separated by commas(,)
47
lineColor = {
48
0: '' + 255 + ',' + 108 + ',' + 108 + ',' + 255,
49
1: '' + 21 + ',' + 181 + ',' + 36 + ',' + 255,
50
2: '' + 2 + ',' + 228 + ',' + 193 + ',' + 255,
51
};
52
53
8. Change basic(driving) map view
54
FatosMapViewBridgeModule.DefaultMapSetting()
55
56
9. Display the selected route on the route summary view
57
FatosMapViewBridgeModule.SelectRouteLine(index(int))
58
59
10. Select route to drive
60
FatosMapViewBridgeModule.ApplySelectRouteLine(index(int))
61
62
11. Map level update listener
63
Delivery the level when the map level changes
64
FatosMapViewBridgeModule.MapLevelUpdateListener(int)
65
66
12. administrative name of map current location update listener
67
Delivery administrative name of map center location
68
FatosMapViewBridgeModule.PosWorldLocationUpdateListener (String)
69
70
13. Map view touch status update listener
71
Delivery map view touch status change
72
FatosMapViewBridgeModule.TouchMoveModeListener (int)
73
0 : Current location, 1 : On the move, 2 : Transfer completed
Copied!
4. FatosNaviBridgeModule(Navigation related)
1
1. Initialization function
2
In the “App.js” constructor, it requires initialization to “1for the first time.
3
FatosNaviBridgeModule.setListener(String)
4
5
2 Search
6
FatosNaviBridgeModule.Search(searchText(String), flag(int))
7
Use search flag as 1
8
9
3. Search result listener
10
FatosNaviBridgeModule.SearchResultListener (JSON) {
11
12
{
13
14
pgno : “page number”,
15
cnt : “number of searches”
16
items : [
17
18
{
19
20
"id" : "POI ID",
21
"addr1" : "POI Display name",
22
"addr2" : "New address(the road name address)",
23
"phone" : Phone number(separators comma(,))",
24
"cate" : "Classification code",
25
"posx" : "POI X coordinates",
26
"posy" : "POI Y coordinates",
27
"entx" :POI point of entry X coordinates",
28
"enty" : "POI point of entry Y coordinates",
29
"dist" : "distance"
30
31
}
32
33
]
34
35
}
36
37
38
4. Request route planning
39
FatosNaviBridgeModule.Route(startLat(String), startLon(String), goalLat(String), goalLon(String))
40
If the start point coordinates(startLat, startLon)are set to 0, the current location is automatically set.
41
42
5. Request rescan
43
FatosNaviBridgeModule.Rescan()
44
45
6. Route request completed listener
46
FatosNaviBridgeModule.RouteResultListener(int)
47
0 : initial search, 1 : Rescan, 2 : Cyclic rescan
48
49
7. Cancel the route
50
FatosNaviBridgeModule.CancelRoute()
51
52
8. Start simulated driving
53
FatosNaviBridgeModule.StartSimulation()
54
55
9. Control simulated driving
56
FatosNaviBridgeModule.DriveControl(int)
57
0 : Pause, 1 : Restart
58
59
10. Simulated driving speed(km/h)
60
FatosNaviBridgeModule.DriveSpeed(int)
61
62
11. End of simulated driving
63
FatosNaviBridgeModule.DriveClose()
64
65
12. Start route guidance
66
FatosNaviBridgeModule.StartRouteGuidance(index(int))
67
index selected in route summary
68
69
13. Start of simulated driving
70
FatosNaviBridgeModule.StartSimulation(index(int)
71
Use index set in FatosMapViewBridgeModule.ApplySelectRouteLine
72
73
14. Route summary information
74
(JSON)FatosNaviBridgeModule.GetRouteSummaryJson()
75
76
{
77
contexts : [
78
{
79
80
"Type" : "(int)Route planning option",
81
"Length" : "(String)Total distance",
82
"Time" : "(int)Total time",
83
"Fee" : "(int) Charge information,
84
"AvgSpeed" :"(int) section average speed",
85
"TurnCongestion" : "(int) section congestion"
86
87
}
88
89
]
90
91
}
92
93
94
15. RG(Driving/Simulated) Date update listener
95
Send once per second
96
FatosNaviBridgeModule.UpdateRGListener ((JSON))
97
98
{
99
100
"MMStatus" : "(int)GPS information",
101
"CarSpeed" : "(int) speed",
102
"LocationText" : "(String)location information",
103
"X" : "(double) location coordinates x",
104
"Y" : "(double) location coordinates y",
105
"Angle" : "(float) angle",
106
"FirstTbTShow" : "(Bool)First TBT exposure",
107
"SecondTbTShow" : "(Bool)Second TbT exposure,
108
"SdiShow" : "(Bool)Sdi exposure",
109
"DriveMode" : "(int) Driving condition",
110
111
// If you have route
112
"CurDist" : "(String)current guidance remaining distance",
113
"CurType" : "(int)current guidance type",
114
"NextDist" : "(String) next guide remaining distance",
115
"NextType" : "(int) next guide type",
116
"StringText" : "(String) current guidance explanation",
117
"RemainDistance" : "(String) Remaining distance",
118
"RemainTime" : "(String) Remaining time",
119
120
// If you have sdi information
121
"ListSDIService" : [
122
{
123
"Type" : "(int)sdi type",
124
"X" : "(int)sdi location coordinates x",
125
"Y" : "(int)sdi location coordinates y",
126
"Angle" : "(int)sdi angle",
127
"MaxSpeed" : "(int) maximum speed limit",
128
"SectionDist" : "(int) Total distance of interruption",
129
"RemainDist" : "(String)sdi Remaining distance",
130
"Weight" : "(int) Weight information about truck",
131
"Height" : "(int) Height information about truck"
132
}
133
],
134
135
// If you have lane information
136
"LaneInfo" : {
137
"Dist" : "(int)Distance to the lane ",
138
"DrawableList" : [
139
{
140
"Drawable" : "(String) information of lane ui",
141
"CoverDrawable" : "(String) information of lane cover ui"
142
}
143
]
144
}
145
}
146
147
16. ShowIndicator Listener
148
Delivering to show loading UI during Route planning and search
149
FatosNaviBridgeModule.ShowIndicatorListener()
150
151
17. HideIndicator Listener
152
Delivering to hide loading UI during Route planning and search
153
FatosNaviBridgeModule.HideIndicatorListener()
154
155
18. App permission completed Listener
156
Passes whether or not to acquire the privilege so that the UI can be seen after acquiring the app right.
157
FatosNaviBridgeModule.PermissionCompleteListene()
Copied!
Last modified 1yr ago
Copy link