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.
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>)}
2. FatosEnvBridgeModule(Settings related)
1. Language settingsFatosEnvBridgeModule.SetLanguage(int) (int)FatosEnvBridgeModule.GetLanguage0 KOREAN, 1 ENGLISH2. Route line colorFatosEnvBridgeModule.SetPathLineColor(int) (int)FatosEnvBridgeModule.GetPathLineColor0 : Red, 1 : Blue, 2 : Green, 3 : Purple3. Basic Route search optionFatosEnvBridgeModule.SetNavigationOptions(array(bool))(JSON array)FatosEnvBridgeModule.GetNavigationOptions0 : Recommended, 1 : Expressway priority, 2 : Avoid toll roads, 3 : Free road first, 4 : Shortest route4. Map colorFatosEnvBridgeModule.SetMapColor(int)(int)FatosEnvBridgeModule.GetMapColor0 day, 1 night, 2 auto5. Smart driving modeFatosEnvBridgeModule.SetSmartDrivingMode(bool)(bool)FatosEnvBridgeModule.GetSmartDrivingModetrue : On, false : Off6. Camera guidance optionsFatosEnvBridgeModule.SetCamreaOptions(array(bool)(JSON array)FatosEnvBridgeModule.GetCamreaOptions0 : Fixed camera, 1 : Mobile camera, 2 : Signal control section, 3 : Intervention control, 4 : Parking control, 5 : Bus lane7. Caution section guidance optionsFatosEnvBridgeModule.SetOperationState(array(bool))(JSON array)FatosEnvBridgeModule.GetOperationState0 : Sharp curve, 1 : Child protection zone, 2 : Accident hazard8. Facility guidance optionsFatosEnvBridgeModule.SetFacility(array(bool))(JSON array)FatosEnvBridgeModule.GetFacility0 : Traffic information collection9. A guiding voiceFatosEnvBridgeModule.SetGuidevoice(int)(int)FatosEnvBridgeModule.GetGuidevoice0 : Detail(TTS) , 1 : Simple(Basic)10. Cyclic rescanFatosEnvBridgeModule.SetRediscover(int)(int)FatosEnvBridgeModule.GetRediscover0 : 5min, 1 : 10min11. Waypoint directionFatosEnvBridgeModule.SetWayPoint(int)(int)FatosEnvBridgeModule GetWayPoint0 : Use, 1 : Not use12. Hi-passFatosEnvBridgeModule.SetHiPass(bool)(String)FatosEnvBridgeModule.GetHiPasstrue : On, false : Off13. Vehicle typeFatosEnvBridgeModule.SetCarType(int)(int)FatosEnvBridgeModule.GetCarType0 : compact car, 1 : passenger car, 2 : SUV, 3 : MPV, 4 : Truck, 5 : Special freight vehicle14. Fuel typeFatosEnvBridgeModule.SetFuel(int)(int)FatosEnvBridgeModule.GetFuel0 : Gasoline, 2 : diesel, 3 : LPG15. Driver position optionFatosEnvBridgeModule.SetSeatPosition(int)(int)FatosEnvBridgeModule.GetSeatPosition0 : Left, 1 : Right16. Current location lcon (cavata)FatosEnvBridgeModule.SetCarvata(int)(int)FatosEnvBridgeModule.GetCarvata0 : White background, 1 : Blue background, 2 : Red arrow, 3 : Blue arrow
3. FatosMapViewBridgeModule(Map function related)
1. Initialization functionIn the “App.js” constructor, it requires initialization to “1” for the first time.FatosMapViewBridgeModule.setListener(String)2. Change view modeFatosMapViewBridgeModule. setViewMode (int)0 : MAP_VIEW_MODE_BIRD, 1 : MAP_VIEW_MODE_NORTHUP, 2: MAP_VIEW_MODE_HEADING3. Change layerFatosMapViewBridgeModule.setLayer(baseLayerType(map), bVisible(map))Example of parametersbaseLayerType = {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-inFatosMapViewBridgeModule.MapLevelIn()5. Map zoom-outFatosMapViewBridgeModule.OnMapLevelOut()6. Move to current locationFatosMapViewBridgeModule.OnMapAuto()7. Change Route summary viewChange 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 parameterRegister 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 viewFatosMapViewBridgeModule.DefaultMapSetting()9. Display the selected route on the route summary viewFatosMapViewBridgeModule.SelectRouteLine(index(int))10. Select route to driveFatosMapViewBridgeModule.ApplySelectRouteLine(index(int))11. Map level update listenerDelivery the level when the map level changesFatosMapViewBridgeModule.MapLevelUpdateListener(int)12. administrative name of map current location update listenerDelivery administrative name of map center locationFatosMapViewBridgeModule.PosWorldLocationUpdateListener (String)13. Map view touch status update listenerDelivery map view touch status changeFatosMapViewBridgeModule.TouchMoveModeListener (int)0 : Current location, 1 : On the move, 2 : Transfer completed
4. FatosNaviBridgeModule(Navigation related)
1. Initialization functionIn the “App.js” constructor, it requires initialization to “1” for the first time.FatosNaviBridgeModule.setListener(String)2 SearchFatosNaviBridgeModule.Search(searchText(String), flag(int))Use search flag as 13. Search result listenerFatosNaviBridgeModule.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 planningFatosNaviBridgeModule.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 rescanFatosNaviBridgeModule.Rescan()6. Route request completed listenerFatosNaviBridgeModule.RouteResultListener(int)0 : initial search, 1 : Rescan, 2 : Cyclic rescan7. Cancel the routeFatosNaviBridgeModule.CancelRoute()8. Start simulated drivingFatosNaviBridgeModule.StartSimulation()9. Control simulated drivingFatosNaviBridgeModule.DriveControl(int)0 : Pause, 1 : Restart10. Simulated driving speed(km/h)FatosNaviBridgeModule.DriveSpeed(int)11. End of simulated drivingFatosNaviBridgeModule.DriveClose()12. Start route guidanceFatosNaviBridgeModule.StartRouteGuidance(index(int))index selected in route summary13. Start of simulated drivingFatosNaviBridgeModule.StartSimulation(index(int)Use index set in FatosMapViewBridgeModule.ApplySelectRouteLine14. 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 listenerSend once per secondFatosNaviBridgeModule.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 ListenerDelivering to show loading UI during Route planning and searchFatosNaviBridgeModule.ShowIndicatorListener()17. HideIndicator ListenerDelivering to hide loading UI during Route planning and searchFatosNaviBridgeModule.HideIndicatorListener()18. App permission completed ListenerPasses whether or not to acquire the privilege so that the UI can be seen after acquiring the app right.FatosNaviBridgeModule.PermissionCompleteListene()