This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Embedded HTML map with route

3

Hi, I'm looking for a way to make an embedded map on a website with highlighted route from point A to B. the easiest way would be to make a screenshot of the map from openrouteservice.org, but my supervisor insists on making an interactive map (with zooming and everything). I've looked for a way to do it for quite some time, but didn't find anything useful.

In summary I'm trying to do something like this, GoogleMaps vs OSM

asked 07 Mar '13, 09:17

artii1989's gravatar image

artii1989
61114
accept rate: 0%

edited 07 Mar '13, 12:17

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

Sorry, but I've messed up the last link. it should look like this http://pastebin.com/kz41MKpz

(07 Mar '13, 09:20) artii1989
1

@artii1989's comment: fixed with the "edit" function.

(07 Mar '13, 11:52) aseerel4c26 ♦

One Answer:

4

Just for clarification (probably only for other readers of this question): openstreetmap.org does not provide routing functionality, it does not even provide a map service for everyone/every use.

I guess you could find a service that offers an embeddable map with routing function at List_of_OSM_based_Services#Routing. E.g. http://open.mapquestapi.com/sdk/js/v6.1.0/routing.html#draggableroutingcustomizable (oh, interesting, it looks as if this code example misses the required OSM credit and license). Update: I found an ''easy'' way (probably of many): go to http://open.mapquest.com/ , make your route, and then click "Send to" button and select "to your website". Example route (would be inside an iframe usually)./Update

Please look for licensing and usage restrictions for each service.

  • Questions about setting a marker on a map and
  • the Deploying_your_own_Slippy_Map page may be helpful, too.

Please mention it here (as "answer") if you found a service/solution for your problem.

answered 07 Mar '13, 12:10

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 07 Mar '13, 17:27

Thank you for your time and sorry for all the mistakes that I've made so far (like not noticing the edit button (-_-) )

(07 Mar '13, 12:32) artii1989

@artii1989: You're welcome! However, I guess someone else might have a much better answer than mine - e.g. a service which offers an <iframe> service (like in your code example). So, I would not "accept" my question, by now. ;-)

(07 Mar '13, 12:46) aseerel4c26 ♦

Source code available on GitHub .