angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

Optimizing geojson directive to use addData method #43

Open nmccready opened 9 years ago

nmccready commented 9 years ago

From @facultymatt on January 19, 2015 16:0

Currently the geojson directive works by removing the geojson layer and creating it from scratch on every change.

This is not performant, and is not needed in many cases, for example:

For the first point, we could use the addData API to eliminate the need for removing the entire layer.


Additionally, what is the most performant way to use the directive as it currently exists? Any tips on this?

Copied from original issue: tombatossals/angular-leaflet-directive#609

nmccready commented 9 years ago

From @newmanw on February 9, 2015 15:32

+1

Great directives, but lacking dynamic support for vector layers

nmccready commented 9 years ago

From @amyhua on May 3, 2015 9:23

+1

nmccready commented 9 years ago

@facultymatt this could be fairly simple in a few ways. Currently I use this directive with watches disabled and explicitly up send in the updated model via create and clean on a directiveControl. The addition of a add / newData method would be trivial. However, it would be better to be consistent so all directiveControls are similar.

We could also add some logic to figure out what the newData is within watches but that too will need to configurable. This is because the more logic comparing in the watch the slower the watch becomes. Therefore should the newData be figured out by the application and if so why use the watch (use directiveControl). I am just thinking out loud here before any code is written.