Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add new handler: src/handlers/labels.js #252

Merged
merged 1 commit into from
May 16, 2023
Merged

Add new handler: src/handlers/labels.js #252

merged 1 commit into from
May 16, 2023

Conversation

Raruto
Copy link
Owner

@Raruto Raruto commented Apr 28, 2023

Sample usage:

L.control.Elevation({
  handlers: [ 'Labels' ], // same as: import('https://unpkg.com/@raruto/leaflet-elevation/src/handlers/labels.js')
  labelsRotation: 25,     // degrees
  labelsAlign: 'start'    // 'start' | 'middle' | 'end'
});

Closes: #211

@Raruto
Copy link
Owner Author

Raruto commented Apr 28, 2023

@hupe13 let me know what you think about it

@Raruto Raruto changed the title Add new handler: src/handlers/lables.js Add new handler: src/handlers/labels.js Apr 28, 2023
@hupe13
Copy link
Contributor

hupe13 commented Apr 28, 2023

In principle it works. But I need to test more. Some things do not seem to work properly.

@hupe13
Copy link
Contributor

hupe13 commented Apr 29, 2023

Some things do not seem to work properly.

Maybe it is my special code. It works not correct, if there are more than one map on a page. However, I cannot establish a rule under which conditions what happens, it is not always the same result.

@Raruto
Copy link
Owner Author

Raruto commented Apr 29, 2023

@hupe13 since dynamic imports are in use here, it is possible that this code still suffers from what is described within: #253

Basically, all the functions listed here below should first wait for the modules_loaded event before triggering / listening events themselves (with reference to elechart_init and elechart_axis event listeners used within the src/handlers/labels.js)

this._loadModules(this.options.handlers).then(() => { // Inject here required modules (data handlers)
this._initChart(container);
this._initButton(container);
this._initSummary(container);
this._initMarker(map);
this._initLayer(map);
this._modulesLoaded = true;
this.fire('modules_loaded');
});

If so, within your tests, try applying that patch #253 as well.

👋 Raruto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chart waypoint names goes beyond the edge
2 participants