Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add new handler: src/handlers/runner.js #254

Merged
merged 2 commits into from
May 16, 2023
Merged

Add new handler: src/handlers/runner.js #254

merged 2 commits into from
May 16, 2023

Conversation

Raruto
Copy link
Owner

@Raruto Raruto commented Apr 29, 2023

Extract some code from: examples/leaflet-elevation_dynamic-runner.html and move into src/handlers/runner.js

Sample usage:

L.control.Elevation({
  handlers: [ 'Runner' ], // same as: import('https://unpkg.com/@raruto/leaflet-elevation/src/handlers/runner.js')
  runnerOptions: {
    polyline: { .. }, // L.Motion.Polyline control options
    motion: { .. },   // L.Motion.Polyline motion options
    marker: { .. }    // L.Motion.Polyline marker options
  },
});

controlElevation.on('eledata_loaded', ({ layer }) => {
  controlElevation.animate(layer, 1500);
});

Refer to Igor-Vladyka/leaflet.motion#options see for a more comprehensive list of available runnerOptions.

Related to: #215

@Raruto
Copy link
Owner Author

Raruto commented Apr 29, 2023

@bard0x here it is a sample integration, let me know if there's something wrong.

@Raruto Raruto merged commit 23ae382 into master May 16, 2023
@Raruto Raruto deleted the runner-handler branch May 16, 2023 15:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant