5

I am working now a few weeks with Leaflet and Angular CLI on a project involving geo map and in-door maps (Leaflet custom maps).

The application is conceptually very simple. I have to provide the user with a list of in-door locations (e.g. room) in a form of a simple location tree table, where, on user click, a new in-door map must be called. Also, I have to make a custom search box with a few filtering options for searching through sets of structured data and plotting the data on the maps in a form of Leaflet markers.

The question I have is the following: What would be the best way to implement the 2 above mentioned controls (location tree and search box), taking into account the nature of the app and the technology I am working with (Leaflet library and Angular CLI (angular 4.x))?

From my point of view, I can see 2 options by now:

1) Create the controls (location tree and search box with filters) using Leaflet L.control.extended (negative(-): seems to me that I have to statically type html in the L.control.extended 'onAdd' function in order to create the controls -> no possible Angular 4 templating engine advantages)

2) Create the controls using Angular 4 Component's templates, in Angular 4 fashion, neglecting the very existence of Leaflet L.control.extended (negative: It seems to me that this option unnecessary complicates the app + intuitively seems wrong since Leaflet extended control seems 'as born' for such types of problems)

It would be great if I could dynamically nest Angular component inside Leaflet custom control somehow. Any suggestions?

Nuwanda
  • 123
  • 1
  • 6

0 Answers0