amyleew / osrm-frontend

Frontend interface for project OSRM directions
http://amyleew.github.io/osrm-frontend/
1 stars 0 forks source link

Add working print button #21

Closed amyleew closed 9 years ago

amyleew commented 9 years ago

Adding print functionality https://github.com/amyleew/osrm-frontend/issues/10, barebones elements added and semi-functional...

image

Run locally, clicking print button provides link in console and link populates with correct route query string. Needs:

image

/cc @aaronlidman @TheMarex

amyleew commented 9 years ago

Stuck on this Uncaught TypeError: Cannot set property 'osrm' of undefined doesn't seem to be calling L.Routing.osrm properly @tristen

image

Calling a build and build-print script since i don't want to place the controls the same on the print page https://github.com/amyleew/osrm-frontend/blob/add-print/package.json#L8-L9

Do I need to call L.Routing.OSRM() differently here https://github.com/amyleew/osrm-frontend/blob/add-print/printing.js#L27

amyleew commented 9 years ago

Routing instructions are not properly passing into the instructions div tag. Instructions pass when I call L.Routing.control but not sure how to put them into the instructions div class or if that is the best work around.

image

.onAdd function is causing map.getSize() error below, although I can successfully console the value... image

amyleew commented 9 years ago

Fixed with map parameter pass ^^