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

Routing plugin, hint please #18

Open
darionis opened this issue Aug 30, 2024 · 0 comments
Open

Routing plugin, hint please #18

darionis opened this issue Aug 30, 2024 · 0 comments

Comments

@darionis
Copy link

Hello,

I am trying to create a plugin for leaflet-routing-machine.

I started with

@NpmPackage(value = "leaflet-routing-machine", version = "3.2.12")
@JsModule("leaflet-routing-machine/dist/leaflet-routing-machine.js")
@CssImport(value = "leaflet-routing-machine/dist/leaflet-routing-machine.css", themeFor = "leaflet-map")
public class Routing extends Layer {
}

but I am really clueles about JS, so I need a quick hint, how to this with vaadin:

L.Routing.control({
  waypoints: [
    L.latLng(57.74, 11.94),
    L.latLng(57.6792, 11.949)
  ]
}).addTo(map);

I guess I somehow need to get hold of 'control' instance and pass waypoints, right? I will be able to work with it myself, but I just need small hint to get going:

  1. how do I get 'control' instance inside my Routing class?
  2. is extending Layer ok? Or shoud I extend LeafletControl

I have been through other plugins code, but they seem to be much simpler, so I wasn't able to figure it out myself.

Thanks!

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

No branches or pull requests

1 participant