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

The "center" variable can't use a "-" on his key name #23

Open nmccready opened 9 years ago

nmccready commented 9 years ago

From @moretti on June 4, 2014 13:13

What is the reason behind this check?

if (attrs.center.search('-') !== -1) {
  $log.error('The "center" variable can\'t use a "-" on his key name: "' + attrs.center + '".');

It breaks a configuration like this one:

<leaflet center="{'lat': 51.508515, 'lng':-0.1254872, 'zoom':12}"><leaflet>

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

nmccready commented 9 years ago

I did see this in the code base and thought it was interesting as well. @tombatossals thoughts?

nmccready commented 9 years ago

From @simison on September 17, 2015 10:59

PS. A good reminder to comment code better. ;-)

nmccready commented 9 years ago

Or better yet use a function with proper naming that explains what it does.

nmccready commented 9 years ago

From @simison on September 17, 2015 13:12

Totally. :+1:

nmccready commented 9 years ago

Bumping this to 0.9.1