How to create new layers for Leaflet Map in Vaadin

Dear friends, I’m using Leaflet map add-on (
) created by Matti Tahvonen. It works fine but I need some help from our community. How can I add new map layer (such as
implemented by Shramov and ported to Vaadin by Matti) for new map which also has its own
Leaflet JavaScript API
? I found class AbstractLeafletLayer… How can I do this (I know all methods and technique for
Leaflet JavaScript API
for maps I want to implement)?
Thanks for Your attention, best regards, Alex


I didn’t quite get what you are trying to accomplish. Are you trying to create new server side APIs for the add-on or commanding it also via JavaScript?

I’d definitely add missing feature to the add-on and continue using plain Java in your apps UI logic.


Hi Matti, great thank You for reply!
I try to explain. There are rather many map servers except google maps and open street, such as yandex maps (
), double gis (
), bing maps and others. They have as their native JavaScript APIs and also may using with Leaflet API (
). For example, the same Shramov plugin supports yandex maps (
) or Mikhalev plugin for 2gis (
And what i want? I strongly need to use this map layers (map servers - yandex, 2gis, bing and so on) with Your V-Leaflet add-on in Vaadin (write classes such as Yours LGoogleLayer and LOpenStreetMapLayer). How can I do this? If it’s very complicated, just describe what I need to do and where to start.
I would be very grateful to You for help,
Thank You, Alex

Ok, perfect. I have a simple example for you:

this project
. It makes Java wrappers for shramov extensions, but currently only supports Google Layers. You can look at those for an example, implementing Yandex layers should be pretty similar. If you end up in some issue, just let me know and I can help you. Then when Yandex layer is ready, I’ll pull your changes in and build a new release so that Yandex layers are available for the whole community.