amyleew / osrm-frontend

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

Add entire toolbar #16

Closed amyleew closed 9 years ago

amyleew commented 9 years ago

@TheMatrex - Looks like entire toolbar is being placed with classes and functionality added in /src/tools.js.

image

I tried to roll this into my code, the main error I'm stuck on is reading link button code in DOM event.

linkButton.title = localization[this.options.language]['Link']

image

I also got an error with npm run build:

WARN: Side effects in initialization of unused variable viewOptions [-:37,4]

What am I doing wrong here? Recent push https://github.com/amyleew/osrm-frontend/commit/417b70158bd7329ae2946a13c46c371781cd1743

/cc @tristen

tristen commented 9 years ago

Does this.options.language return en or de? Also, I'd write ['link'] in dot notation instead.

amyleew commented 9 years ago

Thanks @tristen. Success!

image

this.options.language was undefined, because it was not referenced in lrm_options.js. Added require('./leaflet_options'); and referenced in tools object src/lrm_options.js#L41