-1

I've created my own map with an own mapType.

Now on this map I would like to enable the DirectionsService (routing) but I need my own paths (not the streets/rails that the DirectionsService sticks to).

Can I add my own paths to the DirectionsService which should be the base for calculating the route?

I have so far found this SO-Question but in my case I want to create these paths "on the fly" and inject them into the map without uploading a static path to google.

In an ideal case, when I calculate the route, the DirectionService should use roads from Google Maps AND my own paths to find the fastest way.

Example:

Say I have a garden in front of my house with a maze and the path through the maze is not in Google Maps. Now if I want directions through this maze I would need to add the path somehow - otherwise probably the best the DirectionsService can do is calculate the straight line between the start and the end point.

Community
  • 1
  • 1
NoRyb
  • 1,472
  • 1
  • 14
  • 35

1 Answers1

-1

Not entirely sure what you mean by custom paths, but it sounds like adding Waypoints to your directions might help. With it, you can modify the path that is generated from Directions.

Andy
  • 2,374
  • 3
  • 17
  • 20
  • as far as I understand, Waypoints can be added so a route passes through it (the path/street/rails must already be there). But let's say I have a garden in front of my house with a Maze and the Path through the Maze is not in Google Maps. Now if I want Directions through this maze I would need to add the Path somehow otherwise probably the best the DirectionsService can do is calculate the straight line between the start and the end point. I hope I could clarify(?) – NoRyb Mar 05 '15 at 08:06
  • 1
    No you can't. At least not with a documented API method. The Directions Service sticks to what the API knows as a walkable/drivable/etc. street or route. – MrUpsidown Mar 05 '15 at 08:09