I am planning to draw a vehicle routing, how can I match the routing to only follow the roads and not cut through non-road area. Is there a map matching function to snap to roads on Cesium? Or any recommended libraries to use?
Currently there is no way to differentiate between roads and surrounding land in CesiumJS. If it helps, it is possible to clamp objects to tileset surfaces - see this Sandcastle example.
I think you need to use OSM data. They will be a collection of points. Visualize OSM data in Cesium and work with these objects. You can interpolate any large path and apply any pathfinding algorithm like Dijkstra.