I'm new to GIS programming and I'm using OpenLayers for my GIS project. I want to know how to draw a linear map programmatically between two locations from a real geographical map (may be OpenLayers). I think there should be a projected coordinate system for this. Is there any distance mapping algorithm to accomplish this task?
I do not mean adding a vector layer to an existing map. I want create a separate line map looking at a real geo map (Obviously a path connecting two locations).
Original map

Linear map

