[GIS] Map Routing in OpenLayers 3

openlayersreferencesrouting

I am searching for a solution for my current OpenLayers 3 application. We are now in need of adding what seems to be map routing. I have a small area, a building and a parking lot (about 5 or 6 acres) that does not have normal roads populated on it in OSM. I need to be able to add functionality so that a user is able to navigate from their current location (using ol3 geolocation) to another feature on the map.

This seems like it would not be difficult, however there are rooms and hallways in the building that are in this space so I need something that will be able to route lines on a path to help navigate the user from wherever they are. Basically I am looking for something similar to Google maps driving directions but not for driving, or on roads, but inside a building/parking lot. I did look on Google maps, and they have the room outlines, and hallway outlines that I would need. I am not sure how they obtain that data or how I could represent that in my own map and add routing around that.

I looked into OSRM but I am not sure it is the solution I will need.

Does anyone have a book or tutorial to recommend?

Best Answer

The question is more related with data and routing than OpenLayers 3. Since you only need to provide guidance in a small area, I would suggest to:

  • add the missing data to OpenStreetMap. You win and OpenStreetMap also wins detailed data.
  • use a routing engine able to import OpenStreetMap data, like OpenTripPlanner.
  • on your OpenLayers application, call the routing engine to compute the route and use the resulting line to give feedback to the user. See how the default OpenTripPlaner viewer works.

I mentioned OpenTripPlanner because you might want to calculate routes within areas and it can do that.

Related Question