dylanfprice / angular-gm

AngularJS Google Maps Directives
MIT License
197 stars 47 forks source link

Configurable angulargmMapController precision #10

Closed yyyar closed 11 years ago

yyyar commented 11 years ago

Hello!

I recently found out that angular-gm map doesn't show markers if they are very close to each other (<20m), instead it shows only last one. After looking to code I found out why that happens: one marker hash overwrites another marker hash.

For example, hash for markers (46.4296566871034, 30.7290279865265) and (46.4297768523488,30.729111135006) would be the same because of precision using for generating it.

src/directives/gmMarkers.js line 161

         var hash = position.toUrlValue(controller.precision);

Where controller.precision is a constant = 3 in controllers/angulargmMapController.js line 27

         consts.precision = 3;
....
....
 Object.defineProperties(this, {
        'precision': {
          value: consts.precision,
          writeable: false
        },

Could it be changed so precision property would be set from config instead of consts?

Thanks!